-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Translation for the admin project #139
base: master
Are you sure you want to change the base?
Conversation
(cherry picked from commit 4821b64) # Conflicts: # pg_metadata/processing/administration/create_administration_project.py
I would need to make a PR in QGIS-Plugin-CI to push and pull TS files for Transifex. I will have a look. Thanks for looking into this ticket. |
If I understand correctly, qgis-plugin-ci takes We can let this PR rest until Transifex integration is available. In the meantime, my colleagues and I are happy with the local .qm file. ;-) |
Another issue with translating the admin project is that the selection lists in the attribute form will be empty if there is no translation of a label. This could be solved by translating all labels in the glossary or by providing a new view with a label column that uses |
pg_metadata/processing/administration/create_administration_project.py
Outdated
Show resolved
Hide resolved
pg_metadata/processing/administration/create_administration_project.py
Outdated
Show resolved
Hide resolved
pg_metadata/processing/administration/create_administration_project.py
Outdated
Show resolved
Hide resolved
I’ll fix this today, so it will be ready for the 1.3.0 version |
New view `v_glossary_normalised_locale_fallback` normalises (unpivots) the glossary table, so the admin project can use this view and set a filter by locale on the layer. Thus, a new translation needs to only change the filter to use the new locale and the various attribute form widgets don’t have to be translated. For editing, the original glossary table (with columns for each locale) is shown as “Glossary Translations” to the admin project.
I have made the simple fixes (pathlib, f-strings) in commits fdee520, 3021bca The last commit (4882db2 “Provide translated glossary…”) is a suggestion on how to handle the translated and untranslated glossary terms. This commit would provide a new view which offers a label and description for every item; if the translations is missing, the English terms are used (also see my comment above #139 (comment)). The previous commits use the admin project as-is and selection of the proper locale in the attribute forms is done via project translation / .ts file. However, this doesn’t provide a straightforward fallback mechanism, at least within QGIS, as far as I can see. (We could of course create a view that replicates the structure of the glossary table, filling in fallbacks with I guess the proper way forward depends on what fits your design approach and workflow (esp. Transifex) best. |
Ah, and I should rebase. I’ll do that when you have decided which approach to take. Joyeux noël! |
I’ve implemented the approach mentioned in #30: create a .ts file from the admin project and both translate the field aliases, form titles, layer names etc. and the
label_en
glossary field references in the attribute forms. This works nicely, the translated project pulls the glossary terms from thelabel_de
column now.This PR also extends the “create administration project” processing algorithm: The user can select a language (default is the user’s locale) and the corresponding .qm file is copied alongside the target .qgs project file.
At the moment, the .qm files would reside in
resources/projects
, but they could also fit ini18n
. Also, you would need to add the Transifex part of the translation process.Sorry, the German .ts is in
i18n
but the .qm is inprojects
. But that will be obsolete anyway when moving to Transifex.