locked
Windows store Localization problem

    Question

  • I want my app could localize for different markets, so I added many resources in the app's DLL project, like \Strings\en\resources.resw, \Strings\fr\resources.resw, actually as I know, there are about 102 different languages in the "Strings" folder, and I use such as DataAccess.Resource.GetString("_do_you_want_to_save_the_changes"); and x:Uid="/DataAccess/Resources/SaveButton" ("DataAccess" is the DLL name and DataAccess.Resources = ResourceLoader.GetForCurrentView("/DataAccess/Resources");) to display correct language text from resources files.

    And in control panel the fr-CA has been set as "Langue d'affichage de Windows: activée", actually the windows language is displaying French, but when I open my app, it still displaying English.

    How to make it display the correct language follow the OS settings.

    Thanks


    Wednesday, June 11, 2014 2:24 PM

All replies

  • If you've set the display language to French then the app should pick up French resources automatically.

    Try out the Application resources and localization sample to see if it works for you. If not then you probably aren't setting the display language correctly. If so then compare how it handles loading the resources to see how it is different from your code.

    --Rob

    Thursday, June 12, 2014 1:19 AM
    Owner
  • Hi Rob

    I think I have downloaded the language pack and change the display language to fr-CA, because the other area in windows is displaying French, only my app is still displaying English.

    Thursday, June 12, 2014 5:31 AM
  • can you share a sample project how you do it? then can test for you to see if you do something wrong in windows or maked a mistake in the project. for now its not totally clear what you changed

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, June 12, 2014 6:06 AM
  • Hi Dave

    Here is my app sample, you can help me to figure out the problem, you can download it here:

    https://app.box.com/s/xo1ddmufejnlrn68tso5

    If you got any problem when tring to access this link, please let me know.

    BTW, I could show my screenshot about my app and the control panel:

    Thursday, June 12, 2014 12:14 PM
  • Your sample doesn't include French Strings. It has only English:

    See the sample I linked for an example with French strings as well.

    --Rob

    Thursday, June 12, 2014 5:13 PM
    Owner
  • HI Rob

    I'm sorry I just copied the resources file to the "Strings" folder but forgot to add it under project, I have added then in the project but after I run the app, it still displaying English.

    And, I have downloaded the example you provided, it works, but I don't know what's wrong with my app, it doesn't make sense.

    :(

    Friday, June 13, 2014 12:31 AM
  • try to make the same folder structure also in your LocalizationSample app.

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Friday, June 13, 2014 2:41 PM
  • Hi all

    I uploaded the latest project package, add all the language pack in the project, the problem is still unsolved, can anybody help me to download the project and figure out what is wrong with it, the new address is https://app.box.com/s/tvf2fq32e8lh5opil12p

     thanks.


    Friday, June 13, 2014 3:20 PM
  • I played with your sample a bit but I don't see yet why it's not working on my fr-fr system. If you set the default language to fr-fr in the manifest then it does pull the French strings. I'll try to look at it more closely later.
    Tuesday, June 17, 2014 3:44 AM
    Owner
  • i cant even compile; i get this error:

    Error 2 File C:\Users\William\documents\visual studio 2013\Projects\LocalizationSample\DataAccess\strings\fr-fr\Resources.resw not found. C:\Users\Dave\Desktop\LocalizationSample\DataAccess\MakePRI DataAccess

    maybe it helps. i dont understand this error because i dont use that location and not seeing any direct paths in the project file.


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Tuesday, June 17, 2014 9:04 AM
  • Hi Dave

    I don't know what's wrong with your project, Rob can compile and run correctly, just not display right contents, have you tried to delete all the project files and unzip the latest project package, and see if it works.

    https://app.box.com/s/tvf2fq32e8lh5opil12p

    Tuesday, June 17, 2014 10:24 AM
  • Hi Rob

    That is also confused me, everything looks good, but the result is not correct.

    Tuesday, June 17, 2014 10:25 AM
  • I had to modify the project to remove the references to C:\Users\William\documents . I don't remember where exactly they were, but I found them in a search. Might have been the suo file, which can just be removed.
    Tuesday, June 17, 2014 2:28 PM
    Owner
  • Hi Rob

    Do you have any idea what's wrong with my app,

    I have an idea, what about you create a new project which the structure is similar with mine (the resources file is in a class library), and see if it could display the correct strings, if it could, why not share your project to us.

    Thanks


    Thursday, June 19, 2014 2:35 PM
  • Hi William,

    I do not yet know what is going on with your project, but I will try to get back to you on this later this week.

    If you need one-on-one support you can open a case on http://aka.ms/storesupport and somebody will work directly with you.

    --Rob

    Thursday, June 19, 2014 4:35 PM
    Owner
  • The problem is that since the main project doesn't define any resources it automatically uses the default language. You need to have an appropriate resource dictionary for the language in the main project to enable support. You can then draw the actual strings from the dictionary in the sub-project.
    Tuesday, June 24, 2014 4:54 PM
    Owner
  • Salut Monsieur Rob

    You means I should create some folder for the language like "en", "fr" in the "Strings" folder under the main project could make it works?

    Wednesday, June 25, 2014 1:23 PM
  • Yes. Folders with Resource.resw files. The resource files can be stubs if you are always going to the secondary project.
    Wednesday, June 25, 2014 7:53 PM
    Owner
  • I followed your ways and it finally display the correct contents, but, I just have a little confused with it, I have defined the resources data in the class library, why I should define it again in the main project, and the resources file can't be empty, it doesn't make sense. I think that is a bug, we should report it to MS or someone. Agree?
    Thursday, June 26, 2014 3:38 PM
  • You don't need to duplicate all the data. You just need enough of a stub file that the app can report that it supports the language.

    The problem is that your library's data isn't available when the app is starting up and choosing its default culture. If you track System.Globalization.CultureInfo.CurrentCulture when the app starts up you'll see that you get an English culture since the manifest defines the default language to EN and the app itself doesn't have any resources that match the user's current setting.

    This doesn't appear to be a bug, but I'll note it since it's definitely confusing.

    --Rob

    Thursday, June 26, 2014 4:10 PM
    Owner