Wrox Programmer Forums
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 16th, 2008, 10:32 AM
Registered User
Join Date: Dec 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Create New CultureInfo

I'm trying to build a localization feature for my website and came across a dead-end for myself. Please accept my appologies if this topic is intended for the Basic 2.0 section since i for myself believe this topic seems to be on a higher level scale to need advice.

I'm looking to build globalization and localization feature in my website and successfully able to switch otherwise the languages.

Here's the code extracted for dropdown on my web

<asp:DropDownList id="DropDown1" runat="server" OnSelectedIndexChanged="InitializeCulture" class="select" AutoPostBack="True">
<asp:ListItem Value="auto">International</asp:ListItem>
<asp:ListItem Value="cn-CN">China</asp:ListItem>
<asp:ListItem Value="en-GB">Great Britain</asp:ListItem>
<asp:ListItem Value="jp-JP">Japan</asp:ListItem>
<asp:ListItem Value="kr-KR">Korea</asp:ListItem>
<asp:ListItem Value="my-MY">Malaysia</asp:ListItem>
<asp:ListItem Value="en-PH">Philippines</asp:ListItem>
<asp:ListItem Value="en-TH">Thailand</asp:ListItem>
<asp:ListItem Value="en-US">United States</asp:ListItem>

Here's the code to my code behind file.

Protected Sub InitializeCulture()
Dim lang As String = DropDown1.SelectedValue
setLang.Text = lang

If (lang IsNot Nothing) Then
If lang <> "" Then
Thread.CurrentThread.CurrentUICulture = New CultureInfo(lang)
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang)

setLang.Text = Resources.Res.setLang
setCntry.Text = Resources.Res.setCntry
set01.Text = Resources.Res.set01
set02.Text = Resources.Res.set02
End If
End If
End Sub

This worked when CultureInfo.CreateSpecificCulture is (th-TH) for instance. But when i tried to set the value to (en-TH), There was an error stating none in the "library". I would like to set this en-TH as an alternative to the growing english speaking demand in TH.

So, is there i can add (en-TH) cultureinfo into the file or what not? Thanks.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create generic XSL Template to create table Venkatachalapathy XSLT 5 March 11th, 2008 07:49 AM
document create clinfix BOOK: Professional Ajax ISBN: 978-0-471-77778-6 3 August 8th, 2006 07:09 PM
create an index bonekrusher XSLT 5 July 31st, 2006 08:14 AM
Why CultureInfo? vinod_pawar1 .NET Framework 2.0 4 August 14th, 2004 05:10 PM
Trying to serialize CultureInfo object cgbissio C# 0 July 17th, 2003 10:27 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.