开发者

How to load qt linguist dynamically changed label text

开发者 https://www.devze.com 2023-02-03 14:39 出处:网络
In my project i\'m trying touse qt linguist. When i change thelanguage fr开发者_C百科om English to Turkish,it is working all constantlabel.

In my project i'm trying to use qt linguist. When i change the language fr开发者_C百科om English to Turkish, it is working all constant label.

But some labels i m loading them dynamically according to scenario of use cases.

Whatever i do with qt linguist, it doest workthe texts of these label.

How can i get rid of this problem?

Any help will be apprecialted


Qt has a guide to internationalization, which includes the basic information: to wrap your string in a tr function call.

label->setText( tr( "Hello, World!" ) );

In addition to this, if you want the language to change on the fly, you'll need to identify when the context has changed, and update your labels appropriately. Unfortunately, I can't easily put my hands on the signal that indicates when to do so.

0

精彩评论

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