New submission from Benjamin Kane <bbk1...@gmail.com>:

Localizing a Python application involves using the `gettext` standard library 
module to read .mo files. There are three scripts to assist with this in 
https://github.com/bbkane/cpython/tree/master/Tools/i18n :
- makelocalealias.py : Convert the X11 locale.alias file into a mapping 
dictionary suitable for locale.py.
- msgfmt.py : Generate binary message catalog from textual translation 
description
- pygettext.py : Generate .pot files identical to what GNU xgettext[2]
generates for C and C++ code (these can be translated by msgfmt.py)

I recently wrote a tutorial to localize a Python Script ( 
https://github.com/bbkane/arcade/blob/bbkane/add_localization_example/doc/examples/text_loc_example.rst
 ) and I had to tell my users (a student audience) to download these scripts 
from GitHub. I would have been much happier to ask them to use a builtin Python 
tool available from the `-m` switch (similar to `python -m json.tool`), so this 
issue is to add that.

The docs ( 
https://docs.python.org/3/library/gettext.html#internationalizing-your-programs-and-modules
 ) mention these scripts, but do not provide any information on how to get them.

Possible solutions:

- turn gettext.py into a package and put these scripts into a tool subpackage 
(similar to json.tool)
- Add a separate package (il8n perhaps) and put these scripts into there
- Add links to these scripts and instructions to use them in the docs.

----------
messages: 341771
nosy: bbkane
priority: normal
severity: normal
status: open
title: Make il8n tools available from `python -m`

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36837>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to