HighTechTalks DotNet Forums  

Switch language at runtime - best practice

Dotnet Internationalization microsoft.public.dotnet.internationalization


Discuss Switch language at runtime - best practice in the Dotnet Internationalization forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Michael Nesslinger
 
Posts: n/a

Default Switch language at runtime - best practice - 06-06-2007 , 10:27 AM






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 Neßlinger

Reply With Quote
  #2  
Old   
Michael S. Kaplan [MSFT]
 
Posts: n/a

Default Re: Switch language at runtime - best practice - 06-06-2007 , 10:58 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.



"Michael Nesslinger" <Michael.Nesslinger (AT) gmx (DOT) de> wrote

Quote:
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 Neßlinger



Reply With Quote
  #3  
Old   
Michael Nesslinger
 
Posts: n/a

Default Re: Switch language at runtime - best practice - 06-07-2007 , 05:43 AM



Michael S. Kaplan [MSFT] schrieb:
Quote:
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.


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.

Michael Neßlinger


Reply With Quote
  #4  
Old   
Jaakko Salmenius
 
Posts: n/a

Default Re: Switch language at runtime - best practice - 06-07-2007 , 06:51 AM



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



Reply With Quote
  #5  
Old   
=?Utf-8?B?SGVucnk5OQ==?=
 
Posts: n/a

Default RE: Switch language at runtime - best practice - 06-20-2007 , 03:05 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

Gruß, Heinrich

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.