question about site cultures

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
4/17/2012 1:14:24 AM
Gravatar
Total Posts 192

question about site cultures

Hi.

I was testing the newsletter feature.

all threads are forced to use the persian culture, by globalization tag in web.config.

but newsletter uses the default culture (en-us) for selecting the message template.

I tried debugging into the system and found out that "siteCultureKey" key is used to determine the culture.

is this a different thing?

I think that thread culture is used for things like labels, but siteCultureKey is for content. am I right?

4/17/2012 1:46:29 AM
Gravatar
Total Posts 192

Re: question about site cultures

Odd.

joe, check this method in SiteUtils:

public static CultureInfo GetDefaultCulture()

for my application cultureOverride is not set to true. but it's trying to get ui culture from siteCultureKey, in that method.

because in the code of my application, the following are commented:

//if (WebConfigSettings.UseCultureOverride)
//{

and:

//}

// return ResourceHelper.GetDefaultCulture();

why is it like this? is it the same in the latest code too?

4/17/2012 3:58:40 PM
Gravatar
Total Posts 18439

Re: question about site cultures

That method is correct and returns what it should and does not need to check that commented out web.config setting UseCultureOverride, that is only checked in CultureHelperHttpModule.cs

If no site specific culture is configured then it returns the default en-US

You should not modify the globalization element in Web.config, doing that can cause problems such as null reference exceptions if there are misisng keys in the Persian resource files, you should leave it as en-US in Web.config so it can always fall back to English if there are missing keys in your language resource files, English is the only one guaranteed to not have any misisng keys. Also we cannot read that globalization element from Web.config from code when running in medium trust so to be able to lookup the default culture is better to use user.config

You should force culture in user.config as specified in the article Forcing a Specific Language. That article also explains the difference between culture which is used for formatting numbers and dates ns UICulture which is used to choose the resource files.

Hope that helps,

Joe

4/19/2012 11:10:40 AM
Gravatar
Total Posts 192

Re: question about site cultures

thank you joe.

has it been like this for a long time, or the way site handles cultures has changed recently (were you not recommending changing the globalization tag)?

4/19/2012 12:01:25 PM
Gravatar
Total Posts 18439

Re: question about site cultures

It has been like this for a long time, I have always recomended using the user.config settings to force a language.

The only place in mojoPortal code that calls the method SiteUtils.GetDefaultCutlure is in CultureHelperHttpModule.cs and it does its own check about that web.config setting so that check is not needed inside this method.

This method is used also in some of my add on products but no other code in mojoPortal itself calls that method.

4/21/2012 1:32:04 PM
Gravatar
Total Posts 192

Re: question about site cultures

sorry for so much reposting, but it's not resolved yet, I'm working on it.

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