开发者

language translation using variable

开发者 https://www.devze.com 2023-02-18 17:46 出处:网络
i need to have language translation to user entered text(dynamic property). mean to say in my custom widget i provide one dynamic prope开发者_如何学Gorty to select language from list of languages an

i need to have language translation to user entered text(dynamic property).

mean to say in my custom widget i provide one dynamic prope开发者_如何学Gorty to select language from list of languages and one more dynamic property to enter text.

say for example user enters some text and selects language "dutch" that particular string should be translated to dutch.

i have achieved language translation of static string ( mean to say i have directly entered text in tr() with out dynamic property to enter text).

so can some one suggest me how do i achieve the same with dynamic property ( dynamic property with respect to text). "is there any way to set language for strings not enclosed in tr()"

thanks in advance for any help.


You can use QTranslator. But it shouldn't translate any string, only string it is able to find in a translation file. Translation files are created using Qt Linguist.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号