L20n/Examples: Difference between revisions

481 bytes removed ,  19 February 2007
move old samples off to wiki history, we have a fully functional plurals demo now in "Von allen Gedanken"
(no more java, new samples in Meet Pete)
(move old samples off to wiki history, we have a fully functional plurals demo now in "Von allen Gedanken")
Line 2: Line 2:


Right now, all demos are implemented in js, with varying use of the dojo toolkit, for no particular reason.
Right now, all demos are implemented in js, with varying use of the dojo toolkit, for no particular reason.
== Von allen Gedanken ==
This revision added macros and expressions, and is the first time we can do demos for plurals again, which happens to be the only new sample this cycle, too. All ''Meet Pete'' examples work without modification.
=== Plurals demo ===
This demo shows how to create a macro and how to call into it to create strings depending on unknown quantities.
[http://people.mozilla.com/~axel/l20n/js-l20n/sample-04.html Plurals demo]


== Meet Pete ==
== Meet Pete ==
Line 22: Line 30:


[http://people.mozilla.com/~axel/l20n/js-l20n/sample-03.html fallback demo]
[http://people.mozilla.com/~axel/l20n/js-l20n/sample-03.html fallback demo]
== JavaScript proof of concept ==
This is a JSON-like modification of the fileformat created to heavily use <code>eval</code> to get expressions for free in JavaScript, and thus being able to demo the plurals stuff. This approach can't support the app-toolkit approach, though.
=== Plurals, DOM, Genders ===
This demo is a js-implemented dojo-based piece showing how plurals would work. In addition to that, it demos how one could map localized objects onto a DOM tree, which seems interesting to me.
It's using a hacked up fileformat much closer to json than what I intend to have in the end. The js-eval based approach didn't work for the app-toolkit composition demo, too. It does work for the plural forms nicely, though, that's why it's still there. And it does DOM.
[http://people.mozilla.com/~axel/scratchpad/ DOM and plurals demo]
Tested on Firefox 2. Uses <code>__proto__</code>, so don't expect this to work in IE.


Back to [[L20n]]...
Back to [[L20n]]...


[[category:L20n]]
[[category:L20n]]
Confirmed users, Bureaucrats and Sysops emeriti
2,976

edits