我想使用卫星组件来本地化我的windows phone 7应用程序。我已经建立卫星组件部署
(al /t:lib /embed:stringlibrary.it-It.resx /culture:it /out:PhoneApp2.resources.dll /template:PhoneApp2.dll)
从资源文件stringlibrary.it-It.resx
,然后我的应用程序PhoneApp2一个DLL“PhoneApp2.resources.dll”我下载的dll 使用Web客户端和存储在目录它,它的应用PhoneApp2。现在该DLL驻留在phoneapp2的独立存储中。
我有另一个资源文件stringlibrary.resx,它总是与应用程序一起编译,并有英文支持条目(默认)。
using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream("it-IT\\"+resfile, System.IO.FileMode.Create, file))
{
byte[] buffer = new byte[1024];
while (e.Result.Read(buffer, 0, buffer.Length) > 0)
{
stream.Write(buffer, 0, buffer.Length);
}
}
我有项[装配:NeutralResourcesLanguageAttribute( “IT-IT”,UltimateResourceFallbackLocation.Satellite)汇编文件中。
即使当前的语言和文化是意大利语,它始终会在Messagebox中向我显示中性语言文本(英语)。 这意味着它无法找到卫星组件。
rm = new ResourceManager("PhoneApp2.stringlibrary", Assembly.GetExecutingAssembly());
string greeting = rm.GetString("String1");
MessageBox.Show(greeting);
但是,如果我编译stringlibrary.it-It.resx
与PhoneApp2代替卫星组件,在MessageBox正确 显示意大利文本时培养是意大利语和英语为英语百家姓。我在部署卫星组件时错过了什么?请让我知道。
问候, 塞特希
感谢您的信息。我已经完成了你所描述的任何步骤,并且它工作正常。但是现在我想给用户下载dll(资源文件)的选项,以便只有几组DLL。我这样做是为了尽量减少.xap文件的大小。 – Senthil
您所描述的过程和我已经完成的过程将始终包含所有的DLL。但我想有设置按钮,用户可以在其中选择文化,只有那些DLL将从Web服务器下载并存储在应用程序的独立存储中,按照[assembly:NeutralResourcesLanguageAttribute(“it-IT”,UltimateResourceFallbackLocation卫星)。 – Senthil
这将查找意大利语言资源文件的IT目录。希望我已经说清楚了,因为我想要做 – Senthil