diff options
| author | Felipe Corr??a da Silva Sanches <juca@members.fsf.org> | 2011-05-23 01:21:27 +0000 |
|---|---|---|
| committer | Felipe C. da S. Sanches <juca@members.fsf.org> | 2011-05-23 01:21:27 +0000 |
| commit | bea49afe6164373f27a08c947087bc25c783b5b4 (patch) | |
| tree | 9069ed0f0cb34509760cf6d4e95072cfc8e25436 | |
| parent | actually fontforge flipping of y-axis for svgfont glyphs is compliant with th... (diff) | |
| download | inkscape-bea49afe6164373f27a08c947087bc25c783b5b4.tar.gz inkscape-bea49afe6164373f27a08c947087bc25c783b5b4.zip | |
Fixing bug 600267: "Languages are not sorted alphabetically in Inkscape preferences"
https://bugs.launchpad.net/inkscape/+bug/600267
Patch submitted by Fernando Lucchesi Bastos Jurema
Applied with minor changes to use Glib::ustring instead of Glib::ustring*
(bzr r10219)
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 81bd4dba0..28c59c321 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1124,6 +1124,31 @@ void InkscapePreferences::initPageUI() "gl", "he", "hu", "id", "it", "ja", "km", "rw", "ko", "lt", "mk", "mn", "ne", "nb", "nn", "pa", "pl", "pt", "pt_BR", "ro", "ru", "sr", "sr@latin", "sk", "sl", "es", "es_MX", "sv", "te_IN", "th", "tr", "uk", "vi" }; + { + // sorting languages according to translated name + int i = 0; + int j = 0; + int n = sizeof( languages ) / sizeof( Glib::ustring ); + Glib::ustring key_language; + Glib::ustring key_langValue; + for ( j = 1 ; j < n ; j++ ) { + key_language = languages[j]; + key_langValue = langValues[j]; + i = j-1; + while ( i >= 0 + && ( ( languages[i] > key_language + && langValues[i] != "" ) + || key_langValue == "" ) ) + { + languages[i+1] = languages[i]; + langValues[i+1] = langValues[i]; + i--; + } + languages[i+1] = key_language; + langValues[i+1] = key_langValue; + } + } + _ui_languages.init( "/ui/language", languages, langValues, G_N_ELEMENTS(languages), languages[0]); _page_ui.add_line( false, _("Language (requires restart):"), _ui_languages, "", _("Set the language for menus and number formats"), false); |
