Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Beta2 Resource Localization
53 replies. Latest Post by nzeyimana on December 29, 2008.
(1)
tr-jfroman
Member
2 points
12 Posts
06-09-2008 4:37 PM |
I'm trying to get the localization to work within my Silverlight application. I created a resource file along with the other language files (eg: Resource1.resx, Resource1.de-DE.resx, Resource1.fr-FR.resz, etc...). When setting the culture and uiculture using the parameter tags on the page, the numbers and dates change as expected according to the specified language, but when using the resource files to read a string (eg: Resource1.String2), this just uses the default resource file and not the selected language.
This was working in Beta1, but does not work in Beta2. Is there something that has changed or something else I need to do to make this function properly?
Any assistance would be greatly appreciated.
Thank You,Jarred Froman
slyi
Participant
810 points
247 Posts
06-09-2008 4:57 PM |
I had the same issue: http://silverlight.net/forums/p/12709/58722.aspx#5872In the new beta2 the language eg:de folder does not get automatically pushed into the web project SilverlightApplication1Web\ClientBin folder.Even thought it does get generated in the local debug folder eg: SilverlightApplication\bin\debug\de\SilverlightApplication1.resources.dllTo get around this you can: 1. Update the Properties\AppManifest.xml2. Add <AssemblyPart Source="de/SilverlightApplication1.resources.dll" /> into Deployment.Parts section3. In the properties of the SilverlightApplication1, Click build events and in the post build events add xcopy /SY "$(TargetDir)de" "$(SolutionDir)$(ProjectName)Web\ClientBin\de\"4. Click save and re-compile
BTW: How are you doing the string binding, something like below, Im curious to how best to accomplish this?
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de");
InitializeComponent();
private void BindLocResources (object sender, RoutedEventArgs e) {
06-10-2008 12:48 PM |
I gave this a try and it seems to work somewhat. The behovior is very odd as sometimes it only changes the culture sometimes as if there is some sort of timing issue with it. Have you tried it with multiple cultures?
I set up two different ways of switching the culture... 1) Directly through the thread as you have set up above... 2) By causing a Postback and changing the culture param on the object tag of the web page. Each of these produces different results and using different binding methodologies:
The binding that works for #1 is by just setting the value directly similarly to how you do it above: MyString2.Text = Resource1.String2.ToString();
For #2, I managed to be able to get the binding tag and DataContext to work somewhat. I did the following:On the App.xaml.cs, I added in: private static Resource1 _cultureResource = new Resource1(); public static Resource1 CultureResource { get { return _cultureResource; } }Within the Page.xaml.cs, I added in the line to the load: this.DataContext = App.CultureResource;Within the Page.xaml, on the controls that required binding: <TextBlock Text="{Binding String2}" x:Name="MyString2" /> <TextBlock Text="{Binding String3}" x:Name="MyString3" />
These seem to produce erratic results and I'm not quite happy with the way it's functioning. What I'd like to do is just figure out a way to just bind to a static variable using the #2 method without having to instantiate the object in the App class. This to me seems like the way it should be done... however, I can't get it to work. (ie: Text="{Binding String2, Source=Resource1}" ... or something to that effect)
Thanks for your prompt reply and the suggestions... it seems as though while quite a bit of the culture binding has been fixed in Beta2... other functionality now seems to be broken.
-Jarred Froman
06-12-2008 4:54 AM |
Your correct there seems to be some strange bug on resource loading, if you a page refresh 5 times.
I like your method and i was tryng something similar to work for beta1 but had no luck. But setting the Resource file to public, gave me idea if you set the resources as a usercontrol.resource, but Resource1.Designer.cs need a little update from internal Resource1() { to public Resource1() {
This allows
jordanha...
190 points
104 Posts
06-12-2008 5:49 AM |
Can anyone recommend a good application for managing language resource files?
I know Visual Studio can be used to edit the resource files for each individual language, but is there an app that can simplify the proces (i.e. adding new resources to English and ensuring that they are also created for the many other languages your app supports).
06-12-2008 11:29 AM |
That's exactly what I've been looking for... and seems like the logical way to set it up... however, it seems odd that we would have to change the function to public. I wonder if this was intended or if it's a bug. I tried creating a separate class that would inherit off of the Resource file to see if that would work and exposing it as public but while I did manage to get the page to load without error, it wasn't reading the properties.
Something else that occurred to me was that while both of our methods seem to work somewhat, I think there might be something inherently wrong with how it is functioning to begin with. The idea that we are binding to static properties from an object that is instantiated should technically not be allowed and I wonder if that is a flaw within .NET. If you were to try to access one of the static properties from LocStrings on the code-behind, you'll see that the properties aren't exposed and it won't let you compile.
It seems like there is also a bug in the ResourceManager. The refreshing of the page is the same behavior I was experiencing as well.
06-12-2008 11:33 AM |
Hi Jordan,
I am looking for a similar tool for our office as well. I've been hoping that after all these years, that something like this would have already been built into the Resource management tools within Visual Studio.
If you happen to come across something like this, please let me know.
Thanks,-Jarred Froman
06-12-2008 3:20 PM |
This artical helps explain why it doesnt work with multiple dll's but getting difficulties implementing it one xap per locale
http://blogs.msdn.com/webdevtools/archive/2008/06/10/localizing-a-silverlight-application.aspx
06-12-2008 4:00 PM |
Great find!
It's not quite as erratic as it was before, but for some reason, I can only get english (en-US) and french (fr-FR) to work. German (de-DE) won't... Actually, I also found that if I create a separate resource file for en-US rather than using that as the default, it gets stuck on that language. Are you able to get the multiple languages working?
06-15-2008 3:27 PM |
No i still have not managed to get multi lang working, but i have documented what we have found so far on blog post on silverlight localization.
Im getting the feeling multi-lang may not be possible from http://blogs.msdn.com/silverlight_sdk/archive/2008/06/04/what-s-new-in-silverlight-2-beta-2.aspx ? Has anyone got any examples on this?
Localization1. Changes in application model for multilingual apps (one xap per supported locale)
06-16-2008 5:02 AM |
For resx syncing, did you try http://www.screwturn.eu/Default.aspx?Page=ResxSync&AspxAutoDetectCookieSupport=1
06-16-2008 9:37 AM |
According to the MSDN blog post you found earlier, it sounds as if it does allow you to compile multiple cultures into one XAP file:
--------------------------1. In the solution explorer unload the Silverlight project and edit the project file. There is pre-created tag of “SupportedCultures” in the first property group tag. Fill in the culture value of “ja-jp”, so you get “<SupportedCultures>ja-jp</SupportedCultures>”. Note, you can also fill in a culture list separated by “,” or “;” to support multiple cultures/languages in the same xap file. For example you can fill in a string of “ja-JP;fr-FR”. VS reads this list and only packs related satellite assembly folders. --------------------------
Further down the blog also demonstrates how to split them out into multiple XAPs. I have been having a little trouble with the method above however... it seems to allow switching between english and whatever the last language in the list (sorted alphabetically) is supplied. For example, if the list was de-DE;ja-JP;fr-FR... it will only allow you to switch between the default (english) and ja-JP.
I was also trying to find a way to be able to read through the supported cultures. I think Beta1 had a property for this and I think they removed it in Beta2.
BTW, nice find on the command line tool!
eric_del...
181 points
43 Posts
06-17-2008 4:22 PM |
06-18-2008 4:14 AM |
Hi Eric,
Working from both Syli's blog (http://wpf-e.spaces.live.com/blog/cns!2B248D261D0E0035!203.entry) and the one on MSDN (http://blogs.msdn.com/webdevtools/archive/2008/06/10/localizing-a-silverlight-application.aspx) I have managed to get a solution working that seems to support any number of languages.
However I would say it is anything but elegant. If this is what the final release of 2.0 is going to be like then I am going to have to sadly use Flex for my project.
To change between each language (cannot be done whilst in runtime due to One Language Per Xap), I had to change the params as mentioned in Syli's post, and also set a new CultureInfo for the Strings Resrouce in App.xaml.cs.
<param name="culture" value="de" /><param name="uiculture" value="de" />
SilverlightLoc.Resources.Strings.Culture = new CultureInfo("de");
This last line could receive the "de" from QueryString params, App must also be able to read the culture params that are part of the html Object tag, though I haven't looked into it.
MS really needs to sort out this localization mess.
I've added my solution here: http://cid-e0f26f7a54cfc7b0.skydrive.live.com/self.aspx/Documents/SilverlightLoc.zip
06-18-2008 4:17 AM |
this should work: http://cid-e0f26f7a54cfc7b0.skydrive.live.com/self.aspx/Documents/SilverlightLoc.zip
06-18-2008 5:29 AM |
I've been adding the resource binding to my generic.xaml, all seems to work fine until I try to bind to the Header value of a DataGridTextColumn. This crashes the app when the grid is added to the canvas.
<Grid.Resources> <loc:Strings x:Name="LocStrings"/></Grid.Resources>
....
<data:DataGridTextColumn Header="{Binding Market, Source={StaticResource LocStrings}}" DisplayMemberBinding="{Binding Name, Mode=OneWay}" MinWidth="200" />
Anyone else tried to use localization on a DataGrid?
Eric_del...
06-18-2008 8:57 AM |
jordanhammond
06-18-2008 10:06 AM |
I tried changing the order of the EmbeddedResources as you mentioned and didn't have too much luck... actually, the results produced the reverse of what I have been finding. Only two resources from the list still load... however, instead of it selecting the last in the list of other languages (sorted alphabetically), it selects the first in the list.
For those that are still a little confused by what I mean, try adding in these 3 languages... de-DE;fr-FR;ja-JP ... if the default embeddedresource is the last in the list, it allows you to switch between the default (english) and ja-JP. If it's first in the list, default (english) and de-DE. Remove either of those languages from the list and watch what happens. It appears that there is some sort of bug with the way it is loading up the resource files for multiple languages.
06-18-2008 10:11 AM |
I haven't had much luck with setting the culture directly in the resource class. This was working in Beta1 but I'm having trouble with it in Beta2. Regardless, instead of reading the params... you could also do the following:
SilverlightLoc.Resources.Strings.Culture = System.Globalization.CultureInfo.CurrentCulture;
That should at least help you set it a bit more generically. In Beta1, this was automatically selecting that value if it wasn't set... not sure if this is a bug with Beta2 now.
06-18-2008 11:19 AM |
I've pretty much got it all working, the only thing I don't know how to do is the asp.net server controls. I want to use an aspx page rather than html, and I don't know how to create dynamic asp server controls.
Can anyone help with this?
Need the Source property to be dynamic:
<asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/JaXap/SilverlightLoc.xap" MinimumVersion="2.0.30523" Width="100%" Height="100%" />
06-18-2008 12:28 PM |
OK, I RTFM on ASP.NET and found the asp.PlaceHolder. Handy control.
I've updated the same to:
Issues: I don't know how to set the Silverlight control's width & height to 100% with code. See default.aspx, hopefully someone can help out.
The source has been replaced and located here.
06-18-2008 3:21 PM |
Hi Jarred,I found a solution to the erratic resource loading issues with multi language resources, the resource dlls must be in the xap itself and not loose in the clientbin folder. Once they are in the xap, it always loads the correct culture. But it doesnt work when supportcultures values are set. I dont really like creating multiple xap's per culture anyway unless it we were dynamiclly downloading. Heres what i needed to do1. Create a addfiletozip.vbs and add it to the root of your SL projectSet objFSO = CreateObject("Scripting.FileSystemObject")Set objShell = CreateObject("Shell.Application")Set objFolder = objShell.NameSpace(Wscript.arguments(0))objFolder.CopyHere Wscript.arguments(1), &H10&WScript.Sleep 5002. Add <AssemblyPart Source="de/SilverlightApplication1.resources.dll" /><AssemblyPart Source="fr/SilverlightApplication1.resources.dll" /> into Deployment.Parts section in file Properties\AppManifest.xml3. In the properties of the SilverlightApplication1, Click build events and in the post build events add move "$(TargetDir)$(ProjectName).xap" "$(TargetDir)$(ProjectName).zip"cscript /nologo "$(SolutionDir)$(ProjectName)\addfiletozip.vbs" "$(TargetDir)$(ProjectName).zip" "$(TargetDir)de"cscript /nologo "$(SolutionDir)$(ProjectName)\addfiletozip.vbs" "$(TargetDir)$(ProjectName).zip" "$(TargetDir)fr"move "$(TargetDir)$(ProjectName).zip" "$(TargetDir)$(ProjectName).xap"4. Compile and DE resources always load Regardsslyi
06-19-2008 6:01 AM |
Sorry my mistake the culture assemebly's must not in sub-folders but in the root
eg add <AssemblyPart Source="SilverlightApplication1.de.resources.dll" /><AssemblyPart Source="SilverlightApplication1.fr.resources.dll" /> into Deployment.Parts section in file Properties\AppManifest.xml
Sample on http://cid-2b248d261d0e0035.skydrive.live.com/self.aspx/Public/SL-Loc.zip
06-21-2008 2:40 PM |
Hi All,
Ive created a second blog article on how to create a Multi Langauge Silverlight 2.0 Application and string replacement.
I hope this helps.
anandav200
53 points
56 Posts
07-04-2008 7:29 AM |
Hi,
I have been trying Slyi methods forDanish. I created Strings.da.resx and did the methods as said in his blog. But when i click the button for Danish resource it loads English resource..Please help me to fix this
07-04-2008 12:02 PM |
I get no error on Danish. See sample http://cid-2b248d261d0e0035.skydrive.live.com/self.aspx/Public/danish.zip
Please remember to use da-dk or just da rather than da-da for CultureInfo
07-07-2008 1:55 AM |
Hello Slyi,
Thanks for your reply..Your sample is working for me..But mine still doesnt work despite any changes...
Please download the sample from the below link and plz let me know where i went wrong...
http://www.yuntaa.com/FileManager/Download.aspx?ContentID=5169A427EB17551CE04400144FB7B71E
Regards,
Anand
07-07-2008 5:21 AM |
You are missing the reference to your danish dll in Properties\AppManifest.xml. Please review http://wpf-e.spaces.live.com/blog/cns!2B248D261D0E0035!230.entry . This is only an issue for beta 2 this will be fixed in a later release.
eg:
<
</
07-07-2008 6:01 AM |
Thanks for your support. It still didnt work for me. Once i change the xml adding
<AssemblyPart Source="SilverlightApplication8.da.resources.dll" />
and rebuilding again it disappeared. I am using notepad to edit it.
Thi is my current manifest file. Also i am attaching the build output. Please let me know whether i went wrong.
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="SilverlightApplication8" EntryPointType="SilverlightApplication8.App" RuntimeVersion="2.0.30523.6"> <Deployment.Parts> <AssemblyPart x:Name="SilverlightApplication8" Source="SilverlightApplication8.dll" /> <AssemblyPart Source="SilverlightApplication8.de.resources.dll" /> <AssemblyPart Source="SilverlightApplication8.fr.resources.dll" /> <AssemblyPart Source="SilverlightApplication8.ja.resources.dll" /> </Deployment.Parts></Deployment>
------ Rebuild All started: Project: SilverlightApplication8, Configuration: Debug Any CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE;SILVERLIGHT /reference:"C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies\mscorlib.dll" /reference:"C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies\System.Core.dll" /reference:"C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies\system.dll" /reference:"C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies\System.Net.dll" /reference:"C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies\System.Windows.Browser.dll" /reference:"C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies\System.Windows.dll" /reference:"C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies\System.Xml.dll" /debug+ /debug:full /optimize- /out:obj\Debug\SilverlightApplication8.dll /resource:obj\Debug\SilverlightApplication8.g.resources /resource:obj\Debug\SilverlightApplication8.Strings.resources /target:library App.xaml.cs convertor.cs Page.xaml.cs Properties\AssemblyInfo.cs Strings.Designer.cs C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\obj\Debug\App.g.cs C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\obj\Debug\Page.g.cs
Compile complete -- 0 errors, 0 warnings
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\AL.exe /culture:da /out:obj\Debug\da\SilverlightApplication8.resources.dll /template:obj\Debug\SilverlightApplication8.dll /embed:obj\Debug\SilverlightApplication8.Strings.da.resources
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\AL.exe /culture:ja /out:obj\Debug\ja\SilverlightApplication8.resources.dll /template:obj\Debug\SilverlightApplication8.dll /embed:obj\Debug\SilverlightApplication8.Strings.ja.resources
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\AL.exe /culture:fr /out:obj\Debug\fr\SilverlightApplication8.resources.dll /template:obj\Debug\SilverlightApplication8.dll /embed:obj\Debug\SilverlightApplication8.Strings.fr.resources
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\AL.exe /culture:de /out:obj\Debug\de\SilverlightApplication8.resources.dll /template:obj\Debug\SilverlightApplication8.dll /embed:obj\Debug\SilverlightApplication8.Strings.de.resources
SilverlightApplication8 -> C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\Bin\Debug\SilverlightApplication8.dll
Begin application manifest generation
Application manifest generation completed successfully
Begin Xap packaging
Packaging SilverlightApplication8.dll
Packaging AppManifest.xaml
Xap packaging completed successfully
Creating test page
Test page created successfully
move "C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\Bin\Debug\SilverlightApplication8.xap" "C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\Bin\Debug\SilverlightApplication8.zip"
for %%i in (de fr ja da) do (
move "C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\Bin\Debug\%%i\SilverlightApplication8.resources.dll" "C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\Bin\Debug\SilverlightApplication8.%%i.resources.dll"
cscript /nologo "C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\addfiletozip.vbs" "C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\Bin\Debug\SilverlightApplication8.zip" "C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\Bin\Debug\SilverlightApplication8.%%i.resources.dll"
)
move "C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\Bin\Debug\SilverlightApplication8.zip" "C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\Bin\Debug\SilverlightApplication8.xap"
------ Rebuild All started: Project: C:\...\SilverlightApplication8Web\, Configuration: Debug .NET ------
Validating Web Site
Building directory '/SilverlightApplication8Web/'.
Validation Complete
========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========
07-07-2008 6:25 AM |
Your properties\appmanifest.xaml still doesnt contain a reference to the DA dll, you need to add the line, like i stated in my previous reply.
If you are see a blank screen please set SilverlightApplication8TestPage.html as start page
http://blufiles.storage.live.com/y1pm4rBe-tLaoJOWdI9Fn7AuRnzhzXK4zPyD4zVSMWHqaPag_ydDRS7FkOxnn4_Rsxd
07-07-2008 6:33 AM |
I did that. But on next build it disappeared from appmanifest.xaml that is located on SL-Multi-Loc\SilverlightApplication8\Bin\Debug folder and the Danish resx is not working
Thanks for your support.
07-07-2008 9:04 AM |
Please edit the file inside your Visual studio project not externally, but i dont how this makes a difference. eg: C:\_WorkArea\Study\SilverLight\SL-Multi-Loc\SilverlightApplication8\properties\appmanifest.xml
Also i have updated that one line in http://cid-2b248d261d0e0035.skydrive.live.com/self.aspx/Public/da.zip to show it works.
07-07-2008 12:14 PM |
I like the idea of changing the localization on the fly, however have you tried to do this in a solution where a controls library is in a separate project, which is downloaded by the initial app?
Also what about downloading language resource strings on demand before using?
07-07-2008 1:01 PM |
Exactly, this will be my next blog article as a just said on http://silverlight.net/forums/t/19929.aspx, as the app size could grow unscalable, if you 20 languages each with a 1000 strings. I should have something available this weekend on http://wpf-e.spaces.live.com/
What im thinking is packaging the generated dll's into a xap as a post build event, rather than seperate projects per culture dll, and then using the on demand library functionality http://msdn.microsoft.com/en-us/library/cc296243(VS.95).aspx to download and create a new instance of the usercontrol once you select a different language in the listbox.
Have you had issues trying this method?
07-07-2008 1:08 PM |
I'm only looking at it now. Though I have issues with assigning the culture of a controls dll that is not part of the main app. It downloads whilst the login screen is shown, then once downloaded I try to set the culture but it doesn't pick it up. The control library has its own string resources, this could be what's going wrong.
07-08-2008 3:33 AM |
Thanks Slyi..I got it working..
But i have all my usercontrols in SIlverLight Class Library which i am refering in SL application. I am planning to implement one resx per xaml control .(If i create a usercontrol FilterBox.xaml my plan is to create FilterBoxResource.da.resx for Danish). How is it possible?
07-08-2008 4:23 AM |
Hi Slyi, I tried applying your post build script to a new project - to test the multi language xap (http://wpf-e.spaces.live.com/blog/cns!2B248D261D0E0035!230.entry) and the vbs file keeps throwing an error: "The compressed (Zipped) folder is invalid or corrupted."
Have you seen this before?
I put a MsgBox in the vbs to show the arguments and they're correct. I am using Vista.
Simbalight
245 points
87 Posts
07-08-2008 4:40 AM |
Hi!
I've recognized that sometimes the xap's zip archive is not fully compatible with windows "zip compressed folder". I suppose this is the same issue. Try to open the zip (xap) file with explorer (and the zip compressed folder dll). It will work. But then try to remove a file or add one manually. It will fail.
A possible solution could be to use another tool to copy the file into the archive. Thus you must change the script Slyi provided.
Hope that helps!
07-08-2008 5:02 AM |
thanks, not worth the effort, I don't really need multi-language xaps. more important to be able to load the language resource dynamically.
07-08-2008 7:41 AM |
I'll have a post ready for the weekend using dyncmically creating the culture xaps using post build events, but the ondemand loading works see crude sample at http://cid-2b248d261d0e0035.skydrive.live.com/self.aspx/Public/ondemand.zip
For the folks having issues with the zip/xaps vbs script. Can you confirm if have some other zip technolgy installed (i dont) eg: winzip, winrar etc... which may interfere with windows zip compression, also is the issues happening on win2k3 or Vista 64 or any other non standard config?
07-08-2008 8:13 AM |
thanks slyi, will have a look at the sample.
I have 7zip intalled.
07-08-2008 8:27 AM |
I think that the zip/xap problem is independent of additional zip tools. Please check this xap http://www.vortexeu.com/simba/SL2_B2_LocTest.xap.
It is exactly as it was emitted by VS2008. I cannot erase any file using the windows "zip compressed folder". Can you reproduce the issue on your system?
07-08-2008 4:04 PM |
Your correct, i cant add or delete to that compressed folder either.
Try setting the timeout WScript.Sleep 500 to 5 seconds eg: WScript.Sleep 5000, to give extra time to add the file to the compressed folder in the VB Script also try using a different compression tool eg: winzip
Can you tell if your using a german OS or Visual Studio ?
07-09-2008 2:21 AM |
My manual tests with WinZip do work.
It's VS2008 Pro, WinXP Pro and SL2B2 Tollkit for VS2008, all german versions.
07-09-2008 5:12 AM |
I'm pretty sure people from MS are following this thread. I would really like to know how localization is going to be fixed for RTM. What to do till then? Use Slyi's "Friend-to-Public-Hack"? How can we minimize the necessary changes for RTM?
bPlaTyPuS
1 Posts
07-09-2008 6:11 AM |
Hi everyone!
When I try your solutions, I have always the same problem -> it doesn't work in Blend... (it's only displaying an error in Blend :
"The DependencyProperty target is invalid: myProject.Strings"
Do you have an idea how to solve this ?
Thx for help!
andrevie...
6 points
3 Posts
07-09-2008 3:30 PM |
hello
i started adding multilanguage support to my silverlight 2 beta 2 application today. i am using different resx files as usual (.pt-BR.resx, .fr-FR.resx, etc) in other applications i write, and it works fine.
I tryed the same thing with the silverlight app, but i started getting the errors related in this post (only the default language, in my case, loads). I've searched the web and found:
- 1 post (http://wpf-e.spaces.live.com/blog/cns!2B248D261D0E0035!230.entry) telling that this is some sort of bug that will be fixed in final version;
- another post (http://blogs.msdn.com/webdevtools/archive/2008/06/10/localizing-a-silverlight-application.aspx) telling that this is [the new Silverlight runtime localization model, which essentially is “one language, one xap”.];
- this discussion with a few alternatives to have multilanguage silverlight 2 application.
The silverlight app i'm writing is only a small part of a bigger project, and i'm still 6 months way from "releasing it in the world", so trying all of these approaches to find out that this problem will be fixed in RTM would be a waist of time.
My question is "who is right"? The guy telling that this is a known bug that will be fixed or the other one telling that this is the new runtime localization model (aka microsoft's new way of spending developer's time)?
Thanks
roshvall...
07-21-2008 4:09 AM |
i'm able to bind page with multiple resource check my blog http://roshworldoftechnologies.blogspot.com/2008/07/multiple-resource-support-in.html
08-19-2008 3:43 AM |
Thanks Rosh for your post
But i have all my usercontrols in SIlverLight Class Library which i am refering in SL application. I am planning to implement one resx per xaml control .(If i create a usercontrol FilterBox.xaml my plan is to create FilterBoxResource.da.resx for Danish). How is it possible to use the resource file fro danish when my culture is Danish?
Regards,Anand
08-19-2008 3:48 AM |
anandav200:But i have all my usercontrols in SIlverLight Class Library which i am refering in SL application. I am planning to implement one resx per xaml control .(If i create a usercontrol FilterBox.xaml my plan is to create FilterBoxResource.da.resx for Danish). How is it possible to use the resource file fro danish when my culture is Danish?
If all your controls are in one class library, why don't you put all the xaml in one file - generic.xaml. By creating language resource files per control would imply that you would also want to have each control in its own library, downloaded only as when needed.
08-19-2008 7:19 AM |
jordanhammond:If all your controls are in one class library, why don't you put all the xaml in one file - generic.xaml.
Could you please tell me how i can implement that
08-19-2008 7:52 AM |
anandav200:Could you please tell me how i can implement that
I've created a very basic sample of a project that utilises generic.xaml.
Available here
10-03-2008 3:40 AM |
Hi Guys,
I would like to know how we can implement multiple localisation on SilverLight Class Library.
My scenario is like this.
1. SL class libraray having controls that can be reused in the silverlight application. These controls need to load resources either in Danish or in English based on the CultureInfo.
For eg. By default the Content of Button is Browse. But if the user culture info is Dnaish i need to load the content in Danish that is stored in MyUserControl.da.resources. Default need to be loaded from MyUserControl.resources.
2. The complied SL class libraray dlls will be used in SL application
Any help will be appreciated...
nzeyimana
12-29-2008 10:47 PM |
Hello, I have an free web-application at http://www.sprakor.com that helps me in localizing applications. Try it and your comments are welcome