简体   繁体   English

WP7应用中的部分本地化识别

[英]Partial localization recognition in WP7 app

I've been working on the localisations of a WP7 app and although most of the languages appear to operate as expected at runtime I'm having trouble with a few. 我一直在研究WP7应用程序的本地化,尽管大多数语言在运行时似乎都能按预期运行,但我遇到了一些麻烦。

For example, Russian, Polish, Swedish, Norwegian, Portuguese and Hungarian don't appear to be working but both Traditional & Simplified Chinese, Greek and Danish do (there are other languages which also work). 例如,俄语,波兰语,瑞典语,挪威语,葡萄牙语和匈牙利语似乎没有用,但是繁体中文和简体中文,希腊语和丹麦语都可以使用(其他语言也可以使用)。

The app's neutral culture is set to "en", although I also tried "en-GB" originally. 该应用程序的中性文化设置为“ en”,尽管我最初也尝试过“ en-GB”。

I'm sure it's something to do with culture codes as I can't find any reference to similar problems with partial language support anywhere. 我确定这与文化代码有关,因为我在任何地方都找不到对部分语言支持的类似问题的参考。

I've enabled the following cultures within the project file itself: 我在项目文件本身中启用了以下区域性:

<SupportedCultures>en;da-DK;de-DE;el-GR;es;es-ES;de-DE;fr;fr-FR;it-IT;zh-TW;zh-CN;hu-HU;no;nb-NO;pt-PT;pl-PL;ru;ru-RU;sv-SE;</SupportedCultures>

In that list, everything up to Hungarian seems to be fine. 在该列表中,匈牙利语之前的一切似乎都不错。 I've also tried adding short culture codes and duplicating resource files accordingly (eg Russian and Spanish) in case I'd got it completely wrong, but even the MSDN documentation seems to indicate that all the above are supported on WP7.1. 我还尝试添加简短的区域性代码并相应地复制资源文件(例如俄语和西班牙语),以防万一我完全错了,但是即使MSDN文档似乎也表明WP7.1支持上述所有功能。

Example use of resource in XAML: 在XAML中使用资源的示例:

<TextBlock Text="{Binding Path=LocalisedResources.res_Name, 
    Source={StaticResource LocalisedStrings}}" />

Happy to provide more detail on the implementation to assist answers but I'm sure it's just something simple I've missed (ie PEBKAC). 很高兴提供有关实现的更多详细信息以帮助解答,但我敢肯定,这只是我想念的简单事情(即PEBKAC)。 I've checked that all the resource files have the same attributes, correct spelling eg Resource\\Resources.hu-HU.resx, Public modifiers and only contain string resources. 我检查了所有资源文件的属性是否相同,拼写正确,例如Resource \\ Resources.hu-HU.resx,Public修饰符,并且仅包含字符串资源。

Using VS2010, WP OS 7.1 and the standard emulator to check & test. 使用VS2010,WP OS 7.1和标准仿真器进行检查和测试。

Has anyone encountered anything similar, or know of any steps to try and resolve? 有没有人遇到过类似的事情,或者知道要尝试解决的任何步骤?

Thanks 谢谢

Fixed it. 修复。

Not 100% sure what the problem was but cleaned / deleted bin folder content manually / rebuilt solution and it's working in all languages. 并非100%确认问题出在什么地方,而是手动清除/删除了bin文件夹内容/重新构建了解决方案,并且该解决方案在所有语言中均有效。

It looks like something got caught between builds and was not correctly deployed during emulator testing but I can't see anything in the build output or output console to indicate exactly what that was. 看起来有些东西在构建之间被夹住了,并且在模拟器测试期间没有正确部署,但是我在构建输出或输出控制台中看不到任何东西来确切地表明是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM