{"id":20066274,"url":"https://github.com/ossobv/pyl10n","last_synced_at":"2025-03-02T11:15:00.202Z","repository":{"id":26574433,"uuid":"30028679","full_name":"ossobv/pyl10n","owner":"ossobv","description":"2010: Pyl10n is a thread-safe localization (l10n) library for python, written in 2008-2010.","archived":false,"fork":false,"pushed_at":"2020-11-05T15:27:20.000Z","size":817,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-14T19:48:13.810Z","etag":null,"topics":["l10n","library","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ossobv.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-29T16:11:37.000Z","updated_at":"2020-11-05T09:57:34.000Z","dependencies_parsed_at":"2022-09-01T19:20:23.027Z","dependency_job_id":null,"html_url":"https://github.com/ossobv/pyl10n","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossobv%2Fpyl10n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossobv%2Fpyl10n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossobv%2Fpyl10n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossobv%2Fpyl10n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ossobv","download_url":"https://codeload.github.com/ossobv/pyl10n/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241494184,"owners_count":19971871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["l10n","library","python"],"created_at":"2024-11-13T13:55:41.062Z","updated_at":"2025-03-02T11:15:00.169Z","avatar_url":"https://github.com/ossobv.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"PYL10N\n------\n\nPyl10n is a localization (l10n) library for python, written in 2008-2010.\n\nBEWARE: This is old code, migrated to git. Previously, this was found at:\nhttps://code.osso.nl/projects/pyl10n\n\n\nSUMMARY\n-------\n\nPyl10n intends to replace the standard locale module which is not thread\nsafe (locale.setlocale() updates the entire process' locale settings).\nPyl10n allows you to supply the language setting at conversion function\ncall time or through a callback function that allows you to have a\nthread-specific language. E.g.  for Django you could pass\n``django.utils.translation.get_language`` which gets the currently\nselected language.\n\nIts a complement to `gettext` solutions that do not depend on\nprocess-wide language settings.\n\n\nPORTABILITY\n-----------\n\nPyl10n has been tested with python 2.5 through 2.7 on Debian/Ubuntu\nLinux systems. It's been known to work with Python 3 as well.\n\nPython support before 2.7 cannot be guaranteed. Python support for 3 is\nnot well tested.\n\n\nTODO\n----\n\nThe generated locale files should be packaged separately so you don't\nneed to fetch them when using pyl10n with only a handful of selected\nlanguages.\n\n\nEXAMPLE\n-------\n\nImport pyl10n as locale:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e import pyl10n as locale\n\nHardcode the current thread locale.\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e locale.setlocale('nl_NL')\n    \u003e\u003e\u003e print(locale.currency(12345.67))\n    € 12345,67\n\nUsually you'll want to set a function that returns the current thread\nlocale.\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e getlocale = lambda: 'en_US'\n    \u003e\u003e\u003e locale.setlocalefunc(getlocale)\n    \u003e\u003e\u003e print(locale.format('%f', 12345.67, True, True))\n    12,345.67\n\nIf you're using your own locale files, you may set up the path like this:\n\n.. code-block:: console\n\n    $ ls path/to/locale/en/ -1p\n    LC_ADDRESS\n    LC_MEASUREMENT\n    LC_MESSAGES/\n    LC_MONETARY\n    LC_NAME\n    LC_NUMERIC\n    LC_PAPER\n    LC_TELEPHONE\n    LC_TIME\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e locale.setlocalepath('path/to/locale')\n    \u003e\u003e\u003e locale.setlocale('en')\n    \u003e\u003e\u003e locale.teldom2string((31, 50, 1234567))\n    '(50) 1234567'\n    \u003e\u003e\u003e locale.setlocale('sv')\n    \u003e\u003e\u003e locale.teldom2string((31, 50, 1234567))\n    '050-1234567'\n\nThe data files are stored/read using pickle.\n\n\nTESTS\n-----\n\nA quick selftest can be run:\n\n.. code-block:: shell\n\n    $ python -c 'from pyl10n import selftest; selftest()'\n    ...\n\nDifferences between the locale output and the pyl10n output *may* be\nattributed to an alternate/earlier source of locale date, or to custom\nadjustments (improvements) by me (to the Dutch or English locale files).\n\n\nLIMITATIONS\n-----------\n\nAs of this writing, it is not complete yet. It does implement\n``format()`` and ``currency()`` correctly (see\nhttp://bugs.python.org/issue1222 ) and it has most of the time\nformatting support that ``strftime(3)`` specifies.\n\nIn the near future (ha ha) it will support address formatting functions.\n\nLook at the lists of finished and unfinished functions in the source.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fossobv%2Fpyl10n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fossobv%2Fpyl10n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fossobv%2Fpyl10n/lists"}