0

I have a windows form application developed in VB.net with Target Framework 3.5. Application is running good in windows 7,8,8.1,10. But in windows XP, its showing an error :

Culture name 'en-in' is not supported

I have checked the code and find the line causing error is :

My.Application.ChangeCulture("en-IN")

when i tried to remove this line, many forms and reports are showing error or wrong information. So i can not remove this line.

Is there any way to install or load this Culture in windows ?

Culture Error

Koby Douek
  • 16,156
  • 19
  • 74
  • 103
Admin
  • 173
  • 3
  • 16

1 Answers1

1

en-IN is not a known culture code.

You can check all existing codes in this list.

You can create a custom culture, using CultureAndRegionInfoBuilder, but it's highly unrecommended.

// Create a new Culture, with the name you desire
CultureAndRegionInfoBuilder cib = new CultureAndRegionInfoBuilder("en-IN", CultureAndRegionModifiers.None);

// Load all defaults from en-US
CultureInfo ci = new CultureInfo("en-US");
cib.LoadDataFromCultureInfo(ci);

// Populate the new CultureAndRegionInfoBuilder object with region information.
RegionInfo ri = new RegionInfo("US");
cib.LoadDataFromRegionInfo(ri);

// Now you can make changes, or finish.
// Changes can be currency, RegionName, etc.

// Finish
cib.Register();

this article explains how to do it.

Or you can set custom culture as :

Dim customCulture As Globalization.CultureInfo = New Globalization.CultureInfo("en-US")
customCulture.DateTimeFormat.ShortDatePattern = "dd-MMM-yyyy"
customCulture.DateTimeFormat.LongDatePattern = "dd-MMM-yyyy HH:mm:ss" 
customCulture.DateTimeFormat.ShortTimePattern = "HH:mm:ss"
customCulture.DateTimeFormat.LongTimePattern = "HH:mm:ss"
System.Threading.Thread.CurrentThread.CurrentCulture = customCulture
System.Threading.Thread.CurrentThread.CurrentUICulture = customCulture
Er Mayank
  • 1,017
  • 2
  • 16
  • 39
Koby Douek
  • 16,156
  • 19
  • 74
  • 103
  • 2
    It's supported in newer versions. The [complete list](https://msdn.microsoft.com/en-us/library/cc233982.aspx) says it's supported since *"Release V"* (Windows Server 2008 and Windows Vista, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, and Windows Server 2012 R2.) Which pretty much explains why it runs on Windows 7,8,8.1,10 – Manfred Radlwimmer Mar 28 '17 at 12:00
  • Is there any way to Install this culture. Is there any EXE or MSI or a file so that i can install in all my clients. – Admin Mar 28 '17 at 12:10
  • @ProgramAdmin no - You have to do it via code. – Koby Douek Mar 28 '17 at 12:11
  • 1
    @ProgramAdmin I have provided a code, that can resolve your problem. and also it does not require Admin Permission. Registering culture required Admin Permission. – Er Mayank Mar 30 '17 at 17:31