{ "info": { "author": "YogurtTheHorse", "author_email": "yogurt@yogurtthehor.se", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Localizator\n\nPurpose of this simple package is to give easy to use abstractions for localizing your python app. Generally this package was made just for my telegram bots.\n\n## Initialization\nFirstly, you have to create localizator object:\n```Python\nfrom localizator import Localizator\n\nlocalizator = Localizator()\n```\n\nAlso, you could pass `LocalizationsProvider` and default language. LocalizationsProvider is fabric that creates `Localization`s objects by language name.\nBy default it will use YAML implementation that looks for `*.yaml` files inside `localizations` directory, but you could create your own localizations provider or at least change directory if it's necessary.\n \nIf you did not change anything in localizator initialization, create directory inside working directory called `localizations` and create file `en.yaml` with example content:\n```yaml\nfoo: bar\n\nextended_foo:\n bar: foo\n\nworld: \"{} world\"\nformatting: \"Hello, {}!\"\nnamed_formatting: \"Hello, {world}!\"\n``` \n\n## Simple use\n\nAfter that you can start using localizator:\n\n```Python\nfrom localizator import LocalizationDescription\nfrom localizator import Localizator\n\nlocalizator = Localizator()\n\nprint(localizator.get_localization(LocalizationDescription(['foo'])))\nprint(localizator.get_localization(LocalizationDescription(['extended_foo', 'bar'])))\n```\n\n## Describer\nLooks not really simple? Yeah, it's, but do not stop here! We have _brand new_ `Describer`. It allows to make your localization really simple, i mean, just look:\n\n```Python\nfrom localizator import LocalizationDescriber\nfrom localizator import Localizator\n\nd = LocalizationDescriber()\nlocalizator = Localizator()\n\nprint(localizator.get_localization(d.foo))\nprint(localizator.get_localization(d.extended_foo.bar))\n\n# And even more!\nprint(localizator.get_localization(d.formatting(\"world\")))\nprint(localizator.get_localization(d.named_formatting(world=\"world\")))\n\n\n# Moar!\nprint(localizator.get_localization(d.formatting(d.world('breathtaking'))))\n```\n\nAlso, if you want to highlight your paths to localizations as strings, you could use string:\n```Python\nprint(localizator.get_localization(d('foo')))\nprint(localizator.get_localization(d('extended_foo.bar')))\n``` \n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yegorf1/localizator", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "localizator", "package_url": "https://pypi.org/project/localizator/", "platform": "", "project_url": "https://pypi.org/project/localizator/", "project_urls": { "Homepage": "https://github.com/yegorf1/localizator" }, "release_url": "https://pypi.org/project/localizator/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Easy to use abstractions for localizing your python apps.", "version": "0.1.0" }, "last_serial": 4448110, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "540e54b01273488e9f076b89643f413d", "sha256": "91d8eef0ce275155f29b7865ddb3f1565601d0de0e3bc6ab1ca0da7b1f907272" }, "downloads": -1, "filename": "localizator-0.1.0.tar.gz", "has_sig": false, "md5_digest": "540e54b01273488e9f076b89643f413d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4402, "upload_time": "2018-11-03T19:54:53", "url": "https://files.pythonhosted.org/packages/d6/38/15144b765dc7e68537180598f2f453afe9342a584847a8d8f6c43f1ff9b6/localizator-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "540e54b01273488e9f076b89643f413d", "sha256": "91d8eef0ce275155f29b7865ddb3f1565601d0de0e3bc6ab1ca0da7b1f907272" }, "downloads": -1, "filename": "localizator-0.1.0.tar.gz", "has_sig": false, "md5_digest": "540e54b01273488e9f076b89643f413d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4402, "upload_time": "2018-11-03T19:54:53", "url": "https://files.pythonhosted.org/packages/d6/38/15144b765dc7e68537180598f2f453afe9342a584847a8d8f6c43f1ff9b6/localizator-0.1.0.tar.gz" } ] }