Using a dataset is an equally valid approach, but I think it was tried and found to require too much overhead. Of course, if CSS is made dynamic, perhaps it will have equivalent overhead.
Perhaps the reason some people think of CSS first is because it seems i18n is like "skinning" or styling your app. On 2010-02-15, at 12:09, jamesr wrote: > Would it not be more expedient to write a class, called perhaps localtext, > that takes a single field to index inside of a dataset wherein a given > real-world language sentence is kept, so that by changing datasets you change > all displayed localized text? > > Why use CSS? > > P T Withington wrote: >> There are two improvements targeted for 5.0 that will help this situation: >> >> LPP-8556 Add default CSS style properties to <view> >> LPP-7359 Make CSS attribute selectors dynamic >> >> There should also be one to make it so you can load a stylesheet at runtime, >> but I can't seem to find that. Maybe Max and I only talked about it... >> >> With all three of those, it should be possible to have a single app that >> will be localized when it is loaded. For now, you are correct, you need to >> compile your app for each language. >> >> --- >> >> With LPP-7184 Binary libraries don't work in swf9 resolved (and integrated >> to 4.7), we believe that LZO's are now fully supported in swf9 for 4.7.1 >> (soon to be released) and 5.0.x (in development). We'd welcome testing by >> anyone who needs this feature. Grab the latest 4.7.1 here: >> >> http://download.openlaszlo.org/nightly/4.7/ >> >> >> >> On 2010-02-15, at 11:39, Raju Bitter wrote: >> >> >>> All the internationalization based on CSS for Webtop (at least with >>> the version I've used) requires you to recompile the app for a >>> different language. That's not too much of a problem, just generate >>> different versions of the app for different languages. >>> >>> It would be good to have dynamic CSS support at runtime, but a >>> workaround could be to put all the strings into an LZO, with different >>> LZOs for different languages. That should work, shouldn't it? Of >>> course you are limited to SWF8 and DHTML then, since there's still no >>> support for LZOs with AS3 based runtimes, as far as I know. >>> >>> 2010/2/15 P T Withington <[email protected]>: >>> >>>> I believe some use CSS styles to achieve internationalization, although >>>> currently LZX does not support dynamically changing styles, so I'm not >>>> sure exactly how this is handled. Currently, styles need to be >>>> pre-processed by the compiler. Ideally, you would have your application >>>> server looking at the browser request language preference and serve up >>>> different style sheets based on that. It may be that people are using a >>>> .jsp to do this kind of dispatching. >>>> >>>> In theory, you would write something like: >>>> >>>> <!-- supply style sheet based on browser language --> >>>> <stylesheet> >>>> i18ntext [label="hi"] { text: "hello" } >>>> </stylesheet> >>>> >>>> <class name="i18ntext" extends="text"> >>>> <attribute name="label" type="string" /> >>>> <attribute name="text" style="text" /> >>>> </class> >>>> >>>> <i18ntext label="hi" /> >>>> >> >> [...] >> >
