更改应用程序语言设置时刷新UI [英] Refresh UI while changing application language settings
问题描述
嗨
我正在使用资源文件来构建支持多种语言的应用程序.默认情况下,语言为英语
i am using resource files for building an app that supports multiple languages. By default the language is english
我分配了标签文本,例如
and i assign the label text like
<标签保证金="12,12,3,5"; Name ="label1" Content =" {x:Static local:WindowStaticText.NameLabel}" Grid.Row ="0" Grid.Column ="0"/>
<Label Margin="12,12,3,5" Name="label1" Content="{x:Static local:WindowStaticText.NameLabel}" Grid.Row="0" Grid.Column="0"/>
在页面上菜单项的click事件上,i 将语言从英语更改为"ur-PK".而且我想更改应用程序标签文本以进行重置.
On the click event of the menu item on the page, i change the language from English to "ur-PK". And i want to change the application label texts to reset .
但是似乎不能用新的语言文本刷新用户界面.我该如何实现?
But it seems to be not refresh the UI with new language text.How can i achieve this?
我使用代码
System.Threading.Thread.CurrentThread.CurrentUICulture =新的System.Globalization.CultureInfo("ur-PK");
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ur-PK");
改变语言文化.
执行此代码后,如何基于新语言刷新应用程序UI
Once this code is executed how can we refresh application UI based on the new languages
推荐答案
FullPgmr ,
FullPgmr,
Please see this for fixing internationalization and here and what is suggested by Olaf Rabbachin
对我有用,希望对您有用.
It works for me, hope it works for you.
这篇关于更改应用程序语言设置时刷新UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!