diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index cf10456..0bfce82 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1825,6 +1825,12 @@ msgid "" "network or the Internet (even over slow connection channels)." msgstr "" +msgid "About" +msgstr "" + +msgid "Documentation" +msgstr "" + msgid "Generic 86-key PC" msgstr "" diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 12e9805..11cf630 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -475,14 +475,6 @@ msgstr "Настройка установщика завершена" msgid "System installation is about to begin" msgstr "Начало установки системы" -#: source/ubl-strings.h:128 -msgid "Documentation" -msgstr "Справка" - -#: source/ubl-strings.h:129 -msgid "About" -msgstr "О программе" - #: source/ubl-strings.h:131 msgid "Would you like to read documentation in the Web?" msgstr "Вы хотите прочитать документацию в Сети?" @@ -1985,6 +1977,12 @@ msgstr "" "Позволяет загрузку системы для бездисковых и обычных рабочих станций через " "локальную сеть или Интернет (даже используя \"слабые\" каналы связи)" +msgid "About" +msgstr "О программе" + +msgid "Documentation" +msgstr "Справка" + msgid "Afrikaans" msgstr "Африканский" diff --git a/source/ubinstall-gtk-ui-lang.c b/source/ubinstall-gtk-ui-lang.c index a14c223..ff5332a 100644 --- a/source/ubinstall-gtk-ui-lang.c +++ b/source/ubinstall-gtk-ui-lang.c @@ -249,6 +249,17 @@ void yon_translation_init(GtkBuilder *builder){ } else if (GTK_IS_TREE_VIEW_COLUMN(iter->data)){ cur_widget = G_OBJECT(iter->data); widget_text = yon_char_new(gtk_tree_view_column_get_title(GTK_TREE_VIEW_COLUMN(cur_widget))); + } else if (GTK_IS_MENU_ITEM(iter->data)){ + cur_widget = G_OBJECT(iter->data); + GList *list = gtk_container_get_children(GTK_CONTAINER(cur_widget)); + if (list) { + GtkWidget *widget = list->data; + g_list_free(list); + if (GTK_IS_BOX(widget)){ + continue; + } + } + widget_text = yon_char_new(gtk_menu_item_get_label(GTK_MENU_ITEM(cur_widget))); } else continue; g_object_set_data(G_OBJECT(cur_widget),"original_label",(void*)widget_text); @@ -258,6 +269,8 @@ void yon_translation_init(GtkBuilder *builder){ void yon_update_translation(main_window *widgets){ GtkBuilder *builder = widgets->builder; GSList *list = gtk_builder_get_objects(builder); + list = g_slist_append(list,widgets->DocumentationMenuItem); + list = g_slist_append(list,widgets->AboutMenuItem); GSList *iter; for (iter = list; iter; iter = iter->next){ if (iter->data == widgets->LicenceLabel){ @@ -275,6 +288,14 @@ void yon_update_translation(main_window *widgets){ if (!yon_char_is_empty(source_label)){ gtk_label_set_text(GTK_LABEL(cur_label),_(source_label)); } + + } else if (GTK_IS_MENU_ITEM(iter->data)){ + GtkWidget *cur_menu_item = GTK_WIDGET(iter->data); + char *source_label = g_object_get_data(G_OBJECT(cur_menu_item),"original_label"); + if (!yon_char_is_empty(source_label)){ + gtk_menu_item_set_label(GTK_MENU_ITEM(cur_menu_item),_(source_label)); + } + } else if (GTK_IS_TREE_VIEW_COLUMN(iter->data)){ GObject *cur_column = G_OBJECT(iter->data); char *source_label = g_object_get_data(G_OBJECT(cur_column),"original_label"); @@ -285,4 +306,28 @@ void yon_update_translation(main_window *widgets){ yon_set_locales_list(widgets); } } + { + GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->DocumentationMenuItem)); + GList *container = gtk_container_get_children(list->data); + + GObject *cur_button = G_OBJECT(container->next->data); + char *source_label = g_object_get_data(G_OBJECT(widgets->DocumentationMenuItem),"original_label"); + if (!yon_char_is_empty(source_label)){ + gtk_label_set_text(GTK_LABEL(cur_button),_(source_label)); + } + g_list_free(list); + g_list_free(container); + } + { + GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->AboutMenuItem)); + GList *container = gtk_container_get_children(list->data); + + GObject *cur_button = G_OBJECT(container->next->data); + char *source_label = g_object_get_data(G_OBJECT(widgets->AboutMenuItem),"original_label"); + if (!yon_char_is_empty(source_label)){ + gtk_label_set_text(GTK_LABEL(cur_button),_(source_label)); + } + g_list_free(list); + g_list_free(container); + } } \ No newline at end of file diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index c729aff..f655afe 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -724,6 +724,9 @@ void yon_main_window_create(main_window *widgets){ } g_signal_connect(G_OBJECT(widgets->MainWindow),"delete-event",G_CALLBACK(on_yon_exit),widgets); GtkWidget *menu = yon_gtk_builder_get_widget(builder,"menu2"); + + g_object_set_data(G_OBJECT(widgets->DocumentationMenuItem),"original_label",yon_char_new(DOCUMENTATION_LABEL)); + g_object_set_data(G_OBJECT(widgets->AboutMenuItem),"original_label",yon_char_new(ABOUT_LABEL)); gtk_style_context_add_class(gtk_widget_get_style_context(widgets->DocumentationMenuItem),"menuitemmiddle"); gtk_style_context_remove_class(gtk_widget_get_style_context(widgets->DocumentationMenuItem),"menuitemtop"); gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->DocumentationMenuItem); diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 3b214dd..5da39e2 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -123,6 +123,9 @@ NULL) #define DOCUMENTATION_HEAD_LABEL _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.") #define DOCUMENTATION_CHECK_LABEL _("Always redirect to online documentation") #define OPEN_DOCUMENTATION_LABEL _("Open documentation") +#define ABOUT_LABEL yon_char_get_localised_from_lib("About") +#define DOCUMENTATION_LABEL yon_char_get_localised_from_lib("Documentation") + #define INSTALLATION_ERROR _("Installation error") #define ATTENTION_NEXT_LABEL _("Attention! The system will be installed on the selected partition with OS already installed. All user data will be saved.") @@ -276,6 +279,11 @@ NULL) #define OFF_LABEL _("Off") #define DO_NOT_CONFIGURE_LABEL _("Do not configure") +#define LOAD_CUSTOM_LABEL yon_char_get_localised_from_lib("Load from specific file") +#define LOAD_LOCAL_LABEL yon_char_get_localised_from_lib("Load local configuration") +#define LOAD_GLOBAL_LABEL yon_char_get_localised_from_lib("Load global configuration") +#define LOAD_LABEL yon_char_get_localised_from_lib("Load") + // #define _LABEL _("Select your language:") // #define _LABEL _("Selecting additional system kernel components") // #define _LABEL _("Package:")