Click here to Skip to main content
15,878,959 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I'm trying to set the welcome screen and UI language for all the users in windows OS.For new user the changes applied perfectly and current user as well(using XML Answer file passing through intl.cpl). Existing user I couldn't set. how to solve this issue? Is any other method i could achieve this?? Please share ur knowledge if you have experienced this problem.using C#.net code

What I have tried:

I tried to change some registry through c# code.some conditions certainly it fails
Posted
Updated 17-Oct-16 21:47pm
Comments
[no name] 17-Oct-16 6:21am    
You google "localization"
vigneshjayaraman 17-Oct-16 6:29am    
I tried but for existing user it doesn't workout
[no name] 17-Oct-16 6:38am    
That doesn't change the answer a single bit. If it didn't work for you then you did something wrong.
vigneshjayaraman 17-Oct-16 6:43am    
I read some articles,It wont change for existing users through XML file.I have to follow some other method i guess?? what do you suggest?
vigneshjayaraman 17-Oct-16 6:44am    
Applicable for current user and new users

The OS determines the language to display. If you insist on overriding it (bad idea), do this when you init your app:

C#
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(Properties.Settings.Default.language);
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(Properties.Settings.Default.language);
 
Share this answer
 
The language is stored in the user specific part of the registry (file NTUSER.DAT in the user directory).

When the user is logged in, you can access the user settings at HKEY_USERS\<SID> using regedit or the Windows API registry functions called from a program with administrative privileges. When using a program, the users must be enumerated first to get their SIDs.

When the user is not logged in, the registry can be edited offline using the Reg[^] utility. See for example Modify the Registry of Another User[^].
While this is not a C# solution, it should be no problem to execute the commands or write them to a shell script that can then be xecuted.
 
Share this answer
 
Comments
#realJSOP 17-Oct-16 8:44am    
I don't think he wants to change the language for the entire OS, just his app.
Jochen Arndt 17-Oct-16 8:52am    
You might be right.

But then all the things he tried so far (using the registry and intl.cpl) makes no sense.
What I have done is loading the UI-language from a text file. After the user has been loggedvin. It wil change to the user preffered language. All the text comes from resource files. for example:
Resources-Errors.en-US.resx
Resources-Errors.nl-NL.resx

C#
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(Properties.Settings.Default.DefaultLanguage);
 
Share this answer
 

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



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