On 3/10/06, Stafford Horne <[EMAIL PROTECTED]> wrote:
David,

I see in your changes that the logic is now as follows in e_apps.c:
* Get language from LANG environment variable
* Get canonic form for language
* Store localized property

I have a few suggestions:
1. You could easily get the language from the function e_intl_language_get()

Actually, that code has been there since the initial revision, but you're right, it makes sense to replace that with a fast e_intl_language_get call.

2. The language might a an alias (Example: japanese.euc), It would be better to use the function e_intl_locale_alias_get() to resolve the alias for the language(Example: ja_JP.eucJP).

I'm not that familiar with locale aliasing, but for me (on Debian) it doesn't seem to be useful atm. I see the code is looking for locale.alias files, which I do have, but e doesn't read any of them. So when I try a   -lang-set "japanese.euc"   I end up in the C locale.
My locale.alias files are in
/etc/locale.alias
/usr/share/locale/locale.alias
/usr/share/gettext/intl/locale.alias
/usr/X11R6/lib/X11/locale/locale.alias

If I had installed to /usr rather than /usr/local, it would have picked up the file in /usr/share/locale/ though it seems.

So we would end up with:
* Get language from e_intl_language_get()
* Resolve any language aliases with e_intl_locale_alias_get()
* Get only the relevant parts from the locale with  e_intl_locale_canonic_get()
* Store localized property

What do you think?

This would be more robust :-)

Maybe I should cache the resolved alias for the current locale in e_intl.

Indeed, we would be doing this every time we load a new e_app...

Regards!
David

Reply via email to