Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PICARD-2690: move const translations #2291

Merged
merged 2 commits into from
Aug 24, 2023

Conversation

phw
Copy link
Member

@phw phw commented Aug 24, 2023

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

The picard.const module contains longs lists, most specifically for locales and written scripts.

This makes translating much harder, as half the strings to translate are from these lists, but they are essentially only used for very few UI elements.

Also it makes it difficult to assess how complete a translation of Picard is. A translations that translates all the UI texts except for the locale list has a low completion percentage on Weblate, but actually it is a very complete translation. Likewise a translation that solely translates the locales list shows with the same or higher completion, but actually the application can hardly be described as being localized.

Solution

Move translations of the strings in picard.const into a separate gettext message domain "picard-constants".

I originally planned to move only the locales there, but with Babel it is easier to handle it by excluding a folder. And actually I think that fits well, as it also includes the scripts. Likewise I think it is no mistake to include the values in picard/const/__init__.py as well.

There is a new setup command picard_regen_constants_pot_file. We could also include a single meta command to update both, but for now I wanted to keep it separate (see below).

Action

Of course we should keep existing translations. My plan was as follows:

  • Once this has been merged I set up the Weblate component for it
  • We leverage Weblate's capability to automatically translate strings from other components to fill the translations again
  • Afterwards we can regenerate the main picard.pot (removing the strings from it)
  • I'll also update the translation docs and unify generating both picard.pot and constants/constants.pot with a single command

@phw phw requested review from rdswift and zas August 24, 2023 07:23
@phw phw force-pushed the PICARD-2690-move-locale-translations branch from 48161a6 to b153ad2 Compare August 24, 2023 07:30
Copy link
Collaborator

@zas zas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very needed move +1

picard/pluginmanager.py Outdated Show resolved Hide resolved
@phw phw force-pushed the PICARD-2690-move-locale-translations branch from b153ad2 to f08e791 Compare August 24, 2023 09:37
zas
zas previously approved these changes Aug 24, 2023
Copy link
Collaborator

@zas zas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will ease translations for sure, good move.

setup.py Outdated Show resolved Hide resolved
@phw phw force-pushed the PICARD-2690-move-locale-translations branch from dd04322 to 8428a17 Compare August 24, 2023 13:43
This most prominently moves translations of dropdown lists for locales
and writing systems into a separate component, making it easier to
translate the main UI texts.
@phw phw force-pushed the PICARD-2690-move-locale-translations branch from 8428a17 to cc7439e Compare August 24, 2023 14:57
@phw phw requested a review from zas August 24, 2023 15:14
Copy link
Collaborator

@rdswift rdswift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I have anything to add. It looks good to me.

@phw phw merged commit 75def55 into metabrainz:master Aug 24, 2023
63 checks passed
@phw phw deleted the PICARD-2690-move-locale-translations branch August 24, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants