Force 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.
8/15/2006 5:29:10 AM
Gravatar
Total Posts 68

Force language?

Hi,

is there a way of forcing what language the site should be displayed on? More specifically: add flag buttons, that changes language? I noticed there is some CultureFlag and flags in the Data folder, but havent figured out how to use that.
8/15/2006 5:39:46 AM
Gravatar
Total Posts 18439

Re: Force language?

Taking adavantage of the 2.0 .NET localization features and using a setting like this in web.config:

<globalization culture="auto:en-US" uiCulture="auto:en" requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="iso-8859-15" />

The "auto" makes it detect the browser language and if there are resources for that language it will use those or fall back to the default en-US.

I did create /Controls/CutlureFlag.ascx, if you add this in your skin it will display the flag of the current culture of the browser. (I'm not sure it displays for english but it does for other languages.

I don't currently have a way for user to select language other than browser settings. One possible way is to have separate sites for each language by removing the auto in each one and just specifying culture then use flag icons on the default site that link to the different language specific sites.

I can't remember if CultureFlag.ascx was in the last release or only in svn. Its just something I was playing with.

Joe
8/15/2006 6:23:39 AM
Gravatar
Total Posts 68

Re: Force language?

Ok, I think that would be a good thing to have in a future release, when using computers in public spaces, lite it-cafés, libraries, and schools (which Im developing a system for) you have people with different prefered language with the same browser settings. Can't find where I read it but Microsoft recommended to have this even when using the localization feature. I will think of having different sites for each language...

Thanks!
Christian
8/15/2006 6:36:55 AM
Gravatar
Total Posts 18439

Re: Force language?

Do they not allow changing the browser language in it-cafes or schools? I would think the browser setting way is the most recommended unless this is blocked somehow in some situations. You obviously wouldn't want choices for language if you don't have resources translated into the chosen language as it would still fall back to the available language.

Also in browser settings you have a list of languages with the highest being the most preferred, so even if your preferred language has no resource, if your second preferred language does it will use that or keep falling to default if none of your preferred languages are available.

I have seen tutorials on making it user selectable but my impression is the preferred way is based on browser settings.

In either case if the content in the db is not in your language, the benefit of a few labels and buttons localizing is minimal in my opinion. Thats why if I were working on a project to truly support several languages with content authors in each language I would go with separate sites. This is what you usually see with professional things like google and yahoo they don't use the same site for all languages. They have like http://fr.yahoo.com/ and http://www.google.fr/

Cheers,

Joe
8/15/2006 6:59:28 AM
Gravatar
Total Posts 68

Re: Force language?

Well, sometimes they are restrictive with letting user change settings at all, including browser settings. But most of the time I don't think people know how to actually do that, and especially they dont know that this will have any effect on the site. You have to let them know in that case, but most people can see a flag on a page and they know that it stands for a language. I like the localization, its great by default but, in my opinion, you chould be able to choose language from the site to. Your point about the content is good though...

Cheers,
Christian
8/15/2006 7:06:00 AM
Gravatar
Total Posts 18439

Re: Force language?


Suppose we translate the resources for mojoPortal into 20 languages, still it only affects the labels and buttons and such not the db content. thats a lot of flags to show but even if its a dropdown list now the user will choose their language and be dissappointed that the only thing changing is a few labels and buttons whereas if its automatic the user is impressed a little that the site trys to accomodate their language at least a little.

I think people who find themselves frequently in a situation where they are using a browser not configured to their language they learn how to change it. Of course I agree its a problem if its locked down and they can't change it. But to me, if I see flags I expect to see content I can read if I click it not just a few buttons and labels so its overdone to make it user selectable unless the content is going to be truly translated. It also makes an additional step for the majority of users who do have their own language specified in their browser.
You must sign in to post in the forums. This thread is closed to new posts.