Hi,
I'm having a serious issue with lupdate - it is generating duplicate strings when it parses the .ui designer files.
Is there any way to make it not to? I didn't see an option for this to give to lupdate or this being documented.
Hi,
I'm having a serious issue with lupdate - it is generating duplicate strings when it parses the .ui designer files.
Is there any way to make it not to? I didn't see an option for this to give to lupdate or this being documented.
Hi,
I suppose you can not change this behaviour. But when you use Linguist you have an option to select previously entered translations. Then its pretty fast even if you have got several duplicate strings.
And the form is not listed twice in the .pro file? Or do you mean dropping the obsolete translations with -noobsolete?
J-P Nurmi
I'm not going to be making use of the Linguist for translations, so duplicate strings are an issue for me :|
I did try lupdate -noobsolete, but that gave the same result. The duplicate strings come from the different .ui files.
Ah you mean like that. Yes, if you have two different forms with different names, they are treated as different translation contexts. Give both forms the same name and they will be treated as same translation context.
J-P Nurmi
How can this be done?
It seems the designer only accepts one window per .ui file.
Make both forms have the same name eg. "Form" (it's the objectName-property when you select the form background or the root from the object inspector).
J-P Nurmi
Thanks, I found the issue with "Forms" being duplicated as the window title (they were actually embedded, so never saw the title).
I still have the problem though, but on a lesser scale - it's duplicating other strings too:
Any possible ideas for this?#: MainWindow#4
msgid "Triggers"
msgstr ""
#: dlgTriggerEditor#1
msgid "Triggers"
msgstr ""
#: trigger_editor#11
msgid "Triggers"
msgstr ""
Naming all of the objectNames the same temporarily solved duplication between .ui files - however, it doesn't account for the duplicates between .cpp and .ui files still.
You can use QCoreApplication::translate() instead of QObject::tr() in .cpp files to enforce a certain translation context (the same as in the .ui file).
J-P Nurmi
Hmm. I replaced my
With
However lupdate is not picking up these strings now.QCoreApplication::translate("mudlet", "message", NULL, QCoreApplication::UnicodeUTF8)
lupdate does not contain a full C++ parser, so it is somewhat limited in
what it accepts.
Try using
Qt Code:
To copy to clipboard, switch view to plain text mode
and a simple
Qt Code:
To copy to clipboard, switch view to plain text mode
Thanks, I'll give that a try.
And the example provided was a .po file that I converted the .ts to, sorry. But in the .ts it showed the different contexts anyway.
Bookmarks