且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在GTK中,如何在运行时更改UI上的本地化语言文本?

更新时间:2023-01-13 11:18:27

您将不得不销毁所有小部件并使用新的语言环境设置对其进行重建,或者手动将所有字符串更改为其翻译后的等效字符串.***使用gettext做到这一点.

You'll have to either destroy all your widgets and rebuild them with the new locale setting, or manually change all the strings to their translated equivalents. It is best to do this with gettext.

许多应用程序选择不为应用程序内部的UI语言提供设置.相反,他们只是遵循系统语言设置.

Many applications choose not to offer a setting for the UI language inside the application. Instead, they just follow the system language setting.