Caolan McNamara wrote:
I see that at the moment if a translation is missing at buildtime then
the English one is copied in as a replacement by rsc.

Has anyone ever made a stab at deferring this to happen at runtime ? Or
any ideas around how to do that ? In my own case I can guarantee that
the en_US translations will always be installed, and I like the idea
that I could ship e.g. en_GB translations which are only the very small
amount of translations which are different to en_US and have runtime
fallback to en_US.

Currently only works for whole named resources, that is those with a global or local Id. This fallback exists for languagepacks being upwards compatible from e.g. 2.1 -> 2.2 in case a resource was added but no new 2.2 compatible language pack exists for the language in question. However actual texts are always an attribute of a named resource. Example:

String 1564
{
  Text = "text color";
  Text [ de ] = "Textfarbe";
  Text [ en_GB ] = "text colour";
}

In the case the Text[en_GB] is missing, the default "text color" will be in the en_GB resource file and therefore be displayed. In case the whole String resource 1564 is missing the resource will not be found in the en_GB resource file, but if available will be taken at runtime from the en_US resource file.

What you want (differential en_GB file) cannot currently be constructed, this would need support inside the resource compiler itself as well as the resource reading code in tools project. The rsc would need to be capable of omitting the text attribute in the en_GB file (that is enter no fallback) whereas the reading code would have to look into the same resource in the en_US file. The latter can be done and half of the code basically exists already for the id based resource fallback. However tweaking the rsc to do omit missing translations could be ... interesting :-)

Just my 2 cents, pl

--
If you give someone a program, you will frustrate them for a day;
if you teach them how to program, you will frustrate them for a lifetime.
     -- Author unknown

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to