{ "info": { "author": "Translation Exchange, Inc.", "author_email": "r.kamun@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Build Tools" ], "description": "

\n \n

\n\nTML Library for Django\n====================================\n[![Build Status](https://travis-ci.org/translationexchange/tml-python-django.png?branch=master)](https://travis-ci.org/translationexchange/tml-python-django)\n[![Coverage Status](https://coveralls.io/repos/translationexchange/tml-python-django/badge.png?branch=master)](https://coveralls.io/r/translationexchange/tml-python-django?branch=master)\n\n\n## Introduction\n\nThis document demonstrates how to use TML (Translation Markup Language) in a Django application.\n\n### Integration\n\nInstalling using pip:\n\n```\npip install django_tml\n```\n\nAdd 'django_tml' to your INSTALLED_APPS setting:\n\n```python\nINSTALLED_APPS = (\n ...\n 'django_tml',\n)\n```\n\nAdd TML middleware to MIDDLEWARE_CLASSES setting:\n\n```\nMIDDLEWARE_CLASSES = (\n ...\n 'django_tml.middleware.TmlControllerMiddleware',\n)\n```\n\nThen add the following TML configuraiton to setting file:\n\n```python\nTML = {\n 'environment': 'dev',\n 'application': {\n 'key': 'YOUR_APPLICATON_KEY', # add application key from [TranslationExchange dashboard](https://dashboard.translationexchange.com/)\n },\n 'monkeypatch': True, # support legacy translations\n 'cache': {\n 'enabled': True,\n 'adapter': 'memcached',\n 'host': '127.0.0.1:11211',\n 'backend': 'pylibmc',\n 'namespace': 'foody'\n },\n 'logger': {\n 'path': pj(BASE_DIR, 'logs', 'tml.log')\n }\n}\n```\n\nTo start using TML tags and filters, load tag libraries in the head of your template file:\n\n```jinja2\n{\u00ad% load i18n %\u00ad}\n{\u00ad% load tml tml_inline %\u00ad}\n```\n\nTo activate inline translation functionality add one more line in the head section of your layout:\n\n```jinja2\n{\u00ad% tml_inline_header %\u00ad}\n```\n\n*(Optional)* You can also add a language switcher to your site. Just add the next template tag in the navigation of your site:\n\n```jinja2\n{% tml_language_selector type=\"sideflags\" %}\n```\n\n### Demo application\n\nThe best way to learn about the SDK capabilities is to use the demo application that comes with the SDK. The demo application provides many samples of TML syntax.\n\nRun the following scripts to setup and run the the Demo application: \n\n```bash\n$ git clone git@github.com:translationexchange/tml-python-django.git\n$ cd tml-python-django/demo\n$ virtualenv --no-site-packages tmldemo\n$ . ./tmldemo/bin/activate\n$ pip install -r requirements.txt\n$ python manage.py migrate\n$ python manage.py runserver localhost:8000\n```\n\n### TML Configuration\n\n* ``environment`` - Running environment (one of ``dev|stage|prod``)\n* ``application`` - Provide key for authentication, api path and cdn path to and path api path.\n* ``monkeypatch`` - This option facilitates Tml to be backward compatible with django i18n engine. You can still use django native tags for translating your strings.\n* ``cache`` - Define your cache configuration here. More about cache in advanced section.\n* ``agent`` - Agent helps your application to download JS SDK on initial load of your page and then use TML widgets, shortcuts and SDK in client-side.\n* ``data_preprocessors`` - Preprocessors applied on translateable string before actual processing. For example ``list`` preprocessors preprocess list like context variable into meaningful text token.\n* ``env_generators`` - Sometimes you do not need to provide substitution token variable. For example, ``viewing_user`` env generator could be substituted by the return value of env generator. By default we return ``request.user``.\n* ``logger`` - TML log that tracks interaction with SDK by http and supressed exceptions while translating string.\n\n\nLinks\n==================\n\n* Register on TranslationExchange.com: http://translationexchange.com\n\n* Follow TranslationExchange on Twitter: https://twitter.com/translationx\n\n* Connect with TranslationExchange on Facebook: https://www.facebook.com/translationexchange\n\n* If you have any questions or suggestions, contact us: support@translationexchange.com\n\n\nCopyright and license\n==================\n\nCopyright (c) 2016 Translation Exchange, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "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/pypa/sampleproject", "keywords": "tml django-tml translationexchange", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-tml", "package_url": "https://pypi.org/project/django-tml/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-tml/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/pypa/sampleproject" }, "release_url": "https://pypi.org/project/django-tml/0.3.1/", "requires_dist": null, "requires_python": null, "summary": "Django SDK for tranlationexchange.com API", "version": "0.3.1" }, "last_serial": 2105921, "releases": { "0.1.1": [], "0.1.10": [ { "comment_text": "", "digests": { "md5": "ac4331f9032bd15d874a2402a7704a04", "sha256": "ba04c1bef91d820ac3819abbaabaadf1bd0e7582242e649e1df46e8a660e9887" }, "downloads": -1, "filename": "django_tml-0.1.10-py2-none-any.whl", "has_sig": false, "md5_digest": "ac4331f9032bd15d874a2402a7704a04", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 22895, "upload_time": "2016-03-23T07:07:15", "url": "https://files.pythonhosted.org/packages/f0/d8/2ae8a905a2ac50844c5ba994510f7396ca4348e697940460c1908d4b090d/django_tml-0.1.10-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c49aa2cd478f3b0f465b8bbfeca5c35", "sha256": "24acb621761e730bc42168ac9f85b209559958f4346965721fb61878c0898996" }, "downloads": -1, "filename": "django-tml-0.1.10.tar.gz", "has_sig": false, "md5_digest": "8c49aa2cd478f3b0f465b8bbfeca5c35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17005, "upload_time": "2016-03-23T07:06:57", "url": "https://files.pythonhosted.org/packages/79/11/0c81a970e93e2a5b2ca22a16a6da81bfe03869f772aeb05796d0377e0a8a/django-tml-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "34a712fc181673b948994a6bf070d65b", "sha256": "7e197606402803a1d123c998a57fa328f5a18f5871ce9f18bd498a73f7c2910f" }, "downloads": -1, "filename": "django_tml-0.1.11-py2-none-any.whl", "has_sig": false, "md5_digest": "34a712fc181673b948994a6bf070d65b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 22897, "upload_time": "2016-03-23T07:15:24", "url": "https://files.pythonhosted.org/packages/a2/7f/ad1af4cd50422d385e386529579fbbb9d3bfe184e833854a38f1447ac76b/django_tml-0.1.11-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "186e4cd828e4f9b4f68a5abb44caafee", "sha256": "a4cfee035b37f2e04bec0bc149703b2d62cbd3ffee48fa0c154999b320d964f5" }, "downloads": -1, "filename": "django-tml-0.1.11.tar.gz", "has_sig": false, "md5_digest": "186e4cd828e4f9b4f68a5abb44caafee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17012, "upload_time": "2016-03-23T07:15:15", "url": "https://files.pythonhosted.org/packages/f8/d5/82879189bc2b9bdab7809d9992a2b9273325ecac622382564dea0f008a13/django-tml-0.1.11.tar.gz" } ], "0.1.12": [ { "comment_text": "", "digests": { "md5": "2ab2dc2e08f85399a67e84e2caf5ff26", "sha256": "77497b66a5e8d0b7b7a39908b65a8bf0c358efbc7964461212220407c77218ec" }, "downloads": -1, "filename": "django_tml-0.1.12-py2-none-any.whl", "has_sig": false, "md5_digest": "2ab2dc2e08f85399a67e84e2caf5ff26", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 23404, "upload_time": "2016-03-28T06:22:28", "url": "https://files.pythonhosted.org/packages/cf/9c/03698ae9b7840cfaf289053ef2cc86a3faa41de6d6b4671f8edf4c06e611/django_tml-0.1.12-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2ce21cba0446f63f3b04091e56a0659a", "sha256": "b18bb47ef17c06ecfa986f9f28eacd22a6ed25cc38662b0a641a7a983178ed8a" }, "downloads": -1, "filename": "django-tml-0.1.12.tar.gz", "has_sig": false, "md5_digest": "2ce21cba0446f63f3b04091e56a0659a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17483, "upload_time": "2016-03-28T06:22:20", "url": "https://files.pythonhosted.org/packages/7f/5a/c42cfd8ede12a036248d16dc1f1b4e4b0f5c69017c2da16a5900cc2887bd/django-tml-0.1.12.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "fa67db7c6b285da93aaf062c46b30c99", "sha256": "c3dad45dfa2e4984da55d749a55a7a092a2bd736f907ab38dbdcfa54c3af7bdb" }, "downloads": -1, "filename": "django_tml-0.1.2-py2-none-any.whl", "has_sig": false, "md5_digest": "fa67db7c6b285da93aaf062c46b30c99", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16892, "upload_time": "2016-03-08T18:26:22", "url": "https://files.pythonhosted.org/packages/86/b2/4d8000118f5896bbf8793a2b834d7ae2f415d143d520f7090e27e0c1bc4c/django_tml-0.1.2-py2-none-any.whl" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "be257109d19bd1131b74294396a797a1", "sha256": "32e83543aad8dac664243f38ece45bb1b2043cb2eb7d39ae468df97e0494b2ab" }, "downloads": -1, "filename": "django_tml-0.1.3-py2-none-any.whl", "has_sig": false, "md5_digest": "be257109d19bd1131b74294396a797a1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17915, "upload_time": "2016-03-10T18:34:09", "url": "https://files.pythonhosted.org/packages/39/26/be88f8c30bb640609e8fd117f9d99afea999a71d43fddd8460202d19a7aa/django_tml-0.1.3-py2-none-any.whl" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "d356e9a84e030065601125fff959ac39", "sha256": "7640938a00fda619150d4df92c6b1b48667a0b4dfda3953daa131978a50e4eae" }, "downloads": -1, "filename": "django_tml-0.1.4-py2-none-any.whl", "has_sig": false, "md5_digest": "d356e9a84e030065601125fff959ac39", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17915, "upload_time": "2016-03-10T18:35:49", "url": "https://files.pythonhosted.org/packages/97/c3/fe30fe5f49936130e8d6dd49699fa90d7087756421c453f1e4ea60e3e7e7/django_tml-0.1.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "261fe3dd1ba164ac45653b7ebc0b486d", "sha256": "6c66737fe08cbe04835ec5df56c9085e82bb20d6e31460ca0a0585fe58083791" }, "downloads": -1, "filename": "django-tml-0.1.4.tar.gz", "has_sig": false, "md5_digest": "261fe3dd1ba164ac45653b7ebc0b486d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14534, "upload_time": "2016-03-10T18:35:42", "url": "https://files.pythonhosted.org/packages/04/44/03396ffac94811155b5bb402fe3af7652e230945047adafef02111ffb2b9/django-tml-0.1.4.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "e63eae37e45a6a1ad1d15917e7b313af", "sha256": "d93e672647369e53d22b9dea3245f73aca97958a28d9fca5748060bb398b2c74" }, "downloads": -1, "filename": "django_tml-0.1.6-py2-none-any.whl", "has_sig": false, "md5_digest": "e63eae37e45a6a1ad1d15917e7b313af", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17936, "upload_time": "2016-03-10T19:03:28", "url": "https://files.pythonhosted.org/packages/de/d6/53c88f01926898483dc3e9c1885303c30d818b873f3f21d08b2c9e462b33/django_tml-0.1.6-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "35b52f8368ba41de66a441b4dfb4b10b", "sha256": "31c812b7ebe804d7f98297e878d3ec462dbd6a2f2fa209a51cebd114081a077c" }, "downloads": -1, "filename": "django-tml-0.1.6.tar.gz", "has_sig": false, "md5_digest": "35b52f8368ba41de66a441b4dfb4b10b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14559, "upload_time": "2016-03-10T19:03:19", "url": "https://files.pythonhosted.org/packages/0c/5a/cb260554e88bbad2fa75e1d4aefb2b31fc74aed2e13802507fb2c2fe10b3/django-tml-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "306de9230bbc5a334d3eb4da5f3ca86a", "sha256": "ee544434b5f345764ccf7707ebf2050cc780be2f09f991b5e913eb89f7036684" }, "downloads": -1, "filename": "django_tml-0.1.7-py2-none-any.whl", "has_sig": false, "md5_digest": "306de9230bbc5a334d3eb4da5f3ca86a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17936, "upload_time": "2016-03-10T19:43:27", "url": "https://files.pythonhosted.org/packages/69/43/7cdaf78e656a01098add95731bdfe2628e7fb2346340855d8284841c9d58/django_tml-0.1.7-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bce8c4e52d5619ae5697947ca721ef4b", "sha256": "8e3acdfa67ff601e53022c6b207136a0e3a981d795d088b2ec2251ba320b6699" }, "downloads": -1, "filename": "django-tml-0.1.7.tar.gz", "has_sig": false, "md5_digest": "bce8c4e52d5619ae5697947ca721ef4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14561, "upload_time": "2016-03-10T19:43:17", "url": "https://files.pythonhosted.org/packages/ba/bd/33d48f3120766dd3488ffb1967c83b6fb48038cb8f59c0c0ef133d1807c9/django-tml-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "ea3ed687ea86f3509ac34d557a619f72", "sha256": "a426c3b6e1e6df0579ce2112dcb72f029a635f0adb3511432d9dbac5ee588f7b" }, "downloads": -1, "filename": "django_tml-0.1.8-py2-none-any.whl", "has_sig": false, "md5_digest": "ea3ed687ea86f3509ac34d557a619f72", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 21488, "upload_time": "2016-03-13T08:48:47", "url": "https://files.pythonhosted.org/packages/0c/22/a019f5f3f2a280736a82077b437c2bec28214e05f3e9dbd94690023b6378/django_tml-0.1.8-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "507ee3b97a78c4fe249918431031bc83", "sha256": "82358885282ffc16f719238e7a2303fc35e0fdd67089d5829b7b7039af96c84e" }, "downloads": -1, "filename": "django-tml-0.1.8.tar.gz", "has_sig": false, "md5_digest": "507ee3b97a78c4fe249918431031bc83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16692, "upload_time": "2016-03-13T08:48:37", "url": "https://files.pythonhosted.org/packages/a1/25/98d3e95f387544f4d3543901d5f709935b88f8732929e7a3a9ddfe984550/django-tml-0.1.8.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "1c93275a53a0de2a746c1cce8070702a", "sha256": "fe170d3d3e7e94a4507aa592b01d91b073e3e0b7ac60c9832af0b8e1b365d3f7" }, "downloads": -1, "filename": "django_tml-0.3.0-py2-none-any.whl", "has_sig": false, "md5_digest": "1c93275a53a0de2a746c1cce8070702a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 23442, "upload_time": "2016-04-04T05:52:17", "url": "https://files.pythonhosted.org/packages/9e/1d/19e7e17d40f313016d58d4c8f057c653b0b03d38258e397636ea3a109df6/django_tml-0.3.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c99e299df46e8079d667071e2100bb2", "sha256": "8a9349bccbbb25a4ddf73df2ffce17f6df25623d4384bd00267f2ef796ae9be9" }, "downloads": -1, "filename": "django-tml-0.3.0.tar.gz", "has_sig": false, "md5_digest": "8c99e299df46e8079d667071e2100bb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17626, "upload_time": "2016-04-04T05:52:06", "url": "https://files.pythonhosted.org/packages/aa/ee/bca544b80a4152781463072e4a569d5b8a22aaa758529ad59da70d0790d4/django-tml-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "72247e835500a091cfb2c8b81e874238", "sha256": "ad62e5b0881d9e03d0e5a08804dde1ad4eff3ef3b466cdf7c73459f5e9fb32b0" }, "downloads": -1, "filename": "django_tml-0.3.1-py2-none-any.whl", "has_sig": false, "md5_digest": "72247e835500a091cfb2c8b81e874238", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 20087, "upload_time": "2016-05-09T06:48:44", "url": "https://files.pythonhosted.org/packages/2d/1d/8612312b421b862d5b9d41b638b00744c8dea5e1875a601bdc6cb231dcef/django_tml-0.3.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "119f8014e9f3acf6f5e1bc7ba73395fe", "sha256": "e5b834def80ac03bc89c4ec8b870cd5fd84ef3521be7a4980cbbb4c1b4541358" }, "downloads": -1, "filename": "django-tml-0.3.1.tar.gz", "has_sig": false, "md5_digest": "119f8014e9f3acf6f5e1bc7ba73395fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15600, "upload_time": "2016-05-09T06:48:36", "url": "https://files.pythonhosted.org/packages/f1/aa/8d8f96f624557fd1b222f6e7c757257b09424c1ba8059472bd39fc87db85/django-tml-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "72247e835500a091cfb2c8b81e874238", "sha256": "ad62e5b0881d9e03d0e5a08804dde1ad4eff3ef3b466cdf7c73459f5e9fb32b0" }, "downloads": -1, "filename": "django_tml-0.3.1-py2-none-any.whl", "has_sig": false, "md5_digest": "72247e835500a091cfb2c8b81e874238", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 20087, "upload_time": "2016-05-09T06:48:44", "url": "https://files.pythonhosted.org/packages/2d/1d/8612312b421b862d5b9d41b638b00744c8dea5e1875a601bdc6cb231dcef/django_tml-0.3.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "119f8014e9f3acf6f5e1bc7ba73395fe", "sha256": "e5b834def80ac03bc89c4ec8b870cd5fd84ef3521be7a4980cbbb4c1b4541358" }, "downloads": -1, "filename": "django-tml-0.3.1.tar.gz", "has_sig": false, "md5_digest": "119f8014e9f3acf6f5e1bc7ba73395fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15600, "upload_time": "2016-05-09T06:48:36", "url": "https://files.pythonhosted.org/packages/f1/aa/8d8f96f624557fd1b222f6e7c757257b09424c1ba8059472bd39fc87db85/django-tml-0.3.1.tar.gz" } ] }