AW: Change of Application-Language

Weingarten, Willi, MFI-A Willi.Weingarten at mfi.de
Fri Jan 12 15:09:56 GMT 2001


Hi all,

I tried to change the language of my application during runtime with code
like this:

	
//**************************************************************************
*
	void MesApp::slotSettingsLanguage()
	
//**************************************************************************
*
	{
	  slotStatusMsg(i18n("Changing application language..."));

		if(settingsGerman->isChecked()) {
			KGlobal::locale()->setLanguage("de");
			KMessageBox::information( this, i18n("German
language selected!"));
		}

	if(settingsEnglish->isChecked()) {
		KGlobal::locale()->setLanguage("C");
		KMessageBox::information( this, i18n("English language
selected!"));
	}

	slotStatusMsg(i18n("Ready."));
	}

All outputs being generated from now on will be in the new selected
language, but all text (menubar or widgettext) that was already on the
screen will be in the old language. Is there a way to rebuild, redraw or
update everything on the application screen(s), so that all existing text
elements will be translated to the new language?

Thanks
Willi




> -----Ursprüngliche Nachricht-----
> Von:	Ralf Nolden [SMTP:nolden at kde.org]
> Gesendet am:	Freitag, 12. Januar 2001 10:10
> An:	kdevelop at kdevelop.org
> Betreff:	Re: Change of Application-Language
> 
> "Weingarten, Willi, MFI-A" wrote:
> > 
> > Hi,
> > 
> > how can I change the language of a running programm?
> > 
> > I wish to run the KDE-enviroment for example in German, start my
> application
> > in German and need the possibility to change the language of only this
> > application (via menu) between German, English, French....
> > 
> > Any suggestions or hints to examples?
> > 
> > Thanks
> > Willi
> 
> Aren´t there commandline options for the language ? You can apply them
> by selecting "Run with Arguments" and set them in the lineedit of the
> dialog coming up then.
> 
> Ralf
> -- 
> The only way to get rid of a temptation is to yield to it. Oscar Wilde
> 
> **********************************
> Ralf Nolden
> 
> The KDevelop Project
> http://www.kdevelop.org
> 
> nolden at kde.org
> rnolden at kdevelop.org
> **********************************
> 
> -
> to unsubscribe from this list send an email to
> kdevelop-request at kdevelop.org with the following body:
> unsubscribe »your-email-address«

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list