Re: Translations
Emiliano <[email protected]> Sun, 6 Apr 2003 10:00:20 +0200
| Newsgroups | gmane.comp.java.xwt.general |
|---|---|
| Message-ID | <[email protected]> |
On Sat, Apr 05, 2003 at 10:29:02PM -0500, Andrew Kohlsmith wrote:
> I'm not sure if there is a better solution here, but something like this
> should work for spinlocks:
>
> xwt.thread = function() {
> strings = xwt.xmlrpc(blah);
> gotit = true;
> }
>
> main loop:
> while(!gotit) { xwt.sleep(100); }
>
> I use that technique in several places and it works well. I use
> xwt.sleep(100) instead of xwt.yield() just ot help the engine from spinning
> in a tight loop and taking up gobs of processor time. If 1/10s is too
> detectable in your application you can reduce it or use xwt.yield().
While it'll probably work, I don't think I want to bother with this.
It'd have to happen in too many places in my app. I'll just make the
various languages separate xwars, then.
> As far as making the data globally available, you should be able to do so by
> placing the data in static.something.
Could I place this in the static.something of an .xwt that I would
pre-apply? I guess that would mean I would have the translation strings
loaded multiple times... that would not be good.
If I had something like this in my main.xwt:
<xwt>
<preapply name="nl.irisadvies.iris.translations"/>
<preapply name="nl.irisadvies.iris.main"/>
<template/>
</xwt>
Where translations.xwt would have something like
<xwt>
<static>
var translation
translation['main.title'] = 'Title';
translation['accounts.title'] = 'Accounts';
translation['accounts.apply'] = 'Save data';
....
</static>
</xwt>
Would this data then be loaded before the rest of my UI is loaded? And
how would I get at this data, since boxes can't escape their own
namespace?
Emile
_______________________________________________
http://lists.xwt.org/listinfo/dev