Le 09/02/2022 à 08:48, Yvan Masson a écrit :
Le 04/02/2022 à 22:07, Petter Reinholdtsen a écrit :[Yvan Masson]Finally, I suppose it is better to handle all the `msgfmt` commands in the `setup.py` script I use to produce the .whl file, but I don't know if there is a standard way to do so.I did a search in the Debian archive for a python package with translations using gettext, to see how setup.py handle it there, and came across the command-not-found package, whos setup.py look like this: #!/usr/bin/python3 from distutils.core import setup from DistUtilsExtra.command import (build_extra, build_i18n) import glob setup( name='command-not-found', version='0.3', packages=['CommandNotFound', 'CommandNotFound.db'], scripts=['command-not-found', 'cnf-update-db'], cmdclass={"build": build_extra.build_extra, "build_i18n": build_i18n.build_i18n, }, data_files=[ ('share/command-not-found/', glob.glob("data/*.db")), ('../etc', ['bash_command_not_found', 'zsh_command_not_found']), ('../etc/apt/apt.conf.d', ['data/50command-not-found']), ]) Perhaps your program can use the build_i18n rules too?Thanks Petter for the search, this looks promising. I will try that when time permits and will let you know.Regards, Yvan
Hi list,I finally managed to include translations to WhosWho. I could not find how to do it with `build_i18n` rules, so wrote a simple script that needs to be run before building the `.whl` file, this is not perfect but it works.
Consequently, I published WhosWho 0.9 which includes translations for Croation, French and Norwegian Bokmål. It is available here [1]. Russian translation seems ongoing on Weblate, so expect a new release soon.
Comments are welcome. If you find this software useful, please leave me a email to let me know!
Regards, Yvan 1. https://framagit.org/Yvan-Masson/WhosWho/-/releases/v0.9
OpenPGP_signature
Description: OpenPGP digital signature