使用 Pango 库将 GtkCalendar Widget Months 翻译成西班牙语

如何解决使用 Pango 库将 GtkCalendar Widget Months 翻译成西班牙语

早上好,我目前正在编写一个 GTK+3.0 应用程序,我正在笔记本中显示日历,并且显示正常,但我需要用西班牙语显示月份的 3 个字母缩写。我已经查看了 Pango Docs,但没有资助任何有用的东西,任何帮助将不胜感激。提前致谢。

代码如下:

#include <gtk/gtk.h>

static void destroy (GtkWidget*,gpointer) ;
static gboolean delete_event (GtkWidget*,GdkEvent*,gpointer) ;
static void switch_page(gtkbutton*,GtkNotebook*) ;



int main(int argc,char *argv[])
{
  GtkWidget *window,*label,*notebook ;
  GtkWidget *label1,*label2,*label3,*label4,*label5,*registro,*calendario,*child3,*child4,*child5  ;
  GtkWidget *calendar ;
  
    
  /* Initialize GTK+ and all its supporting libraries   */
  gtk_init (&argc,&argv) ;

  /* Create a new window,give it a title and display it to the user */
  window = gtk_window_new(GTK_WINDOW_TOPLEVEL) ;
  gtk_window_set_title(GTK_WINDOW(window),"SVNT Sistema de Vizualizacion de eventos de red");
 
  gtk_container_set_border_width (GTK_CONTAINER (window),10) ;
  gtk_widget_set_size_request(window,1024,600);

  /* Notebook deFinition */
  notebook = gtk_notebook_new() ;
  label1 = gtk_label_new ("Registro de Fallecidos") ;
  label2 = gtk_label_new ("Calendario") ;
  label3 = gtk_label_new ("Contabilidad") ;
  label4 = gtk_label_new ("Estadisticas") ;
  label5 = gtk_label_new ("Utiles") ;

  registro = gtk_label_new ("Aqui se mostrara un formulario para registrar los eventos de red") ;
  calendario = gtk_calendar_new () ;
  child3 = gtk_label_new ("En esta seccion se llevaran los gastos y las donaciones") ;
  child4 = gtk_label_new ("Muestra de Estadisticas ") ;
  child5 = gtk_label_new ("Salvas de la base de Datos") ;

  
  


  /* signal handling*/
  /*  Connect the main window to the destroy and delete_event signals */
  g_signal_connect(G_OBJECT (window),"destroy",G_CALLBACK (destroy),NULL);
  g_signal_connect(G_OBJECT (window),"delete_event",G_CALLBACK (delete_event),NULL);

  /* notebook signals,note the two tabs are connected to the same signal */
  g_signal_connect(G_OBJECT(registro),"clicked",G_CALLBACK(switch_page),(gpointer)notebook) ;
  g_signal_connect(G_OBJECT(calendario),(gpointer)notebook) ;
  g_signal_connect(G_OBJECT(child3),(gpointer)notebook) ;
  g_signal_connect(G_OBJECT(child4),(gpointer)notebook) ;
  g_signal_connect(G_OBJECT(child5),(gpointer)notebook) ;

  /*Append to pages in notebook container*/
  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),registro,label1) ;
  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),calendario,label2) ;
  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),child3,label3) ;
  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),child4,label4) ;
  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),child5,label5) ;

  gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook),GTK_POS_TOP);  
  

  /* Create a new GtkLabel widget that is selectable  */
  label = gtk_label_new("hola mundo");
  gtk_label_set_selectable(GTK_LABEL(label),FALSE) ;

  
  
  /* Add the widgets as a children widgets of the main window  */
  // gtk_container_add(GTK_CONTAINER(window),label);
  gtk_container_add(GTK_CONTAINER(window),notebook) ;

  gtk_widget_show_all(window) ;

  /* Hand control over to the main loop  */
  gtk_main() ;
  return 0 ;

}

/* Switch to the next or prevIoUs GtkNotebook page  */
static void switch_page(gtkbutton *button,GtkNotebook *notebook)
{
  gint page = gtk_notebook_get_current_page(notebook) ;

  if (page == 0)
    {
      gtk_notebook_set_current_page(notebook,1) ;
    }
  else
    {
     gtk_notebook_set_current_page(notebook,0) ;
    }
  
}

/* Stop the GTK+ main loop function when the window is destroyed  */

static void destroy(GtkWidget *window,gpointer data)
{
  gtk_main_quit();
}

/* Return FALSE to destroy the widget. by returning TRUE,you can cancel
   a delete-event. this can be used to confirm quitting the application  */
static gboolean delete_event(GtkWidget *window,GdkEvent *event,gpointer data)
{
  return FALSE ;
} 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?