如何在 Windows Phone 8 中本地化文件 [英] How to localize files in Windows Phone 8

查看:30
本文介绍了如何在 Windows Phone 8 中本地化文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在 AppResources 中为每种语言添加键/值对,然后在绑定中轻松使用它.但是对于用自己的脚本编写的每种语言,我在单独的 XML 文件中有一长串国家名称.

We add key/value pairs in AppResources for each language then easily use it in binding. But I have a long list of names of countries in a separate XML file for each language written in its own script.

现在,我如何将法语 XML 文件用于法语而将英语文件用于英语?

Now, how can I use for french the french XML file and for english the english one?

(回答接下来的问题:你试过什么或者你的代码在哪里?",事实上我在开始所以没有代码,但我搜索但没有找到任何结果,个人,对不起!)

(Answer to the coming question: "what have you tried or where is your code?", infact I'm at the beginning so no code, but I searched but didn't find any result, personally, sorry!)

推荐答案

首先,为什么不直接将该 XML 文件转换为 rex 文件,然后使用标准的本地化 API?

First, why not just convert that XML file to a rex file and then use the standard localization APIs?

否则,您可以向应用程序添加一个可本地化的字符串,该字符串是 XML 文件的文件路径.这样,您就可以使用标准的 ResourceManager 来获取路径,然后使用您的自定义解析来处理它.

Failing that, you could add a localizable string to your application that is the file path to the XML file. That way, you use the standard ResourceManager to get the path and then handle it using your custom parsing.

这篇关于如何在 Windows Phone 8 中本地化文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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