4

I am trying to implelemnt a more esoteric locale in my system. specifically the Ghana locale because of their currency the Cedi (GH₵)

According to locale planet I should be using ee-GH, but when I do my app crashes saying it isn't supported.

<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="ee-GH" enableClientBasedCulture="true" /> 

How do I handle this without changing my server's region settings A

Crudler
  • 2,194
  • 3
  • 30
  • 57
  • To support Ghana's languages you would need more than one locale, as Ewe (ee-GH) is only one of the [languages that are spoken in Ghana](https://en.wikipedia.org/wiki/Languages_of_Ghana). The information on localeplanet is a bit inconsistent because they list different currency symbols for [Akan](http://www.localeplanet.com/icu/ak-GH/index.html) and Ewe. – Jenszcz Jun 01 '16 at 09:10

3 Answers3

2

C# has a list of defined locales that it supports: http://www.csharp-examples.net/culture-names/. As you can see Ghana locale is not on that list. If you still want to use it you can define custom culture as described in documentation: https://msdn.microsoft.com/en-us/library/ms172469(v=vs.90).aspx.

Lesmian
  • 3,932
  • 1
  • 17
  • 28
  • statement is totally wrong that "As you can see Ghana locale is not on that list". Check MSDN https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx it says that **You can retrieve an array specific categories of cultures or of all the cultures available on the local computer**. So the list will be different computer to computer. Check more discussion here at well : http://stackoverflow.com/questions/3139456/why-not-all-countries-are-presented-in-cultureinfo-getcultures – par Jun 08 '16 at 09:24
0

It seems that there is no inbuilt support for Ghana locale. So you can check CLDR website they support Ghana locale.

CLDR

I found this .NET Project that help to import locale from CLDR website and source is available you can take a look at that but it is .NET 2.0/3.0.

.NET Project that help to import locale from CLDR website

Ameya
  • 726
  • 6
  • 9
-1

Possible culture in .net showing me (yes it has ee-GH) but you can create one asp.net test page and use below code to list supported culture on your machine. probably it may help to find more detail. (it will display first column as currency column and rest of auto generated column)

  • ak-GH
  • ee-GH
  • en-GH
  • ha-Latn-GH

<asp:GridView ID="GridView1" runat="server">
        <Columns>
            <asp:BoundField DataField="NumberFormat.CurrencySymbol" />
        </Columns>
 </asp:GridView>
   

var cls = System.Globalization.CultureInfo.GetCultures(Globalization.CultureTypes.AllCultures);
GridView1.DataSource = cls;
GridView1.DataBind();
par
  • 1,061
  • 1
  • 11
  • 29
  • Down voting will not help you. Not sure why you **down voted** but "ee-GH" is valid culture and it is working fine in my PC but it also depends on OS version. so you can check culture available on your PC by listing it. read this link for more detail (including msdn link in it): http://stackoverflow.com/questions/3139456/why-not-all-countries-are-presented-in-cultureinfo-getcultures – par Jun 07 '16 at 12:38