Hi Dimitry,
Today Dimitri wrote:
[...]
> It would be nice to have it implemented in qooxdoo. However, that would
> require changes in both framework and toolchain. At the moment,
> internal translations structure looks like that:
>
> translations: {
> ...
> "ru": {
> "cow": "korova",
> "cows": "korovy"
> }
> }
>
> This could be changed to:
>
> translations: {
> ...
> "ru": {
> "cow": "korova",
> "cows": [ "korova", "korovy", "korov" ]
> }
> }
>
> and locales structure could contain a function to compute plural form
> from ordinal, created from a Plural-Forms PO header by the compiler. A
> valid C expression will be a valid JavaScript expression, too, and we
> can benefit from this. I've examined several gettext implementations
> for JavaScript; those that do support Plural-Forms simply evaluate this
> expression unchanged as JavaScript. For security purposes, we could
> validate the expression first, to make sure it is restricted to
> arithmetic, logical and ternary operators.
>
> I think that we could start with implementing minimal, non-breaking
> changes in framework, namely internal structure for translations,
> plural classifier in locales, translation logic in tr*() functions.
> Meanwhile, we could experiment with John Spackman's QxCompiler to
> introduce Plural-Form parsing##SELECTION_END##. As soon as POC is
> ready, it can be ported to generate.py or Grunt based toolchain,
> whichever becomes mainstream at that moment.
I think that qooxdoos multi lingual abilities are one of its big
assets, so improving these, by all means would be a great thing.
cheers
tobi
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
www.oetiker.ch t...@oetiker.ch +41 62 775 9902
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel