通用应用中的多语言支持 [英] Multiple language support in Universal App

查看:99
本文介绍了通用应用中的多语言支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这不是有关标准本地化的问题-我知道如何对应用程序进行本地化,使用资源,Uid的资源等等,这很完美.

This is not a question about standard localization - I know how to localize the app, use resources, Uid's and so on - this works perfectly.

问题在于该应用程序位于捆绑包中,因此,当用户安装该应用程序时,它仅涵盖在设备/电话设置中选择的语言.但我想在设置中提供一个选项,允许选择有关设置的语言.为此,我可以使用 ApplicationLanguages.PrimaryLanguageOverride ,在通过VS部署时效果非常好,但是正如我已经提到的那样-存储库中的版本缺少资源,因为未安装所有资源.

The problem is that the app comes within a bundle, therefore when the user installs the app it covers only languages that are selected in device/phone settings. But I would like to provide an option in settings that would allow choosing a language regarding the settings. For this purpose, I can use ApplicationLanguages.PrimaryLanguageOverride, which works very nice when deployed via VS, but as I've mentioned - version from the store lacks resources, as not all are installed.

有人知道如何绕过这种捆绑行为吗?

Does anybody know how to bypass this bundle behavior?

问题还在于我正在使用MAT(多语言应用程序工具包),而我的翻译随附了 xliff 文件.我花了很多时间来找到一种将它们转换为 resw 文件的方法,但没有成功.有什么方法可以做到(或者我必须编写自己的转换器)?

The problem is also that I'm using MAT (multilingual app toolkit) and my translation comes with xliff files. I've spent quite a lot of time to find a way to convert them to resw files, without success. Is there any way to do it (or I've to write my own converter)?

推荐答案

查看以下内容:

Check out this: UWP: Resource file for languages is not deployed correctly you need to get rid of bundle in order for my code from above to work. Or you could check if chosen language is installed in OS and if not you could not allow user to choose it using:

Windows.System.UserProfile.GlobalizationPreferences.Languages

这篇关于通用应用中的多语言支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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