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

Added Access to Qt Translation Infrastructure #206

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

shartte
Copy link
Contributor

@shartte shartte commented May 30, 2020

This PR should fix #160 and add some additional plumbing to allow for the following:

  • Dynamic translations from C# by installing a C# function as a Qt translator (QCoreApplication.InstallTranslator, QCoreApplication.RemoveTranslator)
  • Easily load Qt Linguist translation files (QM) from disk/Qt-resources or from memory (QCoreApplication.LoadTranslationData, QCoreApplication.LoadTranslationFile)
  • Allows text to be translated using Qt's infrastructure from C# (QCoreApplication.Translate)

Some TODOs:

  • Check APIs (some require .NET Standard 2.1 right now, but might be adapted)
  • QQmlEngine::retranslate (check if this is not auto-triggered by installTranslator)
  • Add a sample
  • More tests
  • Check if unsafe may be used (is there a policy not to?) to reduce heap allocations as much as possible

@pauldotknopf
Copy link
Member

By the way, I'm fine with unsafe code.

@shartte
Copy link
Contributor Author

shartte commented Jun 7, 2020

I have to sort some stuff out first, and then will get back to this in a week or two.

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.

Usage of Qt i18n
2 participants