https://github.com/oefenweb/python-glibc-locale-tools
Tools to work with (glibc) locale files (e.g. LC_MONETARY, LC_NUMERIC, LC_TIME)
https://github.com/oefenweb/python-glibc-locale-tools
cakephp glibc glibc-locale locale locales python python2
Last synced: about 1 year ago
JSON representation
Tools to work with (glibc) locale files (e.g. LC_MONETARY, LC_NUMERIC, LC_TIME)
- Host: GitHub
- URL: https://github.com/oefenweb/python-glibc-locale-tools
- Owner: Oefenweb
- License: mit
- Created: 2015-02-13T13:44:49.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T08:42:09.000Z (almost 6 years ago)
- Last Synced: 2025-01-23T02:44:43.721Z (about 1 year ago)
- Topics: cakephp, glibc, glibc-locale, locale, locales, python, python2
- Language: Python
- Size: 131 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# glibc-locale-tools
[](https://travis-ci.org/Oefenweb/python-glibc-locale-tools)
`glibc-locale-tools` provides some tools to work with (glibc) locale files (e.g. `LC_MONETARY`, `LC_NUMERIC`, `LC_TIME`)
## Requirements
* Python 2.6 seems to work but running tests fails
* Python 2.7
## Usage
### locale-extract-category
Extracts a given `LC_*` section (category) from a locale file.
```sh
bin/locale-extract-category < \
glibc_locale_tools/test/data/nl_NL LC_TIME > \
glibc_locale_tools/test/data/nl_NL.LC_TIME.actual;
```
__NOTE__: This can be useful because some (web) framework, for instance [CakePHP](http://book.cakephp.org/2.0/en/core-libraries/internationalization-and-localization.html), use `LC_TIME` files to provide localisation.
### locale-decode-category
Decodes a given `LC_*` (category) file to a human readable format.
```sh
bin/locale-decode-category < \
glibc_locale_tools/test/data/nl_NL.LC_TIME.expected > \
glibc_locale_tools/test/data/nl_NL.LC_TIME.decoded;
```
__NOTE__: This can be useful when you want to make changes in for instance `LC_TIME`. Use `locale-encode-category` to re-encode.
### locale-encode-category
(Re)encodes a given `LC_*` (category) file to a machine readable format.
```sh
bin/locale-encode-category < \
glibc_locale_tools/test/data/nl_NL.LC_TIME.decoded > \
glibc_locale_tools/test/data/nl_NL.LC_TIME.encoded;
```
__NOTE__: This can be useful when you want to re-encode for instance `LC_TIME`.
## References
* [Glibc locale files](http://localization-guide.readthedocs.org/en/latest/guide/locales/glibc.html)