Module Localization Only?

This is a place to discuss how to adapt mojoPortal to the needs of different cultures. Before asking questions here please first review the localization documentation.

This thread is closed to new posts. You must sign in to post in the forums.
6/19/2009 3:22:22 PM
Gravatar
Total Posts 10

Module Localization Only?

Is it possible to setup a localization for an specific module only? For example, I need to change the forums module to in pt-BR mode. I am looking for a solution that does not involve changing any global configuration under web.config. I want to maintain the core of Mojo administration in its native language "English" and just change the frontend modules to an specific language as I go. If this is possible can you please point out how to do it?

 

Thanks

Rod

6/20/2009 6:12:44 AM
Gravatar
Total Posts 18439

Re: Module Localization Only?

Hi Rod,

Localization works the same in all features. If you set your browser language preference to pt-BR it will use pt-BR for all labels if there are translations for pt-BR. The resource files are located under App_GlobalResources. The files named with .pt-BR.resx are the ones of interest, unfortuantely they have not been kept up to date and are missng a lot of keys. For missing keys it will fall back to English.

So the best thing you could do is to help to update the *.pt-BR.resx files to translate the missing keys from the english version. If you do that and send me the files I will include them.

Hope it helps,

Joe

6/20/2009 3:04:14 PM
Gravatar
Total Posts 10

Re: Module Localization Only?

Thanks, it worked fine here in my browser as you suggested. The translations for the forum seems to be in good shape and are up to date, I will translate the others as I get more experience with the framework and I promise to send the files.

One thing I got confused is why the globalization setting in web.config is necessary if the browser picks up the language automatically? If set to PT-BR in web.config does that mean a user in Brazil won't be affect since it is the default language, but a user in USA which has the browser's preference to "en" will be forced to view it in "portuguese"?

 

Rod

6/22/2009 6:45:33 AM
Gravatar
Total Posts 18439

Re: Module Localization Only?

Hi Rod,

Basically the way it works by default is that the executing thread will be set to the language preference of the browser and this causes the use of the preferred language resources files. However, it seems that many or most people don't know about the browser settings for language so its possible many users have en-US as the browser language even though they would prefer pt-BR.

It is possible in mojoPortal to force the use of a particular language instead of relying on the browser preference, this is documented on the bottom of the page here:

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

So, if you wanted to force the use of pt-BR you could make settings in Web.config/user.config like this:

<add key="UseCultureOverride" value="true" />
<add key="site1culture" value="pt-BR" />

What this will do is cause the executing thread to use pt-BR instead of the browser preference so that by default the pt-BR resources will be used for all requests. It will still fall back to English for missing keys in the pt-BR resources as it should.

Note that site1culture is for siteid = 1, so in a multi site installation you can set different languages on different sites based on siteid, so the key for siteid = 2 will be site2culture and so on. 

Hope it helps,

Joe

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