{ "info": { "author": "Pragmatic Mates", "author_email": "info@pragmaticmates.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "django-templates-i18n\n=====================\n\nApp provides ability to store templates in database and localize it using django-modeltranslation app.\nIt is useful if you need to change template content too often and you don't want to recompile all ugettext messages\nall the times. It is also suitable for email templates.\n\nTested on Django 1.4.5.\n\n\nRequirements\n------------\n- Django\n- django-modeltranslation\n\n\nInstallation\n------------\n\n1. Install python library using pip: pip install django-templates-i18n\n\n2. Add ``templates_i18n`` to ``INSTALLED_APPS`` in your Django settings file\n\n3. Sync and migrate your database\n\n4. Specify desired languages in your Django settings file::\n\n from django.utils.translation import gettext\n\n LANGUAGE_CODE = 'en'\n LANGUAGES = (\n ('en', gettext('English')),\n ('de', gettext('German')),\n )\n\n5. Run ``sync_translation_fields`` and ``update_translation_fields`` commands (from ``modeltranslation`` app)\n\n\nUsage\n-----\n\nAjax call is made whenever the parent field is changed. You must set up the ajax URL to return json list of lists::\n\n from django.http import HttpResponse\n from django.template import Template, Context\n from django.views.generic import View\n\n from templates_i18n.models import Template_i18n\n\n\n class MyView(View):\n def dispatch(self, request, *args, **kwargs):\n template_i18n = Template_i18n.objects.get(machine_name='my-template')\n template = Template(template_i18n.content)\n context = Context({'user': request.user})\n return HttpResponse(template.render(context))\n\nor::\n\n from django.core.mail import send_mail\n from django.template import Template, Context\n from templates_i18n.models import Template_i18n\n\n\n def dispatch(self, request, *args, **kwargs):\n template_i18n = Template_i18n.objects.get(machine_name='my-template')\n template = Template(template_i18n.content)\n context = Context({'user': request.user})\n message = template.render(context)\n send_mail('Subject here', message, 'from@example.com', ['to@example.com'], fail_silently=False)\n\n\nAuthors\n-------\n\nLibrary is by `Erik Telepovsky` from `Pragmatic Mates`_. See `our other libraries`_.\n\n.. _Pragmatic Mates: http://www.pragmaticmates.com/\n.. _our other libraries: https://github.com/PragmaticMates", "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/PragmaticMates/django-templates-i18n", "keywords": "django templates translation i18n", "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "django-templates-i18n", "package_url": "https://pypi.org/project/django-templates-i18n/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-templates-i18n/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/PragmaticMates/django-templates-i18n" }, "release_url": "https://pypi.org/project/django-templates-i18n/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Translatable templates", "version": "0.1.0" }, "last_serial": 1167899, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "3856d49d68020433e68131b2a4ae58e3", "sha256": "981ea2d50790e0e290f3ae7d94ea1dd22ef2bfedad2db07ca53651a71262a167" }, "downloads": -1, "filename": "django-templates-i18n-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3856d49d68020433e68131b2a4ae58e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2880, "upload_time": "2014-07-24T13:25:59", "url": "https://files.pythonhosted.org/packages/76/6c/15e4316eeb4a6780e88b2b3d36fe16b59db66165fef7803fc6ad4170acf0/django-templates-i18n-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3856d49d68020433e68131b2a4ae58e3", "sha256": "981ea2d50790e0e290f3ae7d94ea1dd22ef2bfedad2db07ca53651a71262a167" }, "downloads": -1, "filename": "django-templates-i18n-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3856d49d68020433e68131b2a4ae58e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2880, "upload_time": "2014-07-24T13:25:59", "url": "https://files.pythonhosted.org/packages/76/6c/15e4316eeb4a6780e88b2b3d36fe16b59db66165fef7803fc6ad4170acf0/django-templates-i18n-0.1.0.tar.gz" } ] }