Groups | Blog | Home
all groups > dotnet internationalization > june 2007 >

dotnet internationalization : Switch language at runtime - best practice



Michael S. Kaplan [MSFT]
6/6/2007 8:58:53 AM
It is the easiest way, and the way that this feature is supported in Office
(must restart the Office app) and Windows (must log off and log back on).
Anything more complicated requires a lot of work.


--
MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with
no warranties, and confers no rights.



[quoted text, click to view]

Michael Nesslinger
6/6/2007 5:27:15 PM
I have a desktop application that supports different languages via the
mechanism provided by the .Net Framework. I can choose the language when
starting the program or use the system language and all dialogs and
windows are displayed in the correct language. It worked fine for now.
But now i need to switch the language at runtime, lets say via a menu
entry. What is the best approach for this. The only thing a found so far
is saving the state of the application ending it and starting it with
the new language. This cannot be the only way?

Every bit of help is appreciated.

Michael Nesslinger
6/7/2007 12:00:00 AM
Michael S. Kaplan [MSFT] schrieb:
[quoted text, click to view]
Ok, i suspected this.
But i have another question hoping you can help me with. Is there a way
to get all the languages available for an application, not the languages
installed on the system? I need this information for building a menu to
set the language for the application.
One way would be parsing the application directory for folders
containing the resource files and using the name of the folder to
determine the language. I am hoping for a more simple solution, since it
is so easy to get all the languages installed in the system.

Jaakko Salmenius
6/7/2007 8:51:19 PM
Sisulizer localization tools has classes that implmenet runtime language
switch in a very easy way. The basic idea is that you first use Sisulzier to
create satellite assembly files then you can add one line of code that make
runtime language switch possible.

private void languageToolStripMenuItem_Click(object sender, EventArgs e)
{
SelectLanguage.Select("en");
}

Take a look at
http://www.sisulizer.com

Best regards,
Jaakko

Henry99
6/20/2007 1:05:01 AM
Hallo Michael,

what I've done is to save ALL current user settings (incl. where the
application's window is placed etc.) and restart the app with the new culture
and resources (prior generated via winres.exe).
The user has to wait less than one second and receives her winform app in
the desired language

AddThis Social Bookmark Button