Skip to main content

Plone i18n for JavaScript

Project description


This packages makes it possible to have i18n in JavaScript via the locales-directory. It is based on jarn.jsi18n and extends jarn.jsi18n (so it needs jarn.jsi18n to work).


This package is used in exactly the same manner as jarn.jsi18n, so if you want to know how to use kreagroup.jsi18n, visit

Why this package?

jarn.jsi18n and kreagroup.jsi18n do differ… You can use the packages in the same way, but the result will differ in one particular case…

Suppose we run the following code in a browser, for the first time:

> jarn.i18n.loadCatalog(‘plone’, ‘es’);

> _es = jarn.i18n.MessageFactory(‘plone’, ‘es’);

> _es(‘Contributor’);


In line 1, jarn.jsi18n will download the i18n catalog in an ASYNCHRONOUS way. While the i18n catalog is loading, it will run line 2 and 3, so ‘Contributor’ will be translated while the i18n catalog is not loaded. Because the i18n catalog is not loaded, _es(‘Contributor’) will not be translated and just return the input. Here, the result will be ‘Contributor’, not “Contribuyente”. The next time we run the same code, chances are big that the download of the i18n catalog is completed, so it will be in browser cache (no need to download now), and the translation will executed correctly.

On the other hand… In line 1, kreagroup.jsi18n loads the i18n catalog SYNCHRONOUS, so it waits until the i18n catalog is loaded. When this is finished, it starts executing line 2 and 3 and will translate correctly, because the i18n catalog is already downloaded.

jarn.jsi18n vs kreagroup.jsi18n, a matter of taste…

jarn.jsi18n is more responsive, by only using asynchronous ajax calls. This comes with a penalty of no translation the first time the code is run…

kreagroup.jsi18n does always translate correctly. This comes with a penalty of a synchronous ajax call, which means you have to wait a little longer before the page loads the first time, which is less responsive…


jarn.jsi18n-1.0 does not work with Internet Explorer 8. kreagroup.jsi18n contains a fix so translation do work in Internet Explorer 8. Probably, jarn.jsi18n-1.1 will also contain this fix :-)


1.0.3 - 2013-08-16

  • Pin jarn.jsi18n to version 1.0

1.0.2 - 2013-08-13

  • Fixes in documentation

1.0.1 - 2013-08-13

  • Added documentation for first public release

1.0.0 - 2013-05-23

  • Initial release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
kreagroup.jsi18n-1.0.3.tar.gz (14.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page