Re: Deciding on localization for Javascript

Luca Fabbri <[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <CAGfGq=a4-L9_e5Ze2tmSRM0nzmReSD8hO_PhJLdv6E32J9f9CQ@mail.gmail.com>
On Mon, Jun 23, 2014 at 10:38 AM, Johannes Raggam <[email protected]> wrote:
>
> If i understood this correctly,
>
> - jarn.jsi18n is using .po files client side,
>

If I get what you mean: no. jarn.jsi18n is loading server side i18n
strings using AJAX.

I used it in some projects but it has some limitation:

* no callback (can't wait for i18n messages loaded)
* can't use i18ndude on .js files (I tried it but is not fully
supported: no support for the "default")

Benefit:
* use browser localstorage for caching messages

To be honest I prefer the i18n strings inside HTML (with data attributes).



> - the localeplanet solution is to create JSON files server side.
>
> If this is true, the second option might be leaner and faster, since
> there is no need for client side .po file parsing. However, Jarn's
> solution sounds quite elegant!
>
> Anyways, this would only work, if we don't need to access arbitrary
> catalogs from plone.app.locales but only mockup specific catalogs.
>
> plone.app.locales catalog suite is too big to be used by this system. If
> we need access to any Plone i18n catalog, we might need something else.
> Like this rough idea: The client sends a JSON structure with message
> string/domain tuples to the server, which translates it and returns a
> JSON structure with translated strings.
>
> But we might just need to access mockup specific catalogs.
>
> Cheers, Johannes
>
>
>
> On Mon, 2014-06-23 at 09:59 +0200, Ramon Navarro Bosch wrote:
>> IMHO jarn.jsi.i18n or something similar should be the correct
>> solution, the caching system to avoid loading the po files a lot of
>> times, maybe we should create a pattern specific domain so it doesn't
>> get a big po file.
>>
>>
>> 2014-06-22 22:04 GMT+02:00 Nathan Van Gheem <[email protected]>:
>>         Looking for opinions here.
>>
>>
>>         Right now in plone we do it by rendering all translated text
>>         into html using the tal translation integration.
>>
>>
>>         In mockup, it's expected to pass all translated text in as
>>         parameters. Doing this gets rather tedious with patterns that
>>         have a lot of translated text.
>>
>>
>>         https://pypi.python.org/pypi/jarn.jsi18n/1.0 has been around
>>         for a while and might be the most simple solution.
>>
>>
>>
>>         Otherwise, this project seems
>>         similar: http://www.localeplanet.com/support/howto-localize-js.html
>>
>>
>>         Thoughts?
>>
>>
>>
>>
>>         -Nathan
>>
>>         ------------------------------------------------------------------------------
>>         HPCC Systems Open Source Big Data Platform from LexisNexis
>>         Risk Solutions
>>         Find What Matters Most in Your Big Data with HPCC Systems
>>         Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
>>         Leverages Graph Analysis for Fast Processing & Easy Data
>>         Exploration
>>         http://p.sf.net/sfu/hpccsystems
>>         _______________________________________________
>>         Plone-developers mailing list
>>         Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>>         https://lists.sourceforge.net/lists/listinfo/plone-developers
>>
>>
>>
>>
>>
>> --
>> Ramon a.k.a bloodbare
>> ------------------------------------------------------------------------------
>> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
>> Find What Matters Most in Your Big Data with HPCC Systems
>> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
>> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
>> http://p.sf.net/sfu/hpccsystems
>> _______________________________________________
>> Plone-developers mailing list
>> Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>> https://lists.sourceforge.net/lists/listinfo/plone-developers
>
> --
> programmatic  web development
> di(fh) johannes raggam / thet
> python plone zope development
> plone framework  team  member
> mail: office-//[email protected]
> web:  http://programmatic.pro
>       http://bluedynamics.com
>
>
> ------------------------------------------------------------------------------
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://p.sf.net/sfu/hpccsystems
> _______________________________________________
> Plone-developers mailing list
> Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/plone-developers
>



-- 
-- luca

twitter: http://twitter.com/keul
linkedin: http://linkedin.com/in/lucafbb
blog: http://blog.keul.it/

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.