Change language

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
6/25/2010 3:26:27 AM
Gravatar
Total Posts 31

Change language

hi,

i would like to change the language in mojoportal.
i tried:


protected override void InitializeCulture()
{
UICulture = Request.QueryString["lng"];
Culture = Request.QueryString["lng"];
base.InitializeCulture();
}

but did doesn't change anything.
does anyone know how to change the language?

// Laurence Mommers

6/25/2010 6:21:25 AM
Gravatar
Total Posts 18439

Re: Change language

See the bottom of this page:

http://www.mojoportal.com/localization.aspx

Hope it helps,

Joe

6/25/2010 7:04:17 AM
Gravatar
Total Posts 31

Re: Change language

 

hi,

thanks for you response,
but i needs something to set the language in code. because i got on my site 2 flags.

the English flag and the Netherlands. the language should change when i click one of the flags.

// Laurence Mommers

6/25/2010 7:13:11 AM
Gravatar
Total Posts 18439

Re: Change language

I wouldn't do it based on query string params. I recommend using mutliple sites with site for each language and force each site to a specific cutlture as described in the document, then the flags can just link to the sites. Changing the culture is only going to affect buttons and labels not content coming from the database.

http://www.mojoportal.com/supporting-muliple-languages.aspx

It is however possible to set the culture from code

using System.Globalization;
using System.Threading;

string cultureName = "it-IT";

CultureInfo siteCulture = new CultureInfo(cultureName);
Thread.CurrentThread.CurrentCulture = siteCulture;
Thread.CurrentThread.CurrentUICulture = siteCulture;

Might be better to use a dropdown list and set a cookie with the culture name instead of a query string param, it can throw an error if an invalid language code is used.

Hope it helps,

Joe

 

 

6/25/2010 7:36:22 AM
Gravatar
Total Posts 31

Re: Change language

thank you,

i forget to tell i only needed to change the language of the buttons and labels.
i will also use the cookie like you told.

//Laurence Mommers
 

You must sign in to post in the forums. This thread is closed to new posts.