Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Aug 2008 01:01:05 +0200
From:      Aragon Gouveia <aragon@phat.za.net>
To:        "Loren M. Lang" <lorenl@north-winds.org>
Cc:        freebsd-i18n@freebsd.org
Subject:   Re: Adding or editing a locale
Message-ID:  <20080829230105.GA54406@phat.za.net>
In-Reply-To: <1220031798.7224.69.camel@habakkuk.aloha.tallye.com>
References:  <20080828003426.GB57611@phat.za.net> <716a8d5f0808281211s73f753bs557b3ac4446410ed@mail.gmail.com> <20080828192652.GB40752@phat.za.net> <20080828194209.GA44154@phat.za.net> <716a8d5f0808290205v53257632qa7ceb8bc3dcd3e8b@mail.gmail.com> <1220031798.7224.69.camel@habakkuk.aloha.tallye.com>

next in thread | previous in thread | raw e-mail | index | archive | help
| By Loren M. Lang <lorenl@north-winds.org>
|                                          [ 2008-08-29 19:43 +0200 ]
> Hmm, I'm curious what happens when a less common locale such as en_ZA is
> used and a certain application does not, for example, it has no
> translations for en_ZA.  As I understand it, it will default to trying
> simply en as a locale, but is en equivalent to en_US or en_GB which are
> two locales applications are more likely to implement.  Since a
> considerable amount of the software is written in the US, I'd expect
> that for some applications en would translate to en_US even though en_GB
> is a more appropriate substitute for en_ZA.  (Unless I'm mistaken, I
> have only been to South Africa once.)  How exactly do fallbacks work?

I stand to be corrected, but I think if an application lacks translations
for a locale it will fall back to the "C" locale (or rather, not change the
locale from where it was).  In the "C" locale and in terms of gettext
(LC_MESSAGES) this means no translation will take place in application
messages, so the message output will be in the language and dialect in
which they were written in the application source itself.  In terms of
ctype, collation, etc., I would guess the C locale uses en_US symantics,
but that is probably system dependent.

As for en_ZA, you are correct - en_GB is a better substitute than en_US. 
Plain en I think should be prioritised as international english or any
english in that order, so the best fit would be en_GB or any other en
dialect which is supported by your app (in that order).  That is just my
opinion.  setlocale() doesn't define a fallback mechanism in this case, so
trying to call setlocale() for "en" on FreeBSD, for example, should return
NULL and leave the locale unchanged.  A fallback regime like you describe
would need to be application defined.


Regards,
Aragon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080829230105.GA54406>