{ "info": { "author": "Minddistrict", "author_email": "", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Internationalization" ], "description": "doublespeak\n===========\n\nDoublespeak lets you extract translateable messages in Javascript into\nseparate PO files and then lets you compile them to JSON files that can\nfor example be used with\n`gettext.js `__\n\nMotivation\n==========\n\nMany modern Python web applications also include a significant amount of\ntranslatable strings in Javascript.\n\nBecause this Javascript code runs in the browser, instead of on the\nserver where the Python code runs, it's necessary to have its\ntranslateable messages in separate gettext PO files, from which you\ncan then generate JSON/Javascript translation files to load in your\nbrowser.\n\nUnfortunately, `Babel `__, which\nprovides distutils commands to create messages catalogs, and extract and\ncompile messages, doesn't allow you to create different catalogs for the\nsame language in one package.\n\n**Doublespeak** lets you do this, by providing new Babel/distutils\ncommands that you can use to extract translateable messages from\nJavascript, and keep them separatele from the rest of your application's\ntranslations.\n\nNew distutils commands:\n-----------------------\n\nThe new distutils commands made available by doublespeak, are:\n\n- **init\\_js\\_catalog** - Initialize a new gettext catalog,\n specifically for JS messages.\n- **extract\\_js\\_messages** - Extract messages from JS and put them in\n the catalog.\n- **update\\_js\\_catalog** - Update an existing catalog with messages\n from newer JS code.\n- **compile\\_js\\_catalog** - Create the compiled .mo and JSON files\n from the .po files\n\nUsers of Babel, will notice that these commands are very similar to the\nones provided by Babel:\n\n- **init\\_catalog**\n- **extract\\_messages**\n- **update\\_catalog**\n- **compile\\_catalog**\n\nSome of the doublespeak commands are simply wrappers around Babel\ncommands. The benefit they provide is that you can configure them\nindependently from the Babel commands, for example in your ``setup.cfg``\nfile.\n\nConfiguration\n-------------\n\nHere's an example setup.cfg file, which demonstrates how you can\nconfigure the standard Babel commands and the new Doublespeak commands:\n\n::\n\n [compile_catalog]\n # Change to a relevant domain\n domain = mypackage\n directory = src/mypackage/i18n/locales\n\n [compile_js_catalog]\n # Note that the Javascript files have a different domain. You'll need to use\n # this domain in your Javascript code, instead of using the domain above,\n # declared for the Python code.\n domain = mypackagejs\n # Contrary to compile_catalog, this commands takes both input and output\n directories, so that you can write the JSON translation files to a separate\n directory, where you might have the rest of your Javascript code.\n input_dir = src/mypackage/i18n/locales\n output_dir = src/mypackage/browser/resources/js/i18n\n\n [extract_messages]\n # Change to your organisation\n copyright_holder = Acme Inc.\n output_file = src/mypackage/i18n/locales/en/LC_MESSAGES/mypackage.po\n charset = UTF-8\n add-comments = i18n\n\n [extract_js_messages]\n keywords = __\n no-default-keywords = True\n copyright_holder = Acme Inc.\n output_file = src/mypackage/i18n/locales/en/LC_MESSAGES/mypackagejs.po\n charset = UTF-8\n add-comments = i18n\n\n [init_catalog]\n domain = mypackage\n input_file = src/mypackage/i18n/locales/en/LC_MESSAGES/mypackage.po\n output_dir = src/mypackage/i18n/locales\n\n [init_js_catalog]\n domain = mypackagejs\n input_file = src/mypackage/i18n/locales/en/LC_MESSAGES/mypackagejs.po\n output_dir = src/mypackage/i18n/locales\n\n [update_catalog]\n domain = mypackage\n input_file = src/mypackage/i18n/locales/en/LC_MESSAGES/mypackage.po\n output_dir = src/mypackage/i18n/locales\n\n [update_js_catalog]\n domain = mypackagejs\n input_file = src/mypackage/i18n/locales/en/LC_MESSAGES/mypackagejs.po\n output_dir = src/mypackage/i18n/locales\n\nChanges\n=======\n\n0.3 (2016-03-07)\n----------------\n\n- The output file javascript is jshint happy now.\n\n\n0.2 (2016-03-04)\n----------------\n\n- Simplify the generated Javascript translations files.\n\n- Add the \"output-prefix\" option to prefix the filenames of generated language\n .js files, defaults to ''.\n\n- Add 'statistics' and 'use-fuzzy' to be on par with Babel's compile_catalog.\n\n- Build js files based on .po files instead of .mo files.\n\n0.1 (2016-02-26)\n----------------\n\n- Initial release.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/minddistrict/doublespeak", "keywords": "Javascript translations Babel", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "doublespeak", "package_url": "https://pypi.org/project/doublespeak/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/doublespeak/", "project_urls": { "Homepage": "https://github.com/minddistrict/doublespeak" }, "release_url": "https://pypi.org/project/doublespeak/0.3/", "requires_dist": null, "requires_python": "", "summary": "Babel/distutils commands to help with managing Javascript translations.", "version": "0.3" }, "last_serial": 1993210, "releases": { "0.1": [], "0.2": [ { "comment_text": "", "digests": { "md5": "9680881a95c1e0066b2a233f98f9ce09", "sha256": "ba79df8c02a6a04db103ef4af7ce923eb626c4d827aa21890cc2f46622d4f122" }, "downloads": -1, "filename": "doublespeak-0.2.tar.gz", "has_sig": false, "md5_digest": "9680881a95c1e0066b2a233f98f9ce09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6296, "upload_time": "2016-03-04T11:05:42", "url": "https://files.pythonhosted.org/packages/40/be/55bcdb6a1347c6bc99f42094b572e2a2beb26d6df1bfd9fb69c1c2f706db/doublespeak-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "317bb9209ef60ae928212762aceb825c", "sha256": "0da58fb20a2da5fd8e9b6d87fed5ca7cf77ffdfa83d0189e2e3a45ab2f90c5a0" }, "downloads": -1, "filename": "doublespeak-0.3.tar.gz", "has_sig": false, "md5_digest": "317bb9209ef60ae928212762aceb825c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6359, "upload_time": "2016-03-07T08:22:12", "url": "https://files.pythonhosted.org/packages/ec/50/4f94e438a54d1d77a13d2e6c2a95fac9635dc8bf169d5132e7158a2c590e/doublespeak-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "317bb9209ef60ae928212762aceb825c", "sha256": "0da58fb20a2da5fd8e9b6d87fed5ca7cf77ffdfa83d0189e2e3a45ab2f90c5a0" }, "downloads": -1, "filename": "doublespeak-0.3.tar.gz", "has_sig": false, "md5_digest": "317bb9209ef60ae928212762aceb825c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6359, "upload_time": "2016-03-07T08:22:12", "url": "https://files.pythonhosted.org/packages/ec/50/4f94e438a54d1d77a13d2e6c2a95fac9635dc8bf169d5132e7158a2c590e/doublespeak-0.3.tar.gz" } ] }