As tron7 and Michal stated it would be the best to get translated strings from 
your server. Especially if you've placeholders in your i18n strings.

Sometimes there may be use cases where that is not reliable, i.e. we read some  
Qt ui definitions (which contain translateable strings) and render a GUI from 
that at run time. To skip server side string/i18n processing in these ui 
snippets, we let the web client retrieve a prepared locale definition and call 
addTranslation of the qx.locale.Manager.

All you need in this kind of setup is building with:

  "qx.dynlocale" : ["on"]

and fetch the translations dynamically from the server (i.e. on login). Here's 
some pseudo code:

  var locales = foobar.doFetchtTranslationsFromServerWithCurrentLocale();
  var lm = qx.locale.Manager.getInstance();
  lm.addTranslation(qx.locale.Manager.getInstance().getLocale(), locales);

After that you can just "tr*" the messages as if they were in your .po files. 
Note that some people report performance issues with dynlocale set to "on" - 
but I'm not sure if this is still the case. Personally, I didn't notice any.

Cajus

Am Freitag, 22. März 2013, 07:58:41 schrieb baskar:
> Hi all,
> I am not well in qooxdoo translation.. By reading it documents i think it
> requires .PO files or something to give translated strings for application
> with the help of generate.py script... is my understanding is correct?
> 
> Ok. Now my question is
> 
> I have an application, which i want to translate text from the JSON
> response, on demand.
> 
> 
> 
> --
> View this message in context:
> http://qooxdoo.678.n2.nabble.com/OnDemand-Translation-for-JSON-response-tp7
> 583124.html Sent from the qooxdoo mailing list archive at Nabble.com.
> 
> ----------------------------------------------------------------------------
> -- Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to