Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 05:10 AM.

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