From e47270ce771a7656e0f766973a88a97ed7487ce4 Mon Sep 17 00:00:00 2001 From: theadib Date: Mon, 5 Jan 2009 10:09:34 +0000 Subject: [PATCH] move option: interface language from INTERNATIONALISATION to INTERFACE page on preferences dialogue --- src/inkscape.cpp | 6 +-- src/preferences-skeleton.h | 2 +- src/ui/dialog/inkscape-preferences.cpp | 54 +++++++++++--------------- src/ui/dialog/inkscape-preferences.h | 17 ++++---- 4 files changed, 36 insertions(+), 43 deletions(-) diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 8cd01c226..ae5258904 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -756,10 +756,10 @@ inkscape_application_init (const gchar *argv0, gboolean use_gui) sp_input_load_from_preferences(); /* set language for user interface according setting in preferences */ - Glib::ustring i18n = prefs->getString("/i18n/language"); - if(!i18n.empty()) + Glib::ustring ui_language = prefs->getString("/ui/language"); + if(!ui_language.empty()) { - setenv("LANGUAGE", i18n, 1); + setenv("LANGUAGE", ui_language, 1); } /* DebugDialog redirection. On Linux, default to OFF, on Win32, default to ON. diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index 6b477f12e..1c8287fe0 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -424,7 +424,7 @@ static char const preferences_skeleton[] = " \n" " \n" " \n" -" \n" "\n" "\n"; diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index b086dd3e6..a15af896b 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -119,8 +119,7 @@ InkscapePreferences::InkscapePreferences() initPageSteps(); initPageWindows(); initPageMisc(); - initPageI18n(); - + signalPresent().connect(sigc::mem_fun(*this, &InkscapePreferences::_presentPages)); //calculate the size request for this dialog @@ -1032,6 +1031,28 @@ void InkscapePreferences::initPageSVGOutput() void InkscapePreferences::initPageUI() { + Glib::ustring languages[] = {_("System default"), _("am Amharic"), _("ar Arabic"), _("az Azerbaijani"), _("be Belarusian"), + _("bg Bulgarian"), _("bn Bengali"), _("br Breton"), _("ca Catalan"), _("ca@valencia Valencian Catalan"), _("cs Czech"), + _("da Danish"), _("de German"), _("dz Dzongkha"), _("el Greek"), _("en English"), _("en_AU English, as spoken in Australia"), + _("en_CA English, as spoken in Canada"), _("en_GB English, as spoken in Great Britain"), _("en_US@piglatin Pig Latin"), + _("eo Esperanto"), _("es Spanish"), _("es_MX Spanish, as spoken in Mexico"),_("et Estonian"), _("eu Basque"), _("fi Finnish"), + _("fr French"), _("ga Irish"), _("gl Galician"), _("he Hebrew"), _("hr Croatian"), _("hu Hungarian"), _("hy Armenian"), + _("id Indonesian"), _("it Italian"), _("ja Japanese"), _("km Khmer"), _("ko Korean"), _("lt Lithuanian"), _("mk Macedonian"), + _("mn Mongolian"), _("nb Norwegian Bokmål"), _("ne Nepali"), _("nl Dutch"), _("nn Norwegian Nynorsk"), _("pa Panjabi"), + _("pl Polish"), _("pt Portuguese"), _("pt_BR Portuguese, as spoken in Brazil"), _("ro Romanian"), _("ru Russian"), + _("rw Kinyarwanda"), _("sk Slovak"), _("sl Slovenian"), _("sq Albanian"), _("sr Serbian"), _("sr@latin Serbian in Latin script"), + _("sv Swedish"), _("th Thai"), _("tr Turkish"), _("uk Ukrainian"), _("vi Vietnamese"), _("zh_CN Chinese, as spoken in China"), + _("zh_TW Chinese, as spoken in Taiwan")}; + Glib::ustring langValues[] = {"", "am", "ar", "az", "be", "bg", "bn", "br", "ca", "ca@valencia", "cs", "da", "de", + "dz", "el", "en", "en_AU", "en_CA", "en_GB", "en_US@piglatin", "eo", "es_MX", "es", "et", "eu", "fi", "fr", "ga", + "gl", "he", "hr", "hu", "hy", "id", "it", "ja", "km", "ko", "lt", "mk", "mn", "nb", "ne", "nl", "nn", "pa", + "pl", "pt_BR", "pt", "ro", "ru", "rw", "sk", "sl", "sq", "sr@latin", "sr", "sv", "th", "tr", "uk", "vi", + "zh_CN", "zh_TW"}; + + _ui_languages.init( "/ui/language", languages, langValues, G_N_ELEMENTS(languages), _("System")); + _page_ui.add_line( false, _("Language (requires restart):"), _ui_languages, "", + _("Set the language for menues and number-formats"), false); + Glib::ustring sizeLabels[] = {_("Normal"), _("Medium"), _("Small")}; int sizeValues[] = {0, 1, 2}; @@ -1152,35 +1173,6 @@ void InkscapePreferences::initPageMisc() this->AddPage(_page_misc, _("Misc"), PREFS_PAGE_MISC); } -void InkscapePreferences::initPageI18n() -{ - Glib::ustring languages[] = {_("System default"), _("am Amharic"), _("ar Arabic"), _("az Azerbaijani"), _("be Belarusian"), - _("bg Bulgarian"), _("bn Bengali"), _("br Breton"), _("ca Catalan"), _("ca@valencia Valencian Catalan"), _("cs Czech"), - _("da Danish"), _("de German"), _("dz Dzongkha"), _("el Greek"), _("en English"), _("en_AU English, as spoken in Australia"), - _("en_CA English, as spoken in Canada"), _("en_GB English, as spoken in Great Britain"), _("en_US@piglatin Pig Latin"), - _("eo Esperanto"), _("es Spanish"), _("es_MX Spanish, as spoken in Mexico"),_("et Estonian"), _("eu Basque"), _("fi Finnish"), - _("fr French"), _("ga Irish"), _("gl Galician"), _("he Hebrew"), _("hr Croatian"), _("hu Hungarian"), _("hy Armenian"), - _("id Indonesian"), _("it Italian"), _("ja Japanese"), _("km Khmer"), _("ko Korean"), _("lt Lithuanian"), _("mk Macedonian"), - _("mn Mongolian"), _("nb Norwegian Bokmål"), _("ne Nepali"), _("nl Dutch"), _("nn Norwegian Nynorsk"), _("pa Panjabi"), - _("pl Polish"), _("pt Portuguese"), _("pt_BR Portuguese, as spoken in Brazil"), _("ro Romanian"), _("ru Russian"), - _("rw Kinyarwanda"), _("sk Slovak"), _("sl Slovenian"), _("sq Albanian"), _("sr Serbian"), _("sr@latin Serbian in Latin script"), - _("sv Swedish"), _("th Thai"), _("tr Turkish"), _("uk Ukrainian"), _("vi Vietnamese"), _("zh_CN Chinese, as spoken in China"), - _("zh_TW Chinese, as spoken in Taiwan")}; - Glib::ustring langValues[] = {"", "am", "ar", "az", "be", "bg", "bn", "br", "ca", "ca@valencia", "cs", "da", "de", - "dz", "el", "en", "en_AU", "en_CA", "en_GB", "en_US@piglatin", "eo", "es_MX", "es", "et", "eu", "fi", "fr", "ga", - "gl", "he", "hr", "hu", "hy", "id", "it", "ja", "km", "ko", "lt", "mk", "mn", "nb", "ne", "nl", "nn", "pa", - "pl", "pt_BR", "pt", "ro", "ru", "rw", "sk", "sl", "sq", "sr@latin", "sr", "sv", "th", "tr", "uk", "vi", - "zh_CN", "zh_TW"}; - - _i18n_languages.init( "/i18n/language", languages, langValues, G_N_ELEMENTS(languages), _("System")); - _page_i18n.add_line( false, _("Language for user interface"), _i18n_languages, "", - _("Set the language for menues and number-formats (requires restart)"), false); - - this->AddPage(_page_i18n, _("Internationalisation"), PREFS_PAGE_I18N); -} - - - bool InkscapePreferences::SetMaxDialogSize(const Gtk::TreeModel::iterator& iter) { Gtk::TreeModel::Row row = *iter; diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 93b9faad0..57b1da09e 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -75,8 +75,7 @@ enum { PREFS_PAGE_SNAPPING, PREFS_PAGE_STEPS, PREFS_PAGE_WINDOWS, - PREFS_PAGE_MISC, - PREFS_PAGE_I18N + PREFS_PAGE_MISC }; using namespace Inkscape::UI::Widget; @@ -115,7 +114,7 @@ protected: DialogPage _page_mouse, _page_scrolling, _page_snapping, _page_steps, _page_tools, _page_windows, _page_clones, _page_mask, _page_transforms, _page_filters, _page_select, _page_importexport, _page_cms, _page_grids, _page_svgoutput, _page_misc, - _page_ui, _page_autosave, _page_bitmaps, _page_i18n; + _page_ui, _page_autosave, _page_bitmaps; DialogPage _page_selector, _page_node, _page_tweak, _page_zoom, _page_shapes, _page_pencil, _page_pen, _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper, _page_lpetool; DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket, _page_eraser; @@ -177,14 +176,19 @@ protected: PrefCheckButton _sel_hidden, _sel_locked; PrefCheckButton _sel_layer_deselects; - PrefSpinButton _importexport_export, _misc_recent, _misc_simpl; - ZoomCorrRulerSlider _ui_zoom_correction; + PrefSpinButton _importexport_export, _misc_simpl; PrefSlider _snap_delay, _snap_weight; PrefSpinButton _misc_latency_skew; PrefCheckButton _misc_comment, _misc_forkvectors, _misc_scripts, _misc_namedicon_delay; + + // UI page + PrefCombo _ui_languages; PrefCombo _misc_small_toolbar; PrefCombo _misc_small_secondary; PrefCombo _misc_small_tools; + PrefSpinButton _misc_recent; + ZoomCorrRulerSlider _ui_zoom_correction; + PrefCombo _misc_overs_bitmap; PrefCombo _misc_bitmap_editor; PrefCheckButton _misc_bitmap_autoreload; @@ -231,9 +235,6 @@ protected: PrefColorPicker _grids_axonom_empcolor; PrefSpinButton _grids_axonom_empspacing; - // i18n page - PrefCombo _i18n_languages; - // SVG Output page: PrefCheckButton _svgoutput_usenamedcolors; PrefSpinButton _svgoutput_numericprecision; -- 2.30.2