I’m trying to improve the installation of .mo files (gettext) in the Frescobaldi application.
Here’s what it’s currently installed:
[📦 org.frescobaldi.Frescobaldi org.frescobaldi.Frescobaldi]$ find /app -name *.mo
/app/dev/share/locale/ca/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/cs/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/da/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/de/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/el/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/eo/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/es/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/fi/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/fr/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/it/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/ja/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/nl/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/ru/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/sv/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/tr/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/uk/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/vi/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/zh_CN/LC_MESSAGES/lilypond.mo
/app/dev/share/locale/zh_TW/LC_MESSAGES/lilypond.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/cs/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/cs/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/de/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/de/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/es/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/es/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/fr/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/fr/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/gl/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/gl/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/it/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/it/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/ja/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/ja/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/ko/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/ko/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/nl/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/nl/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/pl/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/pl/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/pt_BR/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/pt_BR/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/ru/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/ru/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/sv/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/sv/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/tr/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/tr/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/uk/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/uk/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/zh_CN/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/zh_CN/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/zh_HK/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/zh_HK/LC_MESSAGES/userguide.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/zh_TW/LC_MESSAGES/frescobaldi.mo
/app/lib/python3.12/site-packages/frescobaldi/i18n/zh_TW/LC_MESSAGES/userguide.mo
/app/share/locale/en_US/LC_MESSAGES/mit-krb5.mo
/app/share/runtime/locale/ca/share/ca/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/cs/share/cs/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/da/share/da/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/de/share/de/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/el/share/el/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/eo/share/eo/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/es/share/es/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/fi/share/fi/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/fr/share/fr/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/it/share/it/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/ja/share/ja/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/nl/share/nl/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/ru/share/ru/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/sv/share/sv/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/tr/share/tr/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/uk/share/uk/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/vi/share/vi/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/zh/share/zh_CN/LC_MESSAGES/lilypond.mo
/app/share/runtime/locale/zh/share/zh_TW/LC_MESSAGES/lilypond.mo
I have some questions:
-
I’m building two different LilyPond versions. The development version installed in the /app/dev prefixes gets normal paths for the .mo files, that is for example:
/app/dev/share/locale/fr/LC_MESSAGES/lilypond.mo. For the stable version installed in the /app prefix instead the .mo files paths are:/app/share/runtime/locale/fr/share/fr/LC_MESSAGES/lilypond.mo. Why is this happening? -
The main app Frescobaldi is a simple python project which does not use Meson or any other similar tool to handle the installation. So the .mo files are copied only in the python install dir
/app/lib/python3.12/site-packages/frescobaldi. I know I should add a command to copy these files to /app/share/locale, in order for appstream to build the translation metadata used by software centers to inform the users if the app is available in their language or not. However it seems that I cannot touch /app/share/locale; it seems a reserved directory. See my attempts in this PR.
I should search other Python projects in Flathub which do not use Meson and see how they deal with this, but I haven’t found any yet. EDIT: I’ve found this one: it seems to have .mo files in /app/share/locale but I cannot understand how this is achieved. -
/app/share/locale/en_US/LC_MESSAGES/mit-krb5.moseems something not cleaned up by the PyQt.BaseApp? Is it really useful?