locale names, patch for large localedirs
Commit Message
Hi!
Very nice to see gettext() working, for a while I thought it was going
to be a complete mess :)
IMHO, two simple things could still be done:
Attached is a simple patch that allows using VDR with large localedir
that contains more locales than I18N_MAX_LANGUAGES. AFAICS there is no
reason to stop searching unless I18N_MAX_LANGUAGES vdr locales were
actually found.
Also, it is a convention (all programs in my system follow it) that .po
files (and thus the locale directory name) be without the territory
name, i.e. fi instead of fi_FI. If there would be any additional
translations for some language, they would be named like fi_DE.
Comments
On 08/19/07 17:56, Anssi Hannula wrote:
> Hi!
>
> Very nice to see gettext() working, for a while I thought it was going
> to be a complete mess :)
>
> IMHO, two simple things could still be done:
>
> Attached is a simple patch that allows using VDR with large localedir
> that contains more locales than I18N_MAX_LANGUAGES. AFAICS there is no
> reason to stop searching unless I18N_MAX_LANGUAGES vdr locales were
> actually found.
You're right about that.
> Also, it is a convention (all programs in my system follow it) that .po
> files (and thus the locale directory name) be without the territory
> name, i.e. fi instead of fi_FI. If there would be any additional
> translations for some language, they would be named like fi_DE.
The source .po files will remain named as they are now.
In an "install" target you can rename them to whatever you like.
Klaus
===================================================================
@@ -112,7 +112,7 @@
for (int i = 0; i < Locales.Size(); i++) {
cString FileName = cString::sprintf("%s/%s/LC_MESSAGES/vdr.mo", I18nLocaleDir, Locales[i]);
if (access(FileName, F_OK) == 0) { // found a locale with VDR texts
- if (i < I18N_MAX_LANGUAGES - 1) {
+ if (NumLocales < I18N_MAX_LANGUAGES) {
SetEnvLanguage(Locales[i]);
NumLocales++;
if (strstr(OldLocale, Locales[i]) == OldLocale)