-
Notifications
You must be signed in to change notification settings - Fork 164
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
Qt GUI: Implement translations + monospaced font customization #1032
Conversation
867c2ca
to
7341e31
Compare
After this, others can use Qt Linguist to translate the UI strings. |
7341e31
to
2550a49
Compare
By the way, CJK languages have misaligned text output in MediaInfoLib. |
7b1c2b8
to
8cf155a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the proposal but
After this, others can use Qt Linguist to translate the UI strings.
No, because the "upstream" is the CSV files, and the Qt translation files need to be updated from theses CSV files.
Having a "fork" in the translation files will be a burden at long term.
Mandatory thing is, as it is done for the macOS translations, an automated script that permits us to easily update the Qt translation files from time to time.
Optionally, if you want that the users are able to use Qt Linguist, an automated script that permits use to easily update the CSV files when there is a Qt files update.
No, it would deserve a patch. |
I did use a script to update the Qt translation files from the csv for this PR. Some strings don't match the VCL GUI so they are not translated. |
In case it is not clear, the Qt translation is only for the UI part. MediaInfoLib still uses the csv files directly. |
8cf155a
to
2b2624a
Compare
I don't see the script in the PR.
I don't understand. |
The .ts files are generated from the Qt project/source files using Qt's lupdate CLI tool. They contain all the translatable strings in the Qt GUI. The translations can then be added using Qt Linguist or with a script. The Qt GUI uses different strings for the menus etc so the script cannot match everything properly to the csv. The script is not perfect also. The .qm are generated from .ts using Qt's lrelease CLI tool. |
I see no easy way to reliably copy translations from the csv to ts due to the different way Qt handles string identification. |
Please provide something similar to https://github.com/MediaArea/MediaInfo/tree/master/Source/GUI/Cocoa/_i18n i.e. a documentation and/or a batch for having a quick way to do an update.
Even if not perfect, but I guess that we could use the English sentences as a "key" for fetching the translation from the other files (English sentences --> CSV first column --> translations), and maybe not creating the files from scratch but being able to update them by catching the English sentence ("source" element) in the Qt files and filing the "translation" element.Creating new lines in the CSV when you have new sentences. I don't want to have a fork in the translations and/or having to manually fill different places for the same translation. |
e7bcc6a
to
b97e9d3
Compare
Okay, fully automated now. I changed some strings in Qt GUI to match as much as possible with existing translation keys. There are still some strings left untranslated as they are no equivalent in the existing translations. I will leave that for others to translate in future. Just need to add those entries in the CSV and run the update script. Existing VCL GUI also has untranslated strings anyway. It's easier than VCL, when adding new text to the Qt GUI form, just add corresponding entry to CSV and run the update script. No coding needed for translations. There is no noticeable glitch or delay with loading the language list in Preferences for Qt unlike the VCL one.
This cannot be automated as the |
b97e9d3
to
381f6df
Compare
381f6df
to
5224098
Compare
Thank you.
I am testing with Qt 6.8.2 Windows.
Thank you.
Would have been a plus to fill the CSV with lines with 2 columns filled (1st one with a short ID without space, some ";", up to the English related column) but I understand that this is already a lot for you, I may do that when I do more QA on the translations before offering the Qt version.
Yes, this is on our QA todo-list.
I need to change the current behavior of the VCL and loading a small file instead of all CSV files, but not related to here. |
I just use the .cmd file to generate/update all the .ts and .qm. I'm using latest Qt 6.8.2 here too. |
I just run your .cmd, so weird! |
I just tried again.... On this branch, I deleted everything in Translations folder then run the .cmd.... I got perfect match with this branch, GitHub Desktop shows nothing to commit. I suspect it may be due to the xml parsing library in Python may be different somehow? Yours seems to be reordering everything in alphabetical order. Mine:
Checking previous commit, when Qt Linguist was used instead of the script: <TS version="2.1" language="en_US" sourcelanguage="en_US"> |
Updated my old Python 3 and I have the same thing as you now. |
Translations:

Monospaced font customization (for sheet/text view):

