Hi, I'm trying to get an understanding of: - What is the JavaScript community doing w.r.t. localization and PO and MO files? - What can/should the GNU gettext package do in order to be useful for this community?
Here's a set of packages and use situations I could find. It does not give a big picture to me. Can someone shed some light on anything of this, and clarify? ========================== Package in/for JavaScript ========================== JavaScript libraries: * gettext-js https://code.google.com/archive/p/gettext-js/ 2007-2009 API: A global Gettext object. Implementation: Uses PO files by parsing them. Depends on Prototype.js. * jsgettext https://sourceforge.net/projects/jsgettext.berlios/ https://github.com/adrienrn/jsgettext https://bitbucket.org/fanstatic/js.jsgettext http://jsgettext.sourceforge.net/ 2008-2011 API: A global Gettext object. See http://jsgettext.sourceforge.net/doc/html/Gettext.html Implementation: Uses PO files by parsing them. * JQuery Globalize https://github.com/globalizejs/globalize 2010-2016 Uses just JSON, no PO or MO files so far * jed https://github.com/messageformat/Jed http://messageformat.github.io/Jed/ https://alexsexton.com/blog/2012/10/introducing-the-jed-toolkit/ http://www.2ality.com/2012/11/jed-toolkit.html http://www.jeromesteunou.net/internationalisation-in-javascript.html 2012-2016 * gettext-js based on jed https://www.npmjs.com/package/gettext-js https://github.com/frascata/gettext-js 2016 * angular-gettext https://angular-gettext.rocketeer.be/ https://github.com/rubenv/angular-gettext 2013-2016 API: An Angular module. Implementation: Uses JSON files created by https://github.com/rubenv/angular-gettext-tools Depends on Angular. * angular-translate https://github.com/angular-translate/angular-translate 2013-2016 ? * gettext.js https://github.com/ojii/gettext.js http://gettextjs.readthedocs.io/en/latest/ API: minimal Includes a MO -> JSON converter: https://github.com/ojii/gettext.js/blob/master/src/py/gettextjs.py 2015-2016 "Toolkits": * http://i18next.com Integrated in web frameworks: * Babel https://babel.edgewall.org/ https://babel.edgewall.org/wiki/Documentation/messages.html also supports JavaScript API: ? Implementation: ? * Django https://www.djangoproject.com/ https://docs.djangoproject.com/en/1.10/topics/i18n/translation/ Lexer: https://github.com/django/django/blob/master/django/utils/jslex.py 2011-2015 Implementation: Uses .mo files Uses "wrappers around xgettext and msgfmt", "for convenience". * django-jsgettext based on Django https://github.com/niwinz/django-jsgettext 2012-2013 Converters PO -> MO * https://www.npmjs.com/package/gulp-gettext https://github.com/cloud-walker/gulp-gettext 2015-2016 Converters MO -> JSON * https://github.com/jakob-stoeck/jpoker/blob/master/mo2json.py 2008 * https://github.com/wrook/jquery.gettext/blob/master/mo2json.py 2009 =============================== Use situations =============================== JavaScript runtimes: - Browsers - Node.js (a.k.a. "server-side JavaScript") - gjs (command-line, but linked to Mozilla's JavaScript) [who uses that?] ================================= Status quo ================================= What is currently implemented in GNU gettext? - xgettext support for jsgettext package. - A test case lang-javascript. Based on the gjs gettext module. - There is no hello-javascript. Bruno