{ "info": { "author": "iocast", "author_email": "iocast@me.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "The bottle-i18n plugin integrates the multilingual internationalization services `gettext` from Python with your Bottle application.\n\nUsage Example:\n\n::\n\t\n\t#!/usr/bin/python\n\t\n\timport bottle, os\n\tfrom bottle.ext.i18n import I18NPlugin, I18NMiddleware, i18n_defaults, i18n_view, i18n_template\n\t\n\ti18n_defaults(bottle.SimpleTemplate, bottle.request)\n\t\n\tdef get():\n\t app = bottle.Bottle()\n\t \n\t @app.route('/')\n\t def index():\n\t return bottle.template(\"{{_('hello')}} I18N?\")\n\t \n\t @app.route('/world')\n\t def variable():\n\t return bottle.template(\"{{_('hello %(variable)s', {'variable': world})}}?\", {'world': app._('world')})\n\t \n\t \n\t @app.route('/view')\n\t @i18n_view('hello', function=\"i18n_view\")\n\t def tmpl_app_hello():\n\t return {}\n\t \n\t @app.route('/tmpl')\n\t def tmpl_app_hello():\n\t return i18n_template('hello', function=\"i18n_template\")\n\t \n\t \n\t lang_app = bottle.Bottle()\n\t \n\t @lang_app.route('/')\n\t def sub():\n\t return bottle.template(\"current language is {{lang()}}\")\n\t \n\t app.mount(app = lang_app, prefix = '/lang', skip = None)\n\t \n\t return I18NMiddleware(app, I18NPlugin(domain='messages', default='en', locale_dir='./locale'))\n\t\n\tif __name__ == '__main__':\n\t bottle.run(app=get(), host='localhost', port='8000', quiet=False, reloader=True, debug=True)\n\nRunning the above example it automatically loads the default language `en` if in the URL the langauge code or the `HTTP_ACCEPT_LANGUAGE` sent from the browser is missing.\n\nThe URL structure is as follow\n\n::\n\t\n\thttp://localhost:8000//", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.github.com/iocast/bottle-i18n", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "bottle-i18n", "package_url": "https://pypi.org/project/bottle-i18n/", "platform": "any", "project_url": "https://pypi.org/project/bottle-i18n/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.github.com/iocast/bottle-i18n" }, "release_url": "https://pypi.org/project/bottle-i18n/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "I18N integration for Bottle.", "version": "0.1.5" }, "last_serial": 1028361, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "e8da8f0199ea55137091de0bdfaa1355", "sha256": "d2f4e9d9ca62215850c3ab70a5afe3e185911fc12c604152c379d4ad1be54c5b" }, "downloads": -1, "filename": "bottle-i18n-0.1.tar.gz", "has_sig": false, "md5_digest": "e8da8f0199ea55137091de0bdfaa1355", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2261, "upload_time": "2013-09-11T12:24:41", "url": "https://files.pythonhosted.org/packages/61/2b/0438a26c2887515e9be0ff8b52661597f57600b5e71aa823867e3025357c/bottle-i18n-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "807faaa2a5a466ca25586419958df33a", "sha256": "e3881c311418b73adf20b4dd5c554d1a1ad4761dc6810470da71bd9ff2e40925" }, "downloads": -1, "filename": "bottle-i18n-0.1.1.tar.gz", "has_sig": false, "md5_digest": "807faaa2a5a466ca25586419958df33a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2160, "upload_time": "2013-09-12T15:52:02", "url": "https://files.pythonhosted.org/packages/b8/1b/2985a5c6e953eb2555be87c393dc9d9688e1eece3398a2a084b8f5d91681/bottle-i18n-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f759c80e9bc1c8df39abad25ee451223", "sha256": "bd7d81798d0fb85bcafeaebe6ca592bd952b682c35099bb2b373f61fbeacf4ff" }, "downloads": -1, "filename": "bottle-i18n-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f759c80e9bc1c8df39abad25ee451223", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2314, "upload_time": "2013-12-02T15:58:12", "url": "https://files.pythonhosted.org/packages/90/94/4f86a2783a4c6587ececaf3bf39517b0e407f513c7760c434a2607cee25b/bottle-i18n-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "ddd092e5d117e38fdb1b19521048d82c", "sha256": "ded5d0523b31168e273324a7bdc7c76e7b869075fd3934f111a70b7636fc464f" }, "downloads": -1, "filename": "bottle-i18n-0.1.3.tar.gz", "has_sig": false, "md5_digest": "ddd092e5d117e38fdb1b19521048d82c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3231, "upload_time": "2013-12-03T12:01:38", "url": "https://files.pythonhosted.org/packages/0d/99/cb2ea80b7efb3c3d5770a88c498c6d72f54efdc077475316267ff56d008e/bottle-i18n-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "65fa164cf51b4c1f3852a9b24ba60b84", "sha256": "869301fe66c64b60f97bb08542349e9c53570b8c9b354c6d7d12e609a8f7051b" }, "downloads": -1, "filename": "bottle-i18n-0.1.4.tar.gz", "has_sig": false, "md5_digest": "65fa164cf51b4c1f3852a9b24ba60b84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3245, "upload_time": "2014-01-02T15:08:39", "url": "https://files.pythonhosted.org/packages/cb/77/48540a1bbe0cf9b04fb047b04aa2a0c030915c15643d0320dbf253e41849/bottle-i18n-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "f0942f05fec0f4a3c45765623863cb68", "sha256": "7f9d343ae30b18a9676cbe612a8be2e99d4741aa4aa6a1b875ea232ba94c7678" }, "downloads": -1, "filename": "bottle-i18n-0.1.5.tar.gz", "has_sig": false, "md5_digest": "f0942f05fec0f4a3c45765623863cb68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3330, "upload_time": "2014-03-13T11:48:00", "url": "https://files.pythonhosted.org/packages/ee/b5/4de84a2039bcdceff803fae6ba306bd2713191a7d26f01b4affc55f67049/bottle-i18n-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f0942f05fec0f4a3c45765623863cb68", "sha256": "7f9d343ae30b18a9676cbe612a8be2e99d4741aa4aa6a1b875ea232ba94c7678" }, "downloads": -1, "filename": "bottle-i18n-0.1.5.tar.gz", "has_sig": false, "md5_digest": "f0942f05fec0f4a3c45765623863cb68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3330, "upload_time": "2014-03-13T11:48:00", "url": "https://files.pythonhosted.org/packages/ee/b5/4de84a2039bcdceff803fae6ba306bd2713191a7d26f01b4affc55f67049/bottle-i18n-0.1.5.tar.gz" } ] }