2

Without looking at the registry, is there a way to get the current application culture in C#?

I have a Add-in and want to get the language from the ArcMap hook using ArcObjects 10.

(I'm using C# to develop the addin.)

2
  • 1
    Better to be asked at www.Stackoverflow.com Jun 15, 2015 at 20:23
  • Does System.Globalization.CultureInfo.CurrentCulture.Name give you what you want? I'm not sure if there is a way with Arcobjects, or if it can differ from the above. Jun 15, 2015 at 20:43

2 Answers 2

3

Looks like this is what you are looking for: http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//0048000001s1000000

System.Threading.Thread.CurrentThread.CurrentUICulture
1
  • Dan Jurgella - thanks for this. I'm going to test that is does pick on on the culture of Arcmap as the add-in runs.
    – Omnia9
    Jun 16, 2015 at 12:42
1

To expand on the comment by @Dan Jurgella... Don't forget to check the properties in the System.Globalization.CultureInfo class. There are static properties in that class, DefaultThreadCurrentCultureand DefaultThreadCurrentUICulture, which could help you. Also depending on what you're doing with languages, it probably wouldn't hurt to be familiar with the System.Text.Encoding namespace and classes in case you are dealing with multiple character sets/encodings.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.