Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
Hello,
I have a problem with the resource files in a project i have and i cant understand the resource files behavior.
Information:
a project witch have 3 resource files: "UIStrings.resx", "UIStrings.de-DE.resx" and "UIStrings.en-US.resx" and i am using these for changhing the language.
Problem:
if i add a new string to the "UIStrings.de-DE.resx" or/and "UIStrings.en-US.resx", for exemple new string Name "Button" with value "Ok" and in the de.resx i can add "Button" with value "Gut", the language isn't working at all, it remains in english, and i dont know why this is happening, it's like i can add int i; at the project wont work, any ideas about this problem?

if you need any information please ask, thanks

Regards,
Posted
Updated 9-Nov-11 4:21am
v3
Comments
[no name] 8-Nov-11 16:59pm    
Added globalization tag

First thing to understand is this: http://msdn.microsoft.com/en-us/library/21a15yht%28v=VS.100%29.aspx[^].

Also, what makes an application selecting this or that satellite assembly? It won't happen by itself. This is a current thread culture which you need to switch to the culture you need to use.

See:
http://msdn.microsoft.com/en-us/library/system.threading.thread.currentculture.aspx[^],
http://msdn.microsoft.com/en-us/library/system.threading.thread.currentuiculture.aspx[^].

Make sure you take this all into account; and you will get your UI localized; tested many times.

—SA
 
Share this answer
 
v2
Comments
[no name] 9-Nov-11 9:43am    
Very useful links. Hopefully it helps the OP understand that it doesn't happen magically :)
+5
Sergey Alexandrovich Kryukov 9-Nov-11 10:27am    
Exactly.
Thank you, Collin.
--SA
Have you written any logic that accesses your culture settings and then loades the appropriate resource file?
If not that is your problem.
If yes, I would look there, because again that is likely your problem.

Not sure what this has to do with int i;
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 8-Nov-11 19:53pm    
I would say it's correct but not really helping... I tried to help in my solution, will you take a look?
--SA
Gabriel Sas 9-Nov-11 10:21am    
the .resx files are used for the language, and if i run the project it works fine, the culture of the program is changing how it supposed it should change, but if i add another string to those files the language remains stuck in english, and i do not not why is this happenig, i can acces that string from my program as well

any ideas?
Sergey Alexandrovich Kryukov 9-Nov-11 10:28am    
The names of all resources in all satellite assemblies should match. How about that?
--SA
Gabriel Sas 9-Nov-11 10:39am    
all the names are String1, the value is not important
Gabriel Sas 9-Nov-11 10:50am    
i just copy paste an already string from the .resx files, i have string with name "Add", i copy it, and i pasted it in all 3 of my .resx files, and it doesn't work, it added a string with name Add1
the sollution was simply putting in the auto-generated files ...resource = Language;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900