PDA

View Full Version : Using Translations in Qt,QML



beemaneni
5th July 2016, 06:49
Hi Guyz,

I am using Translations in Qml with linguist ,lupdate and lrelease.It works fine. But my requirement is , when i have a string say "Hello" in different QML files say 100 places , i do not want to update the respective language string for that in each file.Hence the update should be done in one place so that it reflects everywhere.Currently i do not have much idea how to achieve this? Can anyone suggest the best approach ...

Warm Regards
Bala B

anda_skoa
5th July 2016, 09:14
I am not quite sure what you are asking for.

Do you mean how to change the string in all QML files?
Or do you mean how to change all translations for the same "source" string?

Cheers,
_

beemaneni
5th July 2016, 10:36
Hi

its ur 2nd question...Here in my project i have a string named "Enter" in 1000 places in different QML files. I do not want to change the respective language string in each and every file. I need to change in one place so that it reflects in all the files. Hope i am clear to u now


Regards
Bala B

anda_skoa
5th July 2016, 15:02
linguist has a "search & translate" action, that allows you to search for a source string and replace all translations with the same one.

Cheers,
_

beemaneni
5th July 2016, 18:21
Thanks for the answer. I got it.

I would like to know one more thing here.I want to store all my UI strings in a table or in an excel sheet , so that it would be easy for me to give that to end user . So that he will write respective language string in another column and use it. The main purpose of this is he does not need to use linguist everytime if a string needs to be changed.

Hope you got my point. I am not sure how to start and where to start ?
Please provide your thoughts

Regards

anda_skoa
5th July 2016, 20:27
The "ts" file is an XML based format, you could write a tool that generates a spread sheet and which can also convert the spreadsheet back into ts.

There is also lconvert which can convert between the TS format and other often used translation formats.

if your translators are really just using a spreadsheet, they might actually like using a translation tool as it can make the translation process much easier.

Cheers,
_