{ "info": { "author": "Yiorgis Gozadinos", "author_email": "ggozad@jarn.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Plone", "Intended Audience :: Developers", "Programming Language :: JavaScript", "Programming Language :: Python" ], "description": "Introduction\n============\n\nWhile internationalization in Zope/Plone is very mature there is no generally accepted way of doing i18n in JavaScript. Typically packages that contain Javascript code expose i18n by having hard-coded dictionaries or templates that dynamically create these dictionaries. While this is fine for small i18n catalogs, it easily gets tedious and is hard to update.\n\nThis package provides the essentials for leveraging the i18n infrastructure in Plone inside your JavaScript code:\n\n * Allows you to load arbitrary gettext catalogs from Plone.\n * Provides you with `Message Factories` very similar to the ones used in your python code.\n * Makes use of the `local storage` available in modern browsers to avoid reloading message catalogs.\n\nUsage\n-----\nYour package should depend on ``jarn.jsi18n`` and include it in its meta-data dependencies.\n\nIn order to instantiate a ``MessageFactory`` and use it you will need to load the i18n catalog. Typically, this will be done in a way similar to::\n\n $(document).ready(function () {\n jarn.i18n.loadCatalog('plone', 'el');\n _ = jarn.i18n.MessageFactory('plone')\n });\n\nThe second parameter in ``loadCatalog`` specifying the language is optional, when omitted the ``lang`` attribute in the ``html`` tag is used. \n\nNow that we have a message factory we can use it to get translated strings::\n\n > _('Contributor');\n \u03a3\u03c5\u03bd\u03c4\u03b5\u03bb\u03b5\u03c3\u03c4\u03ae\u03c2\n\nor with keyword parameters::\n\n > _('Groups are: ${names}', {names: 'Jarnians'})\n \"\u039f\u03b9 \u03bf\u03bc\u03ac\u03b4\u03b5\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9: Jarnians \"\n\nYou can if you wish load multiple catalogs (or languages for the same catalog) and instantiate their respective factories, for instance::\n\n > jarn.i18n.loadCatalog('plone', 'es');\n > _es = jarn.i18n.MessageFactory('plone', 'es');\n > _es('Contributor');\n \"Contribuyente\"\n\nCaching\n-------\n\nIf the client browser supports local storage it will be used to store the catalogs that you load. This makes it possible to avoid making an ajax request every time in order to load the full catalog. The stored catalog is by default valid for 24 hours. You can set the time-to-live by calling ``jarn.i18n.setTTL(millis)`` passing in milliseconds for how long the local storage cache should remain valid. Note that if local storage *is* supported, and the cache has not expired, the browser will NOT reload a catalog even if it changes in the filesystem.\n\n=========\nChangelog\n=========\n\n1.1 - 2014-07-10\n----------------\n\n- Fix for Internet Explorer 8, defining Date.now() in jsi18n.js: IE8 does not know Date.now() by default \n [kysr]\n\n\n1.0 - 2013-01-25\n----------------\n\n- courtesy release so people don't get\n version 0.11 over 0.3. Also, about time for a 1.0...\n\n\n0.3 - 2012-12-17\n----------------\n- Do not cache null catalog contents\n [cambell-bika]\n- simpler MessageFactory\n [mmariani]\n\n0.2 - 2011-12-6\n---------------\n\n- A few bug fixes.\n [ggozad]\n\n- Test coverage with jasmine.js\n [ggozad]\n\n0.11 - 2011-11-01\n-----------------\n\n- Fix typos.\n\n0.1 - 2011-11-01\n----------------\n\n- First release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ggozad/jarn.jsi18n", "keywords": "plone javascript i18n", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "jarn.jsi18n", "package_url": "https://pypi.org/project/jarn.jsi18n/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jarn.jsi18n/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ggozad/jarn.jsi18n" }, "release_url": "https://pypi.org/project/jarn.jsi18n/1.1/", "requires_dist": null, "requires_python": null, "summary": "Plone i18n for JavaScript", "version": "1.1" }, "last_serial": 1153463, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d9067aeaf2015d2ffb8c82f1d0f79ff3", "sha256": "72b76cbd2cb53791e2446acaa2bead210f17f49914e3da3dfb3cc3998fe08740" }, "downloads": -1, "filename": "jarn.jsi18n-0.1.zip", "has_sig": false, "md5_digest": "d9067aeaf2015d2ffb8c82f1d0f79ff3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18971, "upload_time": "2011-11-01T15:29:49", "url": "https://files.pythonhosted.org/packages/5e/a0/3960e4de21a95501a10dbc6cc61879899a11ca06ede890934f2b210b92e8/jarn.jsi18n-0.1.zip" } ], "0.1.1": [], "0.2": [ { "comment_text": "", "digests": { "md5": "216ba11548bef461ff220f48a873b3bd", "sha256": "5506fa35a8cca7c10262d83d2b90cdca446c5ea9ec392fdbc886ef078f5e2af2" }, "downloads": -1, "filename": "jarn.jsi18n-0.2.zip", "has_sig": false, "md5_digest": "216ba11548bef461ff220f48a873b3bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41103, "upload_time": "2011-12-06T08:59:38", "url": "https://files.pythonhosted.org/packages/35/07/b5921a89896ed1ee610f74839fe9e6149ba64211824fe7e4ce733f505858/jarn.jsi18n-0.2.zip" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "6fd0e210ab2857a642e549dc6b6853b5", "sha256": "02dc4c976e4cb9c31e131798bd01a025ba10aba518e5ea4b05a8663b3d94418c" }, "downloads": -1, "filename": "jarn.jsi18n-0.3.zip", "has_sig": false, "md5_digest": "6fd0e210ab2857a642e549dc6b6853b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41268, "upload_time": "2012-12-17T09:42:20", "url": "https://files.pythonhosted.org/packages/22/0a/f6e68d089fde4bf5dca0b3147e5f5924b57d400a471a6b56c983c9f2cc03/jarn.jsi18n-0.3.zip" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "2ba192f1fb24ad4dd97ccf5e4a7fcefb", "sha256": "c114303752f9063c6788ab3fb7a58c982384e5c5527466bf1040afdd2b55fbad" }, "downloads": -1, "filename": "jarn.jsi18n-1.0.zip", "has_sig": false, "md5_digest": "2ba192f1fb24ad4dd97ccf5e4a7fcefb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41465, "upload_time": "2013-01-25T16:10:35", "url": "https://files.pythonhosted.org/packages/83/2f/905fec99ad651f263682eb55a0e2f6604a883caf9b53dae0bd99d1496e16/jarn.jsi18n-1.0.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "548b3fbc04380460a2994fd38a903829", "sha256": "ed7dd76c17082e50702648767ad7d0b07c84ebda7d9f90a3ce465cfe3477ff18" }, "downloads": -1, "filename": "jarn.jsi18n-1.1.zip", "has_sig": false, "md5_digest": "548b3fbc04380460a2994fd38a903829", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41818, "upload_time": "2014-07-10T14:34:07", "url": "https://files.pythonhosted.org/packages/8b/4a/b04db1ecd6bf2f866022387a41e02d72a4678c14f2301502770726ce5730/jarn.jsi18n-1.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "548b3fbc04380460a2994fd38a903829", "sha256": "ed7dd76c17082e50702648767ad7d0b07c84ebda7d9f90a3ce465cfe3477ff18" }, "downloads": -1, "filename": "jarn.jsi18n-1.1.zip", "has_sig": false, "md5_digest": "548b3fbc04380460a2994fd38a903829", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41818, "upload_time": "2014-07-10T14:34:07", "url": "https://files.pythonhosted.org/packages/8b/4a/b04db1ecd6bf2f866022387a41e02d72a4678c14f2301502770726ce5730/jarn.jsi18n-1.1.zip" } ] }