-
Notifications
You must be signed in to change notification settings - Fork 298
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
Add QTranslator support and generate initial .ts files #33
Conversation
9b11f96
to
97ca66a
Compare
i'd rather add new strings to existing *.po & *.pot files instead of introducing new files just for interface |
I did thought that initially but quickly realized that QT cannot use .mo files for the translation of it's ui. I think that the alternative isn't much better. I'm open for suggestions on how to make this better anyway 😄 using both gettext and QTranslator is an ugly hack (that i personally found better that the proposed alternatives) |
|
I did already knew that, but given the way that the beta QT frontend builds it's dialogs i really don't know how can gettext be used to translate the resource files. I originally used extractrc+gettext but it seems that the only way for those translations to take effect was hacking into QTranslator. If you could guide me with some documentation on this i will try to make an alternative patch. Thanks for the comments! |
This manual contains some interesting things:
But I don't know how to pass uic options from a project file. |
I will investigate on that, thanks! |
I've managed to enable gettext usage with qt5 but with workarounds:
create qt5gettext.h with
We need this ugly workaround because uic generates function calls with 2 arguments:
|
That's genius! I was stuck trying to get QMAKE_UIC_FLAGS working. |
I was struggling against this variable either until google said me that it's removed in 5.x. |
All QT dialog boxes can be automatically translated by the content of .mo files. |
I checked the localization work without using the code given in this request. |
@iglosiggio @375gnu Localization with compiled .qm files works. |
http://doc.qt.io/qt-5/qtranslator.html#load I think that you can do And in the install of qmake install the .qm files on that folder. PD: I think that @375gnu solution for a unified translation system was a lot more elegant than my solution of using both gettext and QTranslator. |
@iglosiggio Thanks. It work. |
Hi! I'm working to add Celestia to a debian-based distro and while packaging the software i saw the oportunity to give it some love on the translations.
On our package we generate the .qm files and install them manually, but i think that this can be incorporated into celestia.pro easily.
The initial .ts files were generated with the command
lupdate celestia.pro
, and i've made the spanish translation.It's worth noting that this only affects the Qt dialogs that are created via resource files (.ui) and the Qt translatable string (the
tr
mactro). I've also updated in our package de .pot files but those changes are still messy.