Skip to main content

Microsoft Silverlight

Unanswered Question How to localize Silverlight 2.0RSS Feed

(0)

filuna
filuna

Member

Member

10 points

10 Posts

How to localize Silverlight 2.0

Hi, I'm looking for the way how to localize my Silverlight application - I mean how to store Labels etc in resource files and use them to change the language of the GUI. I looked over the internet, but I haven't found anything. I tried to use the resx files but without succes. But the System.Resources namaespace is included in Silverlight framework, so I think it should be possible to solve. Could you help please. Thanks.

Filuna

Filip Mateasko
DHI, Prague, Czech

Sergey Volk MSFT
Sergey V...

Participant

Participant

788 points

98 Posts

Microsoft

Re: How to localize Silverlight 2.0

Hi,

I believe you should be able to use System.Resources.ResourceManager class to pull localized strings / images / etc from resx files, much like in regular .NET framework. Have you encountered any problems with that? If so, can you please describe what you are doing, and what is not going as expected?

If this answers your question, please click on "Mark as Answer" on this post.

filuna
filuna

Member

Member

10 points

10 Posts

Re: How to localize Silverlight 2.0

Hi, I also think I should be able to do that by this way, however I don't know how. In VS 2008 I created a Silverlight simple test app with only one TextBlock which I want to change according the culture. It works normaly of course. The I click add new file -> resources file and I select to built it as embedded resource, then when I run the app, the app is frozen. If I select to built it only as resource then it's not found. I'm not not experienced too much with localization, I have used it only once in WinForm app and there it worked fine (as embedded resource). I probably do something wrong, but I havent found any tutorial or example of using resx files in silverlight. Don't you have some simple sample ? Or how the resources should be built ?

Thanks a lot 

My TestAPP:

XAML:

<UserControl x:Class="TestLocal.Page"

xmlns="http://schemas.microsoft.com/client/2007"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Width="400" Height="300">

<Grid x:Name="LayoutRoot" Background="White">

<Grid.ColumnDefinitions >

<ColumnDefinition />

</Grid.ColumnDefinitions>

<TextBlock x:Name="txtText" Grid.Column="0" >AAA</TextBlock>

</Grid>

</UserControl>

 

CODEBEHIND:

Imports System.Resources

Partial Public Class Page

Inherits UserControl

Public Sub New()

InitializeComponent()

End Sub

Private Sub Page_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded

Dim rs As New ResourceManager("TestLocal.Texts", System.Reflection.Assembly.GetExecutingAssembly)

txtText.Text = rs.GetString("Test")

End Sub

End Class

 

Aplication root namespace is TestLocal

There are 2 resx files: Texts.cs-CZ.resx and Texts.resx

Both resx settings:

Built:Embedded resource

Copy to out dir: Always

Custom tool:

Custom tool namaspace:

 

 

 

Filip Mateasko
DHI, Prague, Czech

filuna
filuna

Member

Member

10 points

10 Posts

Re: How to localize Silverlight 2.0

Hi, I also think I should be able to do that by this way, however I don't know how. In VS 2008 I created a Silverlight simple test app with only one TextBlock which I want to change according the culture. It works normaly of course. The I click add new file -> resources file and I select to built it as embedded resource, then when I run the app, the app is frozen. If I select to built it only as resource then it's not found. I'm not not experienced too much with localization, I have used it only once in WinForm app and there it worked fine (as embedded resource). I probably do something wrong, but I havent found any tutorial or example of using resx files in silverlight. Don't you have some simple sample ? Or how the resources should be built ?

Thanks a lot 

My TestAPP:

XAML:

<UserControl x:Class="TestLocal.Page"

xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Width="400" Height="300">

<Grid x:Name="LayoutRoot" Background="White">

<Grid.ColumnDefinitions >

<ColumnDefinition />

</Grid.ColumnDefinitions>

<TextBlock x:Name="txtText" Grid.Column="0" >AAA</TextBlock>

</Grid>

</UserControl>

 

CODEBEHIND:

Imports System.Resources

Partial Public Class Page

Inherits UserControl

Public Sub New()

InitializeComponent()

End Sub

Private Sub Page_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded

Dim rs As New ResourceManager("TestLocal.Texts", System.Reflection.Assembly.GetExecutingAssembly)

txtText.Text = rs.GetString("Test") End Sub

End Class

 

Aplication root namespace is TestLocal

There are 2 resx files: Texts.cs-CZ.resx and Texts.resx

Both resx settings:

Built:Embedded resource

Copy to out dir: Always

Custom tool:

Custom tool namaspace:

 

 

 

Filip Mateasko
DHI, Prague, Czech

Yi-Lun Luo - MSFT
Yi-Lun L...

All-Star

All-Star

25052 points

2,747 Posts

Re: Re: How to localize Silverlight 2.0

After you create a resx file, you'll have a class such as Resource1. You can find this class under Resource1.Designer.cs. All strings you put in the string table will become static properties of this class. So you can simply write something like this:

textBlock1.Text = Resource1.YourString;

shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.

filuna
filuna

Member

Member

10 points

10 Posts

Re: Re: How to localize Silverlight 2.0

Hi,
I'm afraid I don't understand - I would like to specify several culture specific resources - so according the resx concept (if I undestand it well) they should be named for ex. Resource.resx, Resource.cs-CZ.resx, Resource.de-DE.resx etc. However first problem occures when I create cs-CZ.resx in the project (at this moment I only create the file, I don't use it in appliction) Then the application doesn't run (there is still the SIlverlight loading animated picture with 100% and rotating grey circles). If I create cz-CZ then it runs, but this locale name is wrong!
 
Next: when I create for ex. Texts.resx, then you are true - there is a class which can be used. However if I try to add new localized resx file, for ex. Texts.sk-SK.resx, then I
1) must maually set the Custom Tool to be ResXFileCodeGenerator to generate Designer.vb
2) no code is generated for it - it's empty
 
Maybe I have to specify more clearly: What I need is to have localized resouces for several languages, then somehow set the CurrentCulture and finaly get completely localized UI.

Filip Mateasko
DHI, Prague, Czech

Sergey Volk MSFT
Sergey V...

Participant

Participant

788 points

98 Posts

Microsoft

Re: Re: How to localize Silverlight 2.0

Hi,

Ok, I see. You are doing almost everything right, need only a few minor corrections:

First of all, you don't need to modify resx file properties. Visual Studio sets up it's settings automatically once you add new resx file to your project. So just leave resx property at their default values (e.g. Texts.resx - Build action: Embedded resource / Copy to output: Don't copy / Custom tool: ResXFileGenerator, Texts.cs-CZ.resx - action: Embedded resource / Copy to output: Don't copy / Custom tool: <empty>). You don't need to specify ResXFileCodeGenerator for each <cs-CZ, de-DE, sk-SK, etc> file, it will be automatically set for Texts.resx and you can use that class to retrieve localized resources for each of the cultures. It will automatically return resources for the current culture (see below how to set current culture for SL). You can use ResourceManager if you need more flexibility (e.g. if you want to be able to retrieve culture-neutral resources, or resources for cultures besides current).

Second, you are hitting known issue with Beta 1. Common controls shipped in Beta 1 are not localizable (and unfortunately there is no proper error message about that - but hey, don't forget, this is just beta 1). Looks like in your case SL runtime tries to locate localized versions of these control assemblies.  So if you see your application hanging with displaying download animation at 100%, you could try to remove references to System.Windows.Controls and System.Windows.Controls.Extended from your project (and I mean remove all references to these assemblies, not just remove "using System.Windows.Control" - make sure that you have no System.Windows.Controls.dll in your XAP file and there is no entry for System.Windows.Controls assemblies in your AppManifest.xaml files).

And finally, you need to add <param name="culture" value="cs-CZ" /> to <object> tag in your HTML page. This will set current culture for your SL application, so that when you get a string, it will look for localized version of the string automatically. Looks like currently you will be able to retrieve only resources for neutral culture and your current culture specified in <object> tag (btw, you can also specify <param name="culture" value="auto" /> to set SL current culture to current OS regional settings) - perhaps this is also beta limitation. As far as I know, SL localization model will be slightly changed after Beta 1 (nothing groundbreaking, but still it may break some things), so don't invest too much time into localizing your SL apps just yet.

Hope this helps.

If this answers your question, please click on "Mark as Answer" on this post.

filuna
filuna

Member

Member

10 points

10 Posts

Re: Re: How to localize Silverlight 2.0

Hi Sergey,thanks a lot for your answer ! - as I see it, I should wait with the localization issues for the full version. Do you know when it could be out ?

F.

Filip Mateasko
DHI, Prague, Czech

Sergey Volk MSFT
Sergey V...

Participant

Participant

788 points

98 Posts

Microsoft

Re: Re: How to localize Silverlight 2.0

Hi Filuna, Well, As far as I know localization model will be changed a bit between Beta1 and Beta2 (but these changes are mostly internal, they probably won't even affect you if you are using VS to build your SL apps, you will only need to rebuild / re-deploy your apps). So, as I have suggested to you in previous message - you could try using localization, just do not invest too much time into it before beta2.

If this answers your question, please click on "Mark as Answer" on this post.

jordanhammond
jordanha...

Member

Member

190 points

104 Posts

Re: Re: How to localize Silverlight 2.0

Sergey Volk MSFT:

First of all, you don't need to modify resx file properties. Visual Studio sets up it's settings automatically once you add new resx file to your project. So just leave resx property at their default values (e.g. Texts.resx - Build action: Embedded resource / Copy to output: Don't copy / Custom tool: ResXFileGenerator, Texts.cs-CZ.resx - action: Embedded resource / Copy to output: Don't copy / Custom tool: <empty>). You don't need to specify ResXFileCodeGenerator for each <cs-CZ, de-DE, sk-SK, etc> file, it will be automatically set for Texts.resx and you can use that class to retrieve localized resources for each of the cultures. It will automatically return resources for the current culture (see below how to set current culture for SL). You can use ResourceManager if you need more flexibility (e.g. if you want to be able to retrieve culture-neutral resources, or resources for cultures besides current).



Hi, I tried to follow these steps but only get the  SL loading page.  I'm new to language resourcing.  Do you have a small demo app you can provide?

jjy2
jjy2

Member

Member

354 points

155 Posts

Re: Re: How to localize Silverlight 2.0

Sergey Volk MSFT:
<param name="culture" value="cs-CZ" />

Hi, could someone please confirm if culture param work?
I have below settings, tried with few different locales but CurrentUICulture and CurrentCulture always remain as the default ones..
(CurrentCulture is always en-AU and CurrentUICulture is always en-US)  
Also culture param supposes to change UICuture as well? 

<div id="silverlightControlHost">
  <object data="data:application/x-silverlight," type="application/x-silverlight-2-b1"
   width="100%" height="100%">
   <param  name="source" value="ClientBin/MyApp.xap"></param> 
   <param name="culture" value="ja-JP"/>
   <param name="uiculture" value="ja-JP"/> 
    <param name="onerror" value="onSilverlightError" />
   <param name="background" value="white" />
   <a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;">
    <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight"
     style="border-style: none" />
   </a>
  </object>
  <iframe style='visibility: hidden; height: 0; width: 0; border: 0px'></iframe>
 </div>

WiK
WiK

Member

Member

4 points

2 Posts

Re: Re: How to localize Silverlight 2.0

Hello, All!

I'm junior, so I don't have much experience with localization and SL also.

What I'm trying to do is to get rid of the html and build a 100% Silverlight application just like as it was a WinForms.

Sergey Volk MSFT:
make sure that you have no System.Windows.Controls.dll in your XAP file
 

I haven't understood a little bit. I have a code-behind file with Page class which is inherited from UserControl which is in System.Windows.Controls namespace, right? And in my XAML code on the page I'm using different controls like <Button /> e.g.

public partial class Page : UserControl
    {
        public Page()
        {
            // Required to initialize variables
            InitializeComponent();
        }
    }

So how can I remove System.Windows.Controls.dll from the project?

Please correct me if I'm doing something wrong.

Thanks

slyi
slyi

Participant

Participant

810 points

247 Posts

Re: Re: How to localize Silverlight 2.0

You dont need to remove the controls, just dont embed them in the xap.

A very basic sample is on http://cid-289eaf995528b9fd.skydrive.live.com/self.aspx/Public/Silverlightresx1.zip

WiK
WiK

Member

Member

4 points

2 Posts

Re: Re: How to localize Silverlight 2.0

Great thanks for the sample, slyi! It is working fine.

But for my app I did few testing and I can't make it work finally.

I want to use Button class, but I can't see the way using it without System.Windows.Controls ;(

First, I tried adding

xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"

...

<controls:Button />

to the Page.xaml in your example

In that case VS gives me an error that it can't find the assembly and I should check my references

I tried then to add System.Windows.Controls to the references.

As it was discussed it stucked with 100% loading.

I tried then to set Local Copy to false to make VS not to include this System.Windows.Controls.dll in my .xap file. This gave me just a blanc SL without anything working but still compiling fine without producing any visible errors.

So, the question for me is if it is possible to use SL controls like Button at the same time as the Localization functionality in Silverlight 2.0 beta1?

Thanks

slyi
slyi

Participant

Participant

810 points

247 Posts

Re: Re: How to localize Silverlight 2.0

Please remember this is a beta and most of these minor issues will be fixed in the next release, i hope ;-)

1. On the Properties of References\System.Windows.Controls set the "Copy Local" property to "True"

2. Copy the file ClientBin\ja\System.Windows.Controls.resources.dll to ClientBin\de-DE\System.Windows.Controls.resources.dll

3. Open the ClientBin\de-DE\System.Windows.Controls.resources.dll in your favorite HEX editor

4. Edit the section "<module> System.Windows.Controls.resources ja System.Windows.Controls.Resources.ja.resources System.Windows.Controls.g.ja.resources" and change to "<module> System.Windows.Controls.resources de System.Windows.Controls.Resources.de.resources System.Windows.Controls.g.de.resources"

NB: Dont add extra charactors only replace exisiting ones. Dont use 5 charactor language code eg: de-DE only use the two letter code eg: de.

Now you have a valid Controls.Resources for Germany you can use, and loading issues should disappear.

I hope this helps and these dirty hacks will disappear soon.

Dean.Lu
Dean.Lu

Member

Member

14 points

8 Posts

Re: Re: How to localize Silverlight 2.0

I want to know how to generate these folders inculded in the ClientBin folder in your demo?

slyi
slyi

Participant

Participant

810 points

247 Posts

Re: Re: How to localize Silverlight 2.0

This is strange indeed, in 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: SilverlightApplication1\bin\debug\de\SilverlightApplication1.resources.dll
To get around this you can:  
1. Update the Properties\AppManifest.xml
2. Add <AssemblyPart Source="de/SilverlightApplication1.resources.dll" /> into Deployment.Parts section
3. 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

Dean.Lu
Dean.Lu

Member

Member

14 points

8 Posts

Re: Re: How to localize Silverlight 2.0

hi WiK!

I don't know whether you can localize your whole Silverlight application dynamically?If you can,please tell how to do this?

Because I just localize controls one by one in my application.

thanks

jordanhammond
jordanha...

Member

Member

190 points

104 Posts

Re: Re: How to localize Silverlight 2.0

Hi slyi.  I'm new to the whole localization thing, but need to do a whole app as site.

I downloaded your sample but it only displays english.  The xcopy command doesn't work as well.

I'm just looking for a simple example on how to get started, including how to create the resource files to begin with.

Things are so much easier in WPF, child's play, hopefully they impliment the process in SL the same way.

 

slyi
slyi

Participant

Participant

810 points

247 Posts

Re: Re: Re: How to localize Silverlight 2.0

I did a blog post on silverlight 2.0 localization . I hope this is clear enough.

silver139
silver139

Member

Member

13 points

13 Posts

Re: Re: Re: How to localize Silverlight 2.0

Hey everyone,

 I am also trying to localize a rather large SL application.  I have mulitple projects in my solution and in one of the projects I have setup to contain all the string resources that the other projects will reference.  I have for the most part followed the steps listed in your blog post and the application runs and displays the strings just fine.  What breaks down is Visual studio's ability to display the xmal, it just displays nothing.  If I open the solution in Expression Blend (this is beta2 so I am using the June preview of Blend) every place I reference a string I see the following error "The DependencyProperty target is invalid: <the namespace where my strings are at>".  Has anyone seen this or know how to overcome this problem?

slyi
slyi

Participant

Participant

810 points

247 Posts

Re: Re: Re: How to localize Silverlight 2.0

Hi Silver139,

                I got this issue as well, the only i could solve it is to not put the strings.resx into seperate folder but instread place resx files in the root folder.

As if i add both xmlns:local="clr-namespace:SilverlightApplication1" and xmlns:localResource="clr-namespace:SilverlightApplication1.Resources" inside the UserControl namespace the preview window disappears.

eg:

BAD: resources\strings.resx

GOOD strings.resx

I hope this helps and the issue is fixed for RTM version,

slyi

scgm11
scgm11

Member

Member

13 points

30 Posts

Re: Re: Re: How to localize Silverlight 2.0

My solution for localization.

 1. Create de resx files like this:   es.resx, en.resx, ft.resx,etc...

2. Set the culture as you wish for example:

CultureInfo ci = new CultureInfo("en-US"); Thread.CurrentThread.CurrentCulture = ci;

Thread.CurrentThread.CurrentUICulture = ci;

3. Set language so we dont have one resx for each locale.

string language ="en-US";

language = language.Substring(0, 2);

2. Create ResourceManager to mange directly the resx.

ResourceManager rm = new ResourceManager("MyApp.Resources." + language, Assembly.GetExecutingAssembly());

3. Then we have the resources load into the manager so we can do like this:

rm.GetString(key);

where key is the key of the resx to get the value (ej. "user")

4. After all this we have the culture set and the language load from the resx

With this we dont need any satellite assembly or anything like that just the embebed resource, so we dont have to change any config of our app and you can extend it as you like, with this sample is easy to change it as you like.

If this close the thread mark as answer!

Sorry about the colors this is a quick post ....

 

silver139
silver139

Member

Member

13 points

13 Posts

Re: Re: Re: How to localize Silverlight 2.0

Thanks for the Slyi,

 I do not have the strings.resx in a sub directory and the strings do still do not display within Visual Studio.  Just a thought, do you have Visual Studio 2008 SP1 Beta1 installed?  I do not have the SP1 beta installed and was curious if it made a difference?

slyi
slyi

Participant

Participant

810 points

247 Posts

Re: Re: Re: How to localize Silverlight 2.0

Hmm strange, i only seen this when I refernce resources (subfolder) dll and the primary dll in the same xaml file, I dont have sp1.

Could you give me "tree /f" output to view your stucture on the project folder?

Does this happen on all your usercontrols or just a few?

silver139
silver139

Member

Member

13 points

13 Posts

Re: Re: Re: How to localize Silverlight 2.0

It does appear to be all usercontrols.  For now I am doing all my design work and will come back through in one past add the text to the resource file and bind everything. 

+---ININ.MIC.MICAdmin
¦   ¦   adminMain.xaml.cs
¦   ¦   adminMain.xaml
¦   ¦   ININ.MIC.MICAdmin.csproj
¦   ¦   App.xaml
¦   ¦   ININ.MIC.MICAdmin.sln
¦   ¦   adminHome.xaml
¦   ¦   adminHome.xaml.cs
¦   ¦   ININ.MIC.MICAdmin.csproj.user
¦   ¦   Page.xaml
¦   ¦   App.xaml.cs
¦   ¦   Page.xaml.cs
¦   ¦   ININ.MIC.MICAdmin.sln.cache
¦   ¦   micAdmin.xaml
¦   ¦   micLogin.xaml
¦   ¦   micAdmin.xaml.cs
¦   ¦   micLogin.xaml.cs
¦   ¦   ServiceReferences.ClientConfig
¦   ¦
¦   +---Properties
¦   ¦       AppManifest.xml
¦   ¦       AssemblyInfo.cs
¦   ¦
¦   +---ClientBin
¦   ¦   ¦   Liquid.dll
¦   ¦   ¦   System.Windows.Controls.Data.dll
¦   ¦   ¦   System.Windows.Controls.Extended.dll
¦   ¦   ¦   System.Windows.Controls.Extended.xml
¦   ¦   ¦   System.Windows.Controls.Data.xml
¦   ¦   ¦   ININ.MIC.MICAdmin.dll
¦   ¦   ¦   ININ.MIC.MICAdmin.pdb
¦   ¦   ¦   AppManifest.xaml
¦   ¦   ¦   ININ.MIC.MICAdmin.xap
¦   ¦   ¦   TestPage.html
¦   ¦   ¦   ININ.MIC.MICAdmin.Resource.dll
¦   ¦   ¦   ININ.MIC.MICAdmin.Resource.pdb
¦   ¦   ¦
¦   ¦   +---ja
¦   ¦   ¦       System.Windows.Controls.Extended.resources.dll
¦   ¦   ¦       System.Windows.Controls.Data.resources.dll
¦   ¦   ¦
¦   ¦   +---de
¦   ¦   ¦       System.Windows.Controls.Extended.resources.dll
¦   ¦   ¦       System.Windows.Controls.Data.resources.dll
¦   ¦   ¦
¦   ¦   +---es
¦   ¦   ¦       System.Windows.Controls.Extended.resources.dll
¦   ¦   ¦       System.Windows.Controls.Data.resources.dll
¦   ¦   ¦
¦   ¦   +---fr
¦   ¦   ¦       System.Windows.Controls.Extended.resources.dll
¦   ¦   ¦       System.Windows.Controls.Data.resources.dll
¦   ¦   ¦
¦   ¦   +---it
¦   ¦   ¦       System.Windows.Controls.Extended.resources.dll
¦   ¦   ¦       System.Windows.Controls.Data.resources.dll
¦   ¦   ¦
¦   ¦   +---ko
¦   ¦   ¦       System.Windows.Controls.Extended.resources.dll
¦   ¦   ¦       System.Windows.Controls.Data.resources.dll
¦   ¦   ¦
¦   ¦   +---zh-hant
¦   ¦   ¦       System.Windows.Controls.Data.Resources.dll
¦   ¦   ¦       System.Windows.Controls.Extended.Resources.dll
¦   ¦   ¦
¦   ¦   +---zh-hans
¦   ¦           System.Windows.Controls.Data.Resources.dll
¦   ¦           System.Windows.Controls.Extended.Resources.dll
¦   ¦
¦   +---obj
¦   ¦   +---Debug
¦   ¦       ¦   App.g.cs
¦   ¦       ¦   Page.g.cs
¦   ¦       ¦   micAdmin.g.cs
¦   ¦       ¦   micLogin.g.cs
¦   ¦       ¦   adminHome.g.cs
¦   ¦       ¦   adminMain.g.cs
¦   ¦       ¦   ININ.MIC.MICAdmin.g.resources
¦   ¦       ¦   ININ.MIC.MICAdmin.pdb
¦   ¦       ¦   ININ.MIC.MICAdmin.dll
¦   ¦       ¦   XapCacheFile.xml
¦   ¦       ¦   ININ.MIC.MICAdmin.csproj.FileListAbsolute.txt
¦   ¦       ¦   ResolveAssemblyReference.cache
¦   ¦       ¦
¦   ¦       +---TempPE
¦   ¦       ¦       Service References.MICService.Reference.cs.dll
¦   ¦       ¦
¦   ¦       +---controls
¦   ¦       ¦       ComboBoxControl.g.cs
¦   ¦       ¦       orgUsers.g.cs
¦   ¦       ¦
¦   ¦       +---Refactor
¦   +---controls
¦   ¦       ComboBoxControl.xaml
¦   ¦       ComboBoxControl.xaml.cs
¦   ¦       PasswordTextBox.cs
¦   ¦       orgUsers.xaml
¦   ¦       orgUsers.xaml.cs
¦   ¦
¦   +---bin
¦   ¦       Liquid.dll
¦   ¦
¦   +---images
¦   ¦       I3Logo.ico
¦   ¦       treeimg_adminprofile.png
¦   ¦       treeimg_attendant.png
¦   ¦       treeimg_dirsvrs.png
¦   ¦       treeimg_distlist.png
¦   ¦       treeimg_menu.png
¦   ¦       treeimg_organization.png
¦   ¦       treeimg_orggroup.png
¦   ¦       treeimg_orgs.png
¦   ¦       treeimg_schedule.png
¦   ¦       treeimg_sites.png
¦   ¦       treeimg_status.png
¦   ¦       treeimg_users.png
¦   ¦       I3Logo.png
¦   ¦       startAddOrg.png
¦   ¦       startManagerUsers.png
¦   ¦
¦   +---Service References
¦       +---MICService
¦               ServiceMIC.xsd
¦               ServiceMIC.wsdl
¦               ServiceMIC.disco
¦               configuration91.svcinfo
¦               configuration.svcinfo
¦               Reference.svcmap
¦               Reference.cs
¦               ServiceMIC1.xsd
¦               ServiceMIC11.xsd
¦               ININ.MIC.MICAdmin.MICService.Organization.datasource
¦               ININ.MIC.MICAdmin.MICService.MicUser.datasource
¦
+---ININ.MIC.MICAdmin_Web
¦   ¦   IServiceMIC.cs
¦   ¦   ServiceMIC.svc
¦   ¦   ININ.MIC.MICAdmin_Web.csproj
¦   ¦   ServiceMIC.svc.cs
¦   ¦   Web.config
¦   ¦   ININ.MIC.MICAdminTestPage.html
¦   ¦   ININ.MIC.MICAdmin_Web.csproj.user
¦   ¦   Default.aspx.cs
¦   ¦   Default.aspx.designer.cs
¦   ¦   Default.aspx
¦   ¦
¦   +---App_Data
¦   +---Properties
¦   ¦       AssemblyInfo.cs
¦   ¦
¦   +---bin
¦   ¦   ¦   ININ.Communite.AdminNetU.dll
¦   ¦   ¦   System.Web.Silverlight.dll
¦   ¦   ¦   ININ.Communite.AdminNetU.pdb
¦   ¦   ¦   ININ.MIC.MICAdmin_Web.dll
¦   ¦   ¦   ININ.MIC.MICAdmin_Web.pdb
¦   ¦   ¦
¦   ¦   +---ja
¦   ¦   ¦       System.Web.Silverlight.resources.dll
¦   ¦   ¦
¦   ¦   +---de
¦   ¦   ¦       System.Web.Silverlight.resources.dll
¦   ¦   ¦
¦   ¦   +---es
¦   ¦   ¦       System.Web.Silverlight.resources.dll
¦   ¦   ¦
¦   ¦   +---fr
¦   ¦   ¦       System.Web.Silverlight.resources.dll
¦   ¦   ¦
¦   ¦   +---it
¦   ¦   ¦       System.Web.Silverlight.resources.dll
¦   ¦   ¦
¦   ¦   +---ko
¦   ¦           System.Web.Silverlight.resources.dll
¦   ¦
¦   +---obj
¦   ¦   +---Debug
¦   ¦       ¦   ININ.MIC.MICAdmin_Web.pdb
¦   ¦       ¦   ININ.MIC.MICAdmin_Web.dll
¦   ¦       ¦   ININ.MIC.MICAdmin_Web.csproj.FileListAbsolute.txt
¦   ¦       ¦   ResolveAssemblyReference.cache
¦   ¦       ¦
¦   ¦       +---TempPE
¦   ¦       ¦       App_LocalResources.micAdminResource.Designer.cs.dll
¦   ¦       ¦
¦   ¦       +---Refactor
¦   +---App_Code
¦   +---ClientBin
¦   ¦   ¦   ININ.MIC.MICAdmin.xap
¦   ¦   ¦   ININ.MIC.MICAdmin.Resources.xap
¦   ¦   ¦   ININ.MIC.MICAdmin.Resources1.xap
¦   ¦   ¦   ININ.MIC.MICAdmin.Sites.xap
¦   ¦   ¦
¦   ¦   +---Debug
¦   ¦           ININ.MIC.MICAdmin.Resources.xap
¦   ¦           ININ.MIC.MICAdmin.Resource.xap
¦   ¦
¦   +---img
¦   ¦       SL-H-trans-200.png
¦   ¦       ininlogo2.jpg
¦   ¦
¦   +---css
¦   ¦       imiAdmin.css
¦   ¦
¦   +---App_GlobalResources
¦           micAdminResource.resx
¦
+---ININ.MIC.MICAdmin.Resource
¦   ¦   App.xaml
¦   ¦   Page.xaml
¦   ¦   ININ.MIC.MICAdmin.Resource.csproj
¦   ¦   ININ.MIC.MICAdmin.Resource.csproj.user
¦   ¦   App.xaml.cs
¦   ¦   Page.xaml.cs
¦   ¦   LargeButton.xaml.cs
¦   ¦   LargeButton.xaml
¦   ¦   MICStrings.resx
¦   ¦   MICStrings.Designer.cs
¦   ¦
¦   +---Properties
¦   ¦       AppManifest.xml
¦   ¦       AssemblyInfo.cs
¦   ¦
¦   +---Bin
¦   ¦   +---Debug
¦   ¦           ININ.MIC.MICAdmin.Resource.dll
¦   ¦           ININ.MIC.MICAdmin.Resource.pdb
¦   ¦           AppManifest.xaml
¦   ¦           ININ.MIC.MICAdmin.Resource.xap
¦   ¦           TestPage.html
¦   ¦
¦   +---obj
¦       +---Debug
¦           ¦   App.g.cs
¦           ¦   Page.g.cs
¦           ¦   ININ.MIC.MICAdmin.Resource.g.resources
¦           ¦   ININ.MIC.MICAdmin.Resource.dll
¦           ¦   XapCacheFile.xml
¦           ¦   ININ.MIC.MICAdmin.Resource.csproj.FileListAbsolute.txt
¦           ¦   ResolveAssemblyReference.cache
¦           ¦   ININ.MIC.MICAdmin.Resource.MICStrings.resources
¦           ¦   LargeButton.g.cs
¦           ¦   ININ.MIC.MICAdmin.Resource.pdb
¦           ¦   ININ.MIC.MICAdmin.Resource.csproj.GenerateResource.Cache
¦           ¦
¦           +---TempPE
¦           ¦       MICResource.Designer.cs.dll
¦           ¦       MICStrings.Designer.cs.dll
¦           ¦       MICImages.Designer.cs.dll
¦           ¦
¦           +---Refactor
¦                   ININ.MIC.MICAdmin.Resource.dll
¦
+---ININ.MIC.MICAdmin.Sites
    ¦   ININ.MIC.MICAdmin.Sites.csproj.user
    ¦   App.xaml.cs
    ¦   micSites.xaml.cs
    ¦   ININ.MIC.MICAdmin.Sites.csproj
    ¦   App.xaml
    ¦   micSites.xaml
    ¦
    +---Properties
    ¦       AppManifest.xml
    ¦       AssemblyInfo.cs
    ¦
    +---Bin
    ¦   +---Debug
    ¦           ININ.MIC.MICAdmin.Sites.dll
    ¦           ININ.MIC.MICAdmin.Sites.pdb
    ¦           AppManifest.xaml
    ¦           ININ.MIC.MICAdmin.Sites.xap
    ¦           TestPage.html
    ¦           ININ.MIC.MICAdmin.Resource.dll
    ¦           ININ.MIC.MICAdmin.Resource.pdb
    ¦
    +---obj
        +---Debug
            ¦   App.g.cs
            ¦   Page.g.cs
            ¦   Sites.g.cs
            ¦   micSites.g.cs
            ¦   ININ.MIC.MICAdmin.Sites.g.resources
            ¦   ININ.MIC.MICAdmin.Sites.pdb
            ¦   ININ.MIC.MICAdmin.Sites.dll
            ¦   XapCacheFile.xml
            ¦   ININ.MIC.MICAdmin.Sites.csproj.FileListAbsolute.txt
            ¦   ResolveAssemblyReference.cache
            ¦
            +---TempPE

 

slyi
slyi

Participant

Participant

810 points

247 Posts

Re: Re: Re: How to localize Silverlight 2.0

Looking at your tree, your resources are in seperate dll and referenced ININ.MIC.MICAdmin.Resource.

Does the designer UI also break if you have any reference other dll in use your <usercontrol.resources> or just resx files?

silver139
silver139

Member

Member

13 points

13 Posts

Re: Re: Re: How to localize Silverlight 2.0

I have tried to add a resx file in one of the local projects and it still has the same display problems in Blend and VS.  In addition I have tried adding a local <usercontrol.resources>  string like you suggested and that works just fine.  So it appears to just be resx files.

This will be a rather large SL project so I am partitioning it so it will scale better.  Obvisouly I'd like to keep the string resources in one place in a seprate dll that all projects can access.

 On a seperate question, WPF has Resource Dictionaries, do you know if Microsoft plans to add this to SL buy release time?  In addition to strings, I'd like to keep color, styles, etc in this single resource dll.

neo-nasser
neo-nasser

Member

Member

4 points

2 Posts

How to localize Silverlight 2.0

hi, I'm developping a silverlight web site with VS 2008 and Blend 2. I'd like to make it international:

1- to upload the navigator language and use it at first.

2- then uploading other languages from a resource file.

can you please tell me how to do! how to deal with resource file and how to uplaod the navigator language?

it would be great if you ilustrate it with an exemple of the code (codebehind).

thanks in advance

jordanhammond
jordanha...

Member

Member

190 points

104 Posts

Re: How to localize Silverlight 2.0

 have a read of this blog.

 http://wpf-e.spaces.live.com/

neo-nasser
neo-nasser

Member

Member

4 points

2 Posts

How to localize Silverlight 2.0

I ve already read it, but since I'm novice in silverlight's application(this is my first one), it was difficult to understand all these conversations. if it is possible, I'd like to have a specific example.(the codebehind whit the resource management)

especelly how to uplaod the navigator language and dealing with the resource files.

thanks

slyi
slyi

Participant

Participant

810 points

247 Posts

Re: How to localize Silverlight 2.0

I updated the on-demand sample to use server side auto-detection http://wpf-e.spaces.live.com/blog/cns!2B248D261D0E0035!264.entry

Please dont reply on thread anymore as even I am getting lost on this very old thread, as it is a mix of beta1 and beta 2 loc.
Please start a new thread for any other loc specific questions.

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities