This project is read-only.

MLHTML Content Section - Chinese Issues

Topics: Developer Forum, Localization Forum
Mar 2, 2008 at 1:21 AM
We are currently successfully employing the very useful multi-language HTML content section (MLHTMLContent) posted here:

However, we are experiencing an issue with Chinese content: If the <supportedLanguages> list in Web.config includes the neutral Chinese "zh" code, switching the MLHTMLContent section to edit mode will throw an exception "Culture name 'zh' is not supported." (this is different with other neutral culture codes like "en", "de", "ar", etc., which work just fine).

Next, we have made attempts to use specific cultures (like "zh-CN") in <supportedLanguages> - and this time, switching the MLHTMLContent section to edit mode works well: Chinese content can be edited. However, in view (read-only mode), the content is never displayed, even if the thread's current culture is explicitly set to the same "zh-CN". Anyone has an explanation (and / or, better yet , a fix or workaround) for this?

Thanks in advance!

Mar 2, 2008 at 3:33 PM
Edited Mar 2, 2008 at 3:34 PM
Update: The issue is resolved. The problem specific to Chinese ("zh"), but also "zh-Hans" (simplified) and "zh-Hant" (traditional) is that among all available cultures, it's the only one that has no default specific culture associated with - and that's why CultureInfo.CreateSpecificCulture("zh") throws an exception.

The fix is to catch this exception in SectionControls_MLHtmlContent.CheckLanguageStatus(), handle the special case "zh", and explicitly use a specific culture (e.g. "zh-CN") in that case. With this fix applied, the MLHTMLContent section will be able to both edit and display Chinese contents.

In case anyone is interested, I'll post the modified code.
Dec 9, 2008 at 2:18 PM
Hi, Im getting a similar problem.

Culture name 'en-sg' is not supported

The problem is reported in the following line: 

Source Error:

Line 43: 			<providers>
Line 44: 				<clear/>
Line 45: <add name="CustomXmlMembershipProvider" type="MyWebPagesStarterKit.Providers.CustomXmlMembershipProvider" maxInvalidPasswordAttempts="3" passwordAttemptWindow="5" minRequiredNonAlphanumericCharacters="0" minRequiredPasswordLength="3" passwordStrengthRegularExpression="" enablePasswordReset="true" enablePasswordRetrieval="true" requiresQuestionAndAnswer="True" requiresUniqueEmail="true"/>Line 46: 			</providers>
Line 47: 		</membership>

How do I specify not to use 'en-sg' ?  I only have this problem when I upload the database , I don't have this problem in my dev environment.