datopian / datahub

🌀 Rapidly build rich data portals using a modern frontend framework
https://datahub.io/opensource
MIT License
2.19k stars 326 forks source link

Support for internationalization #459

Closed pastarace closed 3 years ago

pastarace commented 9 years ago

Hi is the internationalization supported in Recline? Thanks Paolo

rufuspollock commented 9 years ago

@pstarace we haven't done it at present though it would be fairly straightforward to do.

akuckartz commented 9 years ago

+1

KrzysztofMadejski commented 8 years ago

+1 CC: https://github.com/ckan/ckan/issues/2403

augusto-herrmann commented 8 years ago

+1

rufuspollock commented 8 years ago

Anyone want to have a stab at it or sponsor it?

KrzysztofMadejski commented 8 years ago

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/

rufuspollock commented 8 years ago

No particular preference. Jed seems reasonable and ckan uses it so maybe good to go with that.

KrzysztofMadejski commented 7 years ago

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.

rufuspollock commented 7 years ago

@KrzysztofMadejski sounds really good.

KrzysztofMadejski commented 7 years ago

It would be great if someone could review my code. I'm almost ready, I'm missing:

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

KrzysztofMadejski commented 7 years ago

Internationalization is done! Pull request sent: https://github.com/okfn/recline/pull/508

KrzysztofMadejski commented 7 years ago

For anyone looking for a i18n js libs there's a new one by Mozilla: http://l20n.org/