<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Programmatically finding the current language/culture of ArcMap in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/programmatically-finding-the-current-language/m-p/577251#M15565</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I haven't done anything with add-ins yet, that is pretty interesting.&amp;nbsp; You would still have to deal with message boxes and other text feed back sent to the users.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Nov 2011 19:36:24 GMT</pubDate>
    <dc:creator>AlexanderGray</dc:creator>
    <dc:date>2011-11-18T19:36:24Z</dc:date>
    <item>
      <title>Programmatically finding the current language/culture of ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/programmatically-finding-the-current-language/m-p/577248#M15562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In ArcGIS 10, users can select in which language they want the ArcMap interface to be displayed: English, French, Spanish, Chinese, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As an ArcObjects developer, how do I programmatically determine what is the language and culture (date, number formats, abbreviations for cardinal directions, etc.) currently in use by ArcMap? What's the interface to use? It should be easy but... I can't find it. I would have expected to find it as a member of ESRI.ArcGIS.RuntimeManager.ActiveRuntime, but apparently it's not there. It doesn't seem to be in the ArcMapUI namespace either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am looking for the equivalent to .NET's System.Globalization.CultureInfo.CurrentCulture.EnglishName (&amp;amp; other such cultural properties). The PC culture can be different from that of ArcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dennis&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 15:46:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/programmatically-finding-the-current-language/m-p/577248#M15562</guid>
      <dc:creator>DenisRoose1</dc:creator>
      <dc:date>2011-11-18T15:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically finding the current language/culture of ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/programmatically-finding-the-current-language/m-p/577249#M15563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The registry key "HKEY_CURRENT_USER\Software\ESRI\UILANGID." has this information.&amp;nbsp; This causes some grief because I use standard .NET resources and resources.fr.&amp;nbsp; In ArcGIS 10, the process keeps the culture of regional setting but uses the language of the registry key.&amp;nbsp; This is great for an application that needs to be switchable without changing the regional setting and affect other applications (as is our case.)&amp;nbsp; On the other hand, it is difficult to predict when our code gets first used. In the extensions, commands and other components registered to be started by the ArcGIS application, you have to check if the uiculture of the process has been set to the same language as ArcMap, so .net can load your resources correctly.&amp;nbsp; Then the question is do you really want to check the registry each time...&amp;nbsp; You can alter the resources's code file, but it is auto-generated so any change there gets quickly overwritten.&amp;nbsp; You can make your own resource manager.&amp;nbsp;&amp;nbsp; You can also make your own static uiculture checker/setter class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This leads to some convoluted code but is workable.&amp;nbsp; In ArcGIS 9.3 it was worse because some strings used the regional settings, which is the culture of the process, while .net resources used uiculture; so you had to set the uiculture to the culture of the process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Date formats, decimal separators and all that are inherited from the system culture or regional settings.&amp;nbsp; You can have the ArcMap language as French and keep the date formats as English.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 16:15:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/programmatically-finding-the-current-language/m-p/577249#M15563</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2011-11-18T16:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically finding the current language/culture of ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/programmatically-finding-the-current-language/m-p/577250#M15564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the valuable information Alexander. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was hoping to do this in managed code as well. I'll research some more before "settling" on unmanaged code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's good to know (&amp;amp; odd) that the language is handled differently from the remaining cultural settings. It appears that abbreviations for cardinal directions are handled as language, at least when it comes to the following dynamic text: &amp;lt;dyn type="dataframe" name="MyDataFrame" property="upperleft" units="dms"/&amp;gt; where West is abbreviated correctly as O (for Ouest) in the French ArcMap. As you mentioned though, the decimal character on an United States PC is a point and not a comma as it would normally be in France.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The visible part of my extension is an Esri add-in, which seems to make it easier to localize than in your description (see: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Localizing_add_ins/0001000002s5000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Localizing_add_ins/0001000002s5000000/&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 17:31:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/programmatically-finding-the-current-language/m-p/577250#M15564</guid>
      <dc:creator>DenisRoose1</dc:creator>
      <dc:date>2011-11-18T17:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically finding the current language/culture of ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/programmatically-finding-the-current-language/m-p/577251#M15565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I haven't done anything with add-ins yet, that is pretty interesting.&amp;nbsp; You would still have to deal with message boxes and other text feed back sent to the users.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 19:36:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/programmatically-finding-the-current-language/m-p/577251#M15565</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2011-11-18T19:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically finding the current language/culture of ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/programmatically-finding-the-current-language/m-p/577252#M15566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Friend Function GetArcgisCurrentLanguageInNlsEnglish() As String&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'PURPOSE: Returns the NLS English name of the current ArcMap interface language&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '=======&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'RETURNS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '=======&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'The English name returned is that of a locale as specified in the Windows 7 National Language Support (NLS) API Reference [uses parentheses];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'NOT the language name as expressed in the Win32_OperatingSystem WMI class documentation [which uses dashes mostly].&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ' If the language is not yet supported by this function, it returns "Unknown Language"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'DEPENDENCIES:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '===========&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'ArcGIS 10.0's language key: HKEY_CURRENT_USER\Software\ESRI\UILANGID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'ArcGIS 10.0's six supported languages&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'VB.NET&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'In the module declaration section, add: Imports Microsoft.Win32 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'SOURCES:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '========&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/44153-Programmatically-finding-the-current-language-culture-of-ArcMap:" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/44153-Programmatically-finding-the-current-language-culture-of-ArcMap:&lt;/A&gt;&lt;SPAN&gt; HKEY_CURRENT_USER\Software\ESRI\UILANGID&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.codeproject.com/KB/vb/registry_with_vb.aspx:" rel="nofollow" target="_blank"&gt;http://www.codeproject.com/KB/vb/registry_with_vb.aspx:&lt;/A&gt;&lt;SPAN&gt; General registry structure&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://msdn.microsoft.com/en-us/library/aa289494(v=vs.71).aspx:" rel="nofollow" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/aa289494(v=vs.71).aspx:&lt;/A&gt;&lt;SPAN&gt; Accessing registry key values in managed .NET&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://msdn.microsoft.com/en-us/goglobal/bb896001:" rel="nofollow" target="_blank"&gt;http://msdn.microsoft.com/en-us/goglobal/bb896001:&lt;/A&gt;&lt;SPAN&gt; National Language Support (NLS) API Reference&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa394239(v=vs.85).aspx:" rel="nofollow" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/aa394239(v=vs.85).aspx:&lt;/A&gt;&lt;SPAN&gt; Win32_OperatingSystem WMI class&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'HISTORY:&amp;nbsp; 20111118: First version.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '=======&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim regKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\ESRI", False)&amp;nbsp; 'Read access only to registry&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'iLanguageId is the integer representation of Microsoft operating system language LCID; UILANGID is a registry value of type REG_DWORD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim iLanguageId As Int32 = regKey.GetValue("UILANGID")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; regKey.Close()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; '&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; MessageBox.Show("iLanguageId: " &amp;amp; iLanguageId.ToString)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Select Case iLanguageId&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Case 7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return "German"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Culture Name: de&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Case 9&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return "English"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Culture Name: en&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Case 10&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return "Spanish"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Culture Name: es&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Case 11&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return "Japanese"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Culture Name: ja&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Case 12&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return "French"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Culture Name: fr&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Case 2052&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return "Chinese (Simplified, PRC)"&amp;nbsp; 'Culture Name: zh-CN&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Note that ArcMap lists only "Chinese (Simplified)", which is not correct as that iLanguageId is 4, not 2052.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Case Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return "Unknown Language"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; End Select&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; End Function&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Nov 2011 01:42:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/programmatically-finding-the-current-language/m-p/577252#M15566</guid>
      <dc:creator>DenisRoose1</dc:creator>
      <dc:date>2011-11-19T01:42:44Z</dc:date>
    </item>
  </channel>
</rss>

