Closed pastarace closed 3 years ago
@pstarace we haven't done it at present though it would be fairly straightforward to do.
+1
+1
Anyone want to have a stab at it or sponsor it?
We (with @danielmacyszyn) may code it. Do you have any recommendations for the translation lib to use?
I've found these so far:
http://i18next.com/ http://formatjs.io/ ! https://github.com/wikimedia/jquery.i18n http://slexaxton.github.io/Jed/ (used in ckan) https://github.com/messageformat/messageformat.js - a successor to Jed http://l10ns.org/ http://fhtr.org/js-i18n/
No particular preference. Jed seems reasonable and ckan uses it so maybe good to go with that.
I have a working early draft, still some work needs to be done.
I've chosen FormatJS.io because:
The end goal is to have a separate FormatJS.io Backbone+Moustache integration as an independent library used in Recline.
@KrzysztofMadejski sounds really good.
It would be great if someone could review my code. I'm almost ready, I'm missing:
I18n.formatter('recline','pl').t('Add_row')
EDIT: Apparently there is no standard way to do it: "The working group discussed extensively whether there should be an API to set a default locale list that would then be used throughout the Internationalization API. Two issues prevent this: First, a settable default locale list would create a global communication channel between different scripts running within the same environment, which is considered a security risk. Second, an application may include different components, such as embedded apps, that need different default locales. ECMAScript has no knowledge of these components and no way to manage appropriate contexts for them" - http://norbertlindenberg.com/2012/12/ecmascript-internationalization-api/index.html
Internationalization is done! Pull request sent: https://github.com/okfn/recline/pull/508
For anyone looking for a i18n js libs there's a new one by Mozilla: http://l20n.org/
Hi is the internationalization supported in Recline? Thanks Paolo