Location of pygettext.py and msgfmt.py in version 3.13.1

Hi all,

I am new to the forum and hope to be following the guidelines. I am trying to localize my code and I am using version 3.13.1 from www.python.org in Windows 10 (Windows amd64).

I was able to import gettext and initialize it but I am not able to find pygettext.py and msgfmt.py. I searched the documentation in gettext — Multilingual internationalization services — Python 3.13.1 documentation that says that these tools are available in some distributions. Is it available in the distribution I installed? If not, where can I find the latest and compatible version with verssion 3.13.1?

I thank you in advance and best regards,

Marcos

1 Like

Hello and welcome!

The tools still exist in the repo: cpython/Tools/i18n at main · python/cpython · GitHub

For the windows installer, the build config is there: cpython/PCbuild at main · python/cpython · GitHub
But I don’t know this format, so I don’t know if the resulting distribution includes some of the tools, and where they would be installed.

I expect most people to not rely on these. For example, django developers use a command provided by django; or the xgettext program understands Python code; or the Babel project with its pybabel script can be used.

Éric,

Thank you for your answer. I could find it in the repo and also in the source code: https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tgz. It is weird that is not installed when not using the executable file.

I am new to Python. I will probably evolve this application to a Django web app but right now I am coding a standard Python program. Based on your answer it is better to use xgettext or Babel instead of pygettext? My code is only in Python and don’t use other languages such as C++, etc.

Best regards,

Marcos