-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
咨询一下:后端动态的文字,如果做到切语言的时候自动刷新呢? #3
Comments
在UpdateCulture前,自己做一个全局事件,手动去更新相应的控件. class YourManager{
public static event LanguageChanged{ge;set;}
static Change(string culture){
LanguageChanged();
LanService.UpdateCulture(culture);
}
}
YourManger.LanguageChanged+=Changed();
void Changed(){
text.Value=LanService.Get("Key");
} 手打的,仅供参考 |
嗯嗯,我也是这么想的,在想您有没有更好的方法~ 谢谢! 另外:我看demo里没有用户控件的例子,只有一个用户控件的说明。 我先验证一下,有问题的话再具体问您! |
我有个想法,是关于换皮肤的,也是用您切换语言这一套方案。 (做这套方案的初衷:平台有皮肤库,产品线直接引用,支持产品线修改(指定文件夹加同名文件,则覆盖平台对应文件)和扩展(指定文件夹加新文件)) 这个方案整体应该是可行的,但是看到切换多语言的代码注释说可能有性能问题,所以想咨询一下就您的经验来看,从性能方面来说,这种切皮肤的方案,有没有可行性,性能会不会非常差呀? 一套模板,切皮肤相当于把所有图片文件地址及时翻译一下,重新动态绑定。 |
一般小项目可以不纠结这点性能开销,好用就行了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
例如: 前端控件绑定了 Model的 异常信息字段 Msg,这个Msg是动态获取的(如下):
Key: exception1 zh: 超高温 en: Ultra high temperature
Key: exception2 zh: 超低温 en: Ultra Low temperature
这种需求怎么通过这种方式绑定,并且在切换语言的时候自动更新呢?
The text was updated successfully, but these errors were encountered: