Currently I'm working on folders list sorting and see locale issue. In roundcube we've got setlocale(LC_ALL, 'xx') where 'xx' is a selected language. For Polish it's 'pl', but we need 'pl_PL.UTF-8' for proper sorting. I propose to add locale.inc file with that definition in localization folders or just add label 'localename' with specified value. Not sure what will be better.
I'd like some peer's comments:
program/localization/index.inc The system use rcube_languages or rcube_language_aliases to set the locale. 2. config/main.inc sets the default locale
BTW, index.inc defines also charset other then the default
On Thu, 29 May 2008 11:51:34 +0200, wrote:
Currently I'm working on folders list sorting and see locale issue. In roundcube we've got setlocale(LC_ALL, 'xx') where 'xx' is a selected language. For Polish it's 'pl', but we need 'pl_PL.UTF-8' for proper sorting. I propose to add locale.inc file with that definition in localization folders or just add label 'localename' with specified value. Not sure what will be better.
moish wrote:
I'd like some peer's comments:
- You may use rcube_language_aliases variable in
program/localization/index.inc The system use rcube_languages or rcube_language_aliases to set the locale.
Yes, but i must also rename 'pl' directory to 'pl_PL', and I'm not sure if that's the best way, maybe is. Also we still need to add '.utf8' suffix to language name for proper sorting of unicode, but it can be done in rcmail.php.
- config/main.inc sets the default locale
I think that's not the problem of default locale _______________________________________________ List info: http://lists.roundcube.net/dev/
moish wrote:
I'd like some peer's comments:
- You may use rcube_language_aliases variable in
program/localization/index.inc
One general task is to always use 5-char codes for a localization which means that the localization folders need to be renamed as well. Then we can fill up $rcube_language_aliases with all 2-char codes that are currently used in $rcube_languages in order to support all (old) language codes saved in the user prefs.
The system use rcube_languages or rcube_language_aliases to set the locale. 2. config/main.inc sets the default locale
Once we only have long localization names, we can use them directly for set_locale() because we only use UTF-8 which can be hard-coded.
BTW, index.inc defines also charset other then the default
$rcube_charsets is not used (anymore). Should be removed from index.inc
~Thomas
List info: http://lists.roundcube.net/dev/
Thomas Bruederli wrote:
moish wrote:
I'd like some peer's comments:
- You may use rcube_language_aliases variable in
program/localization/index.inc
One general task is to always use 5-char codes for a localization which means that the localization folders need to be renamed as well. Then we can fill up $rcube_language_aliases with all 2-char codes that are currently used in $rcube_languages in order to support all (old) language codes saved in the user prefs.
So, the right way is to rename localization folder. Thx.
On Thu, 29 May 2008 12:34:50 +0200, wrote:
Thomas Bruederli wrote:
moish wrote:
I'd like some peer's comments:
- You may use rcube_language_aliases variable in
program/localization/index.inc
One general task is to always use 5-char codes for a localization which means that the localization folders need to be renamed as well. Then we
can
fill up $rcube_language_aliases with all 2-char codes that are currently
used in $rcube_languages in order to support all (old) language codes saved in the user prefs.
So, the right way is to rename localization folder. Thx.
moish wrote:
It may cause confusion between translation (the above mentioned directories) and setting locale ( ALEC intention ). Currently main.inc sets the default locale and there is no other way to change it directly, other then choosing some dummy key from the list of languages, creating a new directory linked to that key ( probably with the same translation if any ) and adding an entry to rcubde_language_aliases with that dummy key and its locale. Is that correct?
Sorry, but I don't understand your question. I don't see a reason why one should set a locale that differs from the current language.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/
On Thu, May 29, 2008 at 11:51 AM, A.L.E.C alec@alec.pl wrote:
Currently I'm working on folders list sorting and see locale issue. In roundcube we've got setlocale(LC_ALL, 'xx') where 'xx' is a selected language. For Polish it's 'pl', but we need 'pl_PL.UTF-8' for proper sorting. I propose to add locale.inc file with that definition in localization folders or just add label 'localename' with specified value. Not sure what will be better.
I am not sure if you can generalize like that because that *will* differ on some systems. Generally for the language I think we should stick with de_DE, or pl_PL - but for example to get all date and currency specifics right, we may need a second value.
For the administrator it's always the safest to check in /usr/share/locale (or whatever the path is) for the correct name. Kinda like, there is de_DE, de_DE@EURO and more crazy stuff. While the language file is de_DE, on the system itself it may need something else. Therefor I am not sure if we can "hardcode" that in or if this should go into the config file and/or an additional setting for the user preferences.
Just my two cents!
Till _______________________________________________ List info: http://lists.roundcube.net/dev/
till wrote:
On Thu, May 29, 2008 at 11:51 AM, A.L.E.C alec@alec.pl wrote:
Currently I'm working on folders list sorting and see locale issue. In roundcube we've got setlocale(LC_ALL, 'xx') where 'xx' is a selected language. For Polish it's 'pl', but we need 'pl_PL.UTF-8' for proper sorting. I propose to add locale.inc file with that definition in localization folders or just add label 'localename' with specified value. Not sure what will be better.
I am not sure if you can generalize like that because that *will* differ on some systems. Generally for the language I think we should stick with de_DE, or pl_PL - but for example to get all date and currency specifics right, we may need a second value.
For the administrator it's always the safest to check in /usr/share/locale (or whatever the path is) for the correct name. Kinda like, there is de_DE, de_DE@EURO and more crazy stuff. While the language file is de_DE, on the system itself it may need something else. Therefor I am not sure if we can "hardcode" that in or if this should go into the config file and/or an additional setting for the user preferences.
Just my two cents!
Till _______________________________________________ List info: http://lists.roundcube.net/dev/
Every user should be able to change locale in order to refelect the time zone, language, etc, regardless of the server. The current design is good. I'm sure there will be cases where it's not enough, but I assume there are tasks with higher priority E.G. collapsible folder tree :)
Moish. _______________________________________________ List info: http://lists.roundcube.net/dev/