« Return to Thread: l10n architecture proposal available for comments

Re: l10n architecture proposal available for comments

by Axel Hecht :: Rate this Message:

Reply to Author | View in Thread

Igor Tandetnik wrote:

> Axel Hecht <l10n@...> wrote:
>> Rimas Kudelis wrote:
>>> Do you intend to support Grammatical cases [1] in any way? If yes,
>>> then how do you see it?..
>> Yes, it works pretty much like the gender example in
>> http://people.mozilla.com/~axel/l20n/js-l20n/sample-01.html.
>
> The example seems to show how to change the surrounding sentence to
> match the gender of a replacement word. The replacement determines the
> gender, and the sentence has to adapt.
>
> Case works the other way round: the structure of the sentence determines
> the case a replacement word must take, and the spelling of the word
> changes depending on case it needs to take to fit into a given sentence.
>
> Often both grammatical categories (three actually - there's also number)
> work together and require changing both the sentence and replacement
> word for everything to agree.
>
> Consider also this situation in Russian:
>
> 1 file = 1 ÆÁÊÌ
> 4 files = 4 ÆÁÊÌÁ
> 5 files = 5 ÆÁÊÌÏ×
> 21 file = 21 ÆÁÊÌ
>
> The word "ÆÁÊÌ" (file) is in nominative singular in the first line,
> genitive singular in the second line (yes, singular, even though there
> are four of them), genitive plural in the third line, and nominative
> singular again in the last line.
>

That sounds like the standard plural forms as supported by gettext,
transforming the .2 notation in POs to real arrays and using an explicit
indexing.

The file would look similar to this:

<flockOfFiles[plural(N)]: ["${N}i ÆÁÊÌ", "${N}i ÆÁÊÌÁ", "${N}i ÆÁÊÌÏ×"]>

In more complex forms, you could make this a hash of arrays or an array
of hashes.

The current examples don't demo that, because I didn't implement the
expression part just yet. A hacked up version of this, using js' eval is
at http://people.mozilla.com/~axel/scratchpad/, which used a not good,
but adapted file format, yielding to
<shopping:
    ['Please select number of items',
     'No items ordered',
     'You have ordered one item.',
     'You have ordered $(itemCount)d items.'
     ][plural(itemCount)]
 >

Axel
_______________________________________________
dev-i18n mailing list
dev-i18n@...
https://lists.mozilla.org/listinfo/dev-i18n

 « Return to Thread: l10n architecture proposal available for comments