[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DotGNU]Resource Manipulation: Falling back from specific cultures
From: |
Rhys Weatherley |
Subject: |
Re: [DotGNU]Resource Manipulation: Falling back from specific cultures |
Date: |
Mon, 1 Dec 2003 07:57:17 +1000 |
User-agent: |
KMail/1.4.3 |
On Monday 01 December 2003 06:56 am, Mariano Rivera wrote:
> Hi All:
>
> I was wondering if somebody can give me a clue for where to look on the
> sources for the actual code that implements the logic to fall back from
> Language Variant to Language Neutral to English if the first ones are not
> found???
The logic is in the "System.Resources.ResourceManager" class in the
"InternalGetResourceSet" method. It starts with the current culture and
works up through the parent cultures until it finds a match. If there is no
match, it will use the "invarant" culture, which is normally English.
> I am asking this because I would like to contribute with some spanish and
> portuguese(Brazilian) translations of pnet, but as I dont want to be
> variant language specific, I am trying to write the neutral language
> variation of spanish and portuguese and if I need (or somebody else want)
> write the specifics ones...
Usually you just pick one of the variants and install it as the neutral
version. And then you don't need to bother with a specific version for that
variant. You would normally pick the most natural "origin country" for the
language.
> For spanish I believe that the neutral language code is "es_ES", but I cant
> confirm this, so if somebody else could, it will be great....
es_ES is probably a good choice for the neutral version for Spanish. You
would install it as "es", and then it will get picked up automatically for
"es_ES", "es_CH", etc. "es_AR" would contain only those strings that are
different for Argentina - everything else will fall back to "es".
For Portuguese, it would be a toss up between "pt_BR" and "pt_PT" as to which
is installed as the neutral version. I think MS uses "pt_BR", but I am not
sure. Either way is fine with me.
Cheers,
Rhys.