在GTK中,如何在运行时更改UI上的本地化语言文本? [英] In GTK, how do I change the localized language text on the UI while it's running?

查看:66
本文介绍了在GTK中,如何在运行时更改UI上的本地化语言文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux中,是否可以即时更改使用GTK创建的UI语言?我有一个需要即时更改UI语言的应用程序.

In Linux, is it possible to change the UI language on the fly which is created using GTK? I have a application which needs to change UI language on the fly.

推荐答案

您将不得不销毁所有小部件并使用新的语言环境设置对其进行重建,或者手动将所有字符串更改为其翻译后的等效字符串.最好使用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.

这篇关于在GTK中,如何在运行时更改UI上的本地化语言文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆