View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004168 | mantisbt | other | public | 2004-07-21 16:12 | 2004-11-06 06:01 |
Reporter | RJelinek | Assigned To | DGtlRift | ||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.19.0a2 | ||||
Fixed in Version | 0.19.1 | ||||
Summary | 0004168: Languages in "My Account"/"Preferences" are not sorted | ||||
Description | Looking at the entries of languages in "my account"/"preferences", they are not sorted. F.e. here in this page, english is listed first. | ||||
Tags | No tags attached. | ||||
Attached Files | mantisbt.4168.sortlang.txt (6,497 bytes)
? mantisbt.4168.sortlang.txt Index: core/lang_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/lang_api.php,v retrieving revision 1.34 diff -u -r1.34 lang_api.php --- core/lang_api.php 26 Sep 2004 02:05:14 -0000 1.34 +++ core/lang_api.php 4 Oct 2004 14:07:53 -0000 @@ -200,7 +200,7 @@ $t_lang = $p_lang; - if ( null === $t_lang ) { + if ( ( null === $t_lang ) || ( "auto" == $t_lang ) ) { $t_lang = lang_get_current(); } Index: core/print_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/print_api.php,v retrieving revision 1.105 diff -u -r1.105 print_api.php --- core/print_api.php 1 Oct 2004 18:08:23 -0000 1.105 +++ core/print_api.php 4 Oct 2004 14:07:54 -0000 @@ -703,13 +703,22 @@ global $g_language_choices_arr; $t_arr = $g_language_choices_arr; - $enum_count = count( $t_arr ); - for ($i=0;$i<$enum_count;$i++) { + $t_sarr = array(); + + asort( $t_arr ); + while ( list( $i,$l ) = each( $t_arr ) ) { $t_language = string_attribute( $t_arr[$i] ); + $t_language_name = lang_get( "language_name_" . $t_language ); + $t_sarr = $t_sarr + array( $t_language => $t_language_name ); + } # end while + asort( $t_sarr ); # Language specific sort + while ( list( $t_language, $t_language_name ) = each( $t_sarr ) ) { + $t_language = string_attribute( $t_language ); + $t_language_name = string_attribute( $t_language_name ); PRINT "<option value=\"$t_language\""; check_selected( $t_language, $p_language ); - PRINT ">$t_language</option>"; - } # end for + PRINT ">" . $t_language_name . " - " . lang_get( "language_name_" . $t_language, $t_language ) . "</option>"; + } # end while } # -------------------- # @@@ preliminary support for multiple bug actions. Index: lang/strings_english.txt =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/lang/strings_english.txt,v retrieving revision 1.215 diff -u -r1.215 strings_english.txt --- lang/strings_english.txt 28 Sep 2004 14:09:40 -0000 1.215 +++ lang/strings_english.txt 4 Oct 2004 14:07:56 -0000 @@ -20,6 +20,41 @@ # Charset $s_charset = 'windows-1252'; +# Languages +$s_language_name_auto = "Automatic"; +$s_language_name_chinese_simplified = "Simplified Chinese"; +$s_language_name_chinese_traditional = "Traditional Chinese"; +$s_language_name_croatian = "Croation"; +$s_language_name_czech = "Czech"; +$s_language_name_danish = "Danish"; +$s_language_name_dutch = "Dutch"; +$s_language_name_english = "English"; +$s_language_name_estonian = "Estonian"; +$s_language_name_finnish = "Finnish"; +$s_language_name_french = "French"; +$s_language_name_german = "German"; +$s_language_name_hungarian = "Hungarian"; +$s_language_name_italian = "Italian"; +$s_language_name_japanese_euc = "Japanese (EUC)"; +$s_language_name_japanese_sjis = "Japanese (SJIS)"; +$s_language_name_japanese_utf8 = "Japanese (UTF8)"; +$s_language_name_korean = "Korean"; +$s_language_name_latvian = "Latvian"; +$s_language_name_lithuanian = "Lithuanian"; +$s_language_name_norwegian = "Norwegian"; +$s_language_name_polish = "Polish"; +$s_language_name_portuguese_brazil = "Portuguese (Brazil)"; +$s_language_name_portuguese_standard = "Portuguese (standard)"; +$s_language_name_romanian = "Romanian"; +$s_language_name_russian_koi8 = "Russian (KOI8)"; +$s_language_name_russian = "Russian"; +$s_language_name_serbian = "Serbian"; +$s_language_name_slovak = "Slovakian"; +$s_language_name_slovene = "Slovene"; +$s_language_name_spanish = "Spanish"; +$s_language_name_swedish = "Swedish"; +$s_language_name_turkish = "Turkish"; + # Group commands menuitems $s_actiongroup_menu_move = 'Move'; $s_actiongroup_menu_copy = 'Copy'; @@ -1064,4 +1099,4 @@ # Source Control Integration $s_checkin = 'Checkin'; -?> \ No newline at end of file +?> Index: lang/strings_hungarian.txt =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/lang/strings_hungarian.txt,v retrieving revision 1.60 diff -u -r1.60 strings_hungarian.txt --- lang/strings_hungarian.txt 1 Oct 2004 23:03:36 -0000 1.60 +++ lang/strings_hungarian.txt 4 Oct 2004 14:07:57 -0000 @@ -19,6 +19,42 @@ # Charset $s_charset = 'iso-8859-2'; +# Languages +$s_language_name_auto = "Automatic"; +$s_language_name_chinese_simplified = "Simplified Chinese"; +$s_language_name_chinese_traditional = "Traditional Chinese"; +$s_language_name_croatian = "hurvecia"; +$s_language_name_czech = "Czech"; +$s_language_name_danish = "Danish"; +$s_language_name_dutch = "Dutch"; +$s_language_name_english = "angolul"; +$s_language_name_estonian = "Estonian"; +$s_language_name_finnish = "Finnish"; +$s_language_name_french = "French"; +$s_language_name_german = "ne'met"; +$s_language_name_hungarian = "magyarul"; +$s_language_name_italian = "Italian"; +$s_language_name_japanese_euc = "Japanese (EUC)"; +$s_language_name_japanese_sjis = "Japanese (SJIS)"; +$s_language_name_japanese_utf8 = "Japanese (UTF8)"; +$s_language_name_korean = "Korean"; +$s_language_name_latvian = "Latvian"; +$s_language_name_lithuanian = "Lithuanian"; +$s_language_name_norwegian = "Norwegian"; +$s_language_name_polish = "Polish"; +$s_language_name_portuguese_brazil = "Portuguese (Brazil)"; +$s_language_name_portuguese_standard = "Portuguese (standard)"; +$s_language_name_romanian = "Romanian"; +$s_language_name_russian_koi8 = "oroszul (KOI8)"; +$s_language_name_russian = "oroszul"; +$s_language_name_serbian = "Serbian"; +$s_language_name_slovak = "Slovakian"; +$s_language_name_slovene = "Slovene"; +$s_language_name_spanish = "Spanish"; +$s_language_name_swedish = "Swedish"; +$s_language_name_turkish = "Turkish"; + + # Group commands menuitems $s_actiongroup_menu_move = 'Mozgat'; $s_actiongroup_menu_copy = 'Copy'; @@ -1061,4 +1097,4 @@ # Source Control Integration $s_checkin = 'Checkin'; -?> \ No newline at end of file +?> | ||||
I am not sure whether we should fix this or not (I mean sort the array in the code)! The current approach has the advantage that it is up to the person setting up the system to decide in which order the languages are to appear. For example, most commonly used ones at the top. On the other hand, the user may decide to put them in alphabetical order. However, the default setting for the languages array should probably have them sorted in alphabetical order (including English). |
|
Well, I have no preferences, which solution is best. But I agree, that the admin choose via configuration, in which order the languages are shown. |
|
Ordering $g_language_auto_map seems like something quick to do before 0.19 |
|
Added patch does the following: Other changes |
|
This patch isn't in CVS (yet), so reopening, and awaiting approval and commit |
|
I'm not sure I agree with sorting them (as well). The admin can re-arrange the list ($g_language_choices_arr) manually to put the 'preferred' ones at the top of the list. |
|
That seems easy enough for me to roll back, but what are the thoughts on the other changes? Also, I know there has been a very long discussion on the dev-list about variables being adminable through the mantis interface rather then the config file, any thoughts if I would be better to make some kind of admin screen for ordering the languages? |
|
DGtlRift, I think we should stick with the simple solution of sorting the language in config_defaults_inc.php manually. Localising language names is a different issue that needs some thought. As for the admin interface, this is not needed at the moment. This will be added once we move configs to database. |
|
I just committed now a change to config_defaults_inc.php which has all languages sorted (including English). Should I mark this issue as resolved? |
|
Yes, I think this can be closed, I opened another issue specific to language name localization and linked a relationship to this one. Only thing about sorting the languages in the config file is that they are sorted using the english names of languages.. which I concede is a minor issue since the admin of a mantis install can config the order of the languages however they prefer. |
|
Languages sorted in the config_defaults file. |
|