Skip to content

feat: Add Chinese localization #612

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

Merged
merged 4 commits into from
May 4, 2025

Conversation

liusheng2020
Copy link

I have added Chinese language support to demo5. When the user's system default language is set to Chinese, the build process will generate 8 localized versions of the Qt app in Chinese. Some screenshots of the localized app interface are shown below.
image
image
image

@ourairquality
Copy link

Just looked at how this is done, and this does appear to parallel the existing translations, but it looks like a very brittle approach to adding translations - with references to line numbers in the ui files. Is this really the only approach that the qt framework offers? Do all these line number references need updating on practically any change to the ui files?

fwiw if this is your first contribution then perhaps your copyright period should just be 2025 and not 2016-2025, if you must.

@liusheng2020
Copy link
Author

Thank you for pointing that out. This is actually my first time submitting a pull request (in my entire GitHub journey), and I have now changed it to 2025. I also don't use QT very often. Do you have a better solution for the translation approach?

@JensReimann
Copy link
Collaborator

Thank you for providing Chinese translations.

Indeed, annotating the line number is the way Qt generates the translation files. There are automatic tools to update the translations, but I haven't tried how well this works.

I'm also not sure, whether the line numbers are only for translators to find the strings in the files, or of the translation tools to support the translators. But I am sure, that the line number are not used for finding suitable translations for strings during runtime.

I'm still hesitating to merge the PR, as I haven't found a good way to handle the common translations (e.g. in app_cmn_qt/) yet. For now, these strings have to be translated to each and every application again. This feels wrong.

@JensReimann JensReimann merged commit 4bfbc04 into rtklibexplorer:demo5 May 4, 2025
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