{ "info": { "author": "Daniel Kaufhold", "author_email": "daniel.kaufhold@bitmazk.com", "bugtrack_url": null, "classifiers": [], "description": "Django Localized Names\n======================\n\n\nA reusable Django app to allow localization of person names similar to the way\nDjango localizes dates and numbers. You will have this need when you deal with\nprojects that have Chinese and English language, because in Chinese, names are\nwritten in the following format::\n\n {last name}{first name}{title}\n\nWhereas in English, of course, they are written like so::\n\n {title}. {first name} {last name}\n\nThis app will make sure, that when a user switches the language for the site, even person names will get \"translated\" properly.\n\n\nInstallation\n------------\n\nYou need to install the following prerequisites in order to use this app::\n\n pip install Django\n\nIf you want to install the latest stable release from PyPi::\n\n $ pip install django-localized-names\n\nIf you feel adventurous and want to install the latest commit from GitHub::\n\n $ pip install -e git://github.com/bitmazk/django-localized-names.git#egg=localized_names\n\nAdd ``localized_names`` to your ``INSTALLED_APPS``::\n\n INSTALLED_APPS = (\n ...,\n 'localized_names',\n )\n\nUsage\n-----\n\n\nModel interface\n===============\n\nSince this app does not know about your specific model (let's call it\n``Person`` in our example), that holds the values for names and title, it\nexpects that you implement the following methods.\nExample::\n\n class Person(models.Model):\n \"\"\"Holds the information about a person in your system.\"\"\"\n\n # your fields go here\n\n def get_gender(self):\n \"\"\"Returns either 'Mr.' or 'Mrs.' depending on the gender.\"\"\"\n if self.gender == 'male':\n return 'Mr'\n else:\n return 'Mrs'\n def get_title(self):\n \"\"\"Returns the academic title of the person\"\"\"\n return self.title\n def get_romanized_first_name(self):\n \"\"\"Returns the first name in roman letters.\"\"\"\n return self.first_name # e.g. Zhang\n def get_romanized_last_name(self):\n \"\"\"Returns the first name in roman letters.\"\"\"\n return self.last_name # e.g. Mingshun\n def get_non_romanized_first_name(self):\n \"\"\"Returns the non roman version of the first name.\"\"\"\n return self.chinese_first_name # e.g. \u5f20\n def get_non_romanized_last_name(self):\n \"\"\"Returns the non roman version of the first name.\"\"\"\n return self.chinese_last_name # e.g. \u660e\u987a\n def get_nickname(self):\n \"\"\"Returns the nickname of a person in roman letters.\"\"\"\n return self.nickname # e.g. Jack\n\n\nTemplatetag\n===========\n\nTo get the name of a `person` you simply use the templatetag in the template\nlike so `{{ person|get_name \"SHORT_NAME_FORMAT\" }}`.\n\nAlternatively you can provide `\"LONG_NAME_FORMAT\"`, which is the default.\n\n\nSettings\n========\n\nThe app provides standard settings for German, English and Chinese.\n\nIf you want to override our standards, you can set the\n`CUSTOM_FORMAT_MODULE_PATHS` setting (it defaults to\n[`localized_names.formats`, ]).\nIf you provide additional formats, you simply extend the setting. ::\n\n CUSTOM_FORMAT_MODULE_PATHS = [\n 'my_app.formats',\n 'localized_names.formats',\n ]\n\n\nAdd or override formats\n=======================\n\nThis app makes use of Django's existing locale formats framework.\nSo you will want to use the following folder structure for adding new formats:\n\n::\n\n my_app/\n formats/\n __init__.py\n en/\n __init__.py\n formats.py\n\nThis is further described here:\n\nhttps://docs.djangoproject.com/en/dev/topics/i18n/formatting/#creating-custom-format-files\n\nThe `formats.py` will then need a setting for `SHORT_NAME_FORMAT` and\n`LONG_NAME_FORMAT`.\n\nPossible options are ::\n\n g = gender (i.e. Mr, Mrs)\n G = gender capitalized\n t = title (i.e. Dr, Prof)\n t = title capitalized\n f = romanized first name\n F = romanized first name capitalized\n l = romanized last name\n L = romanized last name capitalized\n a = non romanized first name\n A = non romanized name capitalized\n x = non romanized last name\n X = non romanized last name capitalized\n n = nickname\n N = nickname capitalized\n\nFor example ::\n\n LONG_NAME_FORMAT = '{a}{x}{g} ({L}, \"{n}\", {f})'\n\nwould yield in the following formatted name:\n\n `\u5f20\u660e\u987a\u5148\u751f (ZHANG, \"Jack\", Mingshun)`\n\n\nContribute\n----------\n\nIf you want to contribute to this project, please perform the following steps::\n\n # Fork this repository\n # Clone your fork\n $ mkvirtualenv -p python2.7 django-localized-names\n $ pip install -r requirements.txt\n $ ./localized_names/tests/runtests.sh\n # You should get no failing tests\n\n $ git co -b feature_branch master\n # Implement your feature and tests\n # Describe your change in the CHANGELOG.txt\n $ git add . && git commit\n $ git push origin feature_branch\n # Send us a pull request for your feature branch\n\nWhenever you run the tests a coverage output will be generated in\n``tests/coverage/index.html``. When adding new features, please make sure that\nyou keep the coverage at 100%.\n\n\nRoadmap\n-------\n\nCheck the issue tracker on github for milestones and features to come.", "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/bitmazk/django-localized-names", "keywords": "django,app,names,localization,l10n", "license": "The MIT License", "maintainer": null, "maintainer_email": null, "name": "django-localized-names", "package_url": "https://pypi.org/project/django-localized-names/", "platform": "OS Independent", "project_url": "https://pypi.org/project/django-localized-names/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/bitmazk/django-localized-names" }, "release_url": "https://pypi.org/project/django-localized-names/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "A reusable Django app to provide a correct order for names according to the\ncurrently set language.", "version": "0.2.1" }, "last_serial": 2088309, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "e8a6cef4a6444388b80a4886a3b606d1", "sha256": "3085420fbdcf8ddb3039ce81e1e08f8b56e81e175b5eb32e86712b8094c88f02" }, "downloads": -1, "filename": "django-localized-names-0.1.tar.gz", "has_sig": false, "md5_digest": "e8a6cef4a6444388b80a4886a3b606d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9156, "upload_time": "2013-05-08T09:57:28", "url": "https://files.pythonhosted.org/packages/bc/63/74b6bffcd145f0d9755da48e401bc212a2d1a2610226f5ddf1772a51ba0f/django-localized-names-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7852efdad7993eba30f15ed9aa783633", "sha256": "888a1db933fb339c919bcf5f4608659453abf4304b7ed8613d210dba692deff8" }, "downloads": -1, "filename": "django-localized-names-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7852efdad7993eba30f15ed9aa783633", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9629, "upload_time": "2013-05-09T13:27:06", "url": "https://files.pythonhosted.org/packages/63/1b/0c573d04908011f47b3010df0e15224263255bd2a034e47f754516763be6/django-localized-names-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "ba0ad15db3007bb6f706efb94bfb35da", "sha256": "3900e65a324bb6df4673a77daf34fa9baa799554e80bd67290c405706a936e33" }, "downloads": -1, "filename": "django-localized-names-0.1.2.tar.gz", "has_sig": false, "md5_digest": "ba0ad15db3007bb6f706efb94bfb35da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9661, "upload_time": "2013-05-13T07:22:39", "url": "https://files.pythonhosted.org/packages/a2/ee/d1e9fadde1cdefa8eaba67383d771ed0e48e5df275f5d2392827e870e9f2/django-localized-names-0.1.2.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "bd36194d7c49b952002688717cac0811", "sha256": "a8b19606c496d8351b25290a20aacc8481450a517d8548a0e8d9508c92b98158" }, "downloads": -1, "filename": "django-localized-names-0.2.tar.gz", "has_sig": false, "md5_digest": "bd36194d7c49b952002688717cac0811", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10250, "upload_time": "2013-06-25T09:21:57", "url": "https://files.pythonhosted.org/packages/7f/b9/4534b7d54a49293f53fb99bbaf863c5b12779fba63ab266ad3a0c4ef7c7d/django-localized-names-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "aae354f5c384ee6f69d8d8eb50e414fa", "sha256": "d8c50a9bdd9ad33ec0af9429735eaf5c7fb3748bb5925c38fe293fd441d658ab" }, "downloads": -1, "filename": "django-localized-names-0.2.1.tar.gz", "has_sig": false, "md5_digest": "aae354f5c384ee6f69d8d8eb50e414fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9747, "upload_time": "2016-04-28T09:43:45", "url": "https://files.pythonhosted.org/packages/20/09/d02401eb759702737a03f56559bce11b23566d876cdbae453fa6d073cfa7/django-localized-names-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aae354f5c384ee6f69d8d8eb50e414fa", "sha256": "d8c50a9bdd9ad33ec0af9429735eaf5c7fb3748bb5925c38fe293fd441d658ab" }, "downloads": -1, "filename": "django-localized-names-0.2.1.tar.gz", "has_sig": false, "md5_digest": "aae354f5c384ee6f69d8d8eb50e414fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9747, "upload_time": "2016-04-28T09:43:45", "url": "https://files.pythonhosted.org/packages/20/09/d02401eb759702737a03f56559bce11b23566d876cdbae453fa6d073cfa7/django-localized-names-0.2.1.tar.gz" } ] }