PDA

View Full Version : Qt Linguist Question



zgulser
23rd March 2012, 08:45
Hi everybody, I have 4 questions regarding Qt translation issues..

1. Are tr() calls must(should) be done for manually added widgets(I mean widgets added from the source code, not from the designer)?

Because I experinced that adding widget from the designer and setting it's locale is adaquate for mark it as a translation candidate for translator.

Note: Obviously assume that a translator is loaded to our app.

2. Does "Locale" parameter in the designer for the widgets has anything to do with this issue?

3. Should tr() calls made for manually added widgets(I mean widgets added from source, nor designer)

4. How retranslateUi() decides which language is to be translated just with changeEvent()?

Thanks from now.

Spitfire
26th March 2012, 09:32
1. Every string that you want to be translated should be wrapped in tr().
2. The 'locale' (set using QWidget::setLocale()) changes widget locale. For example you can have whole app in English, but single text edit line in Chinese.
3. See #1.
4. retranslateUI() translates all strings to current application locale language using installed translators.