{"id":3383,"date":"2005-02-17T19:22:00","date_gmt":"2005-02-17T19:22:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/heaths\/2005\/02\/17\/the-differences-between-locales-and-languages\/"},"modified":"2005-02-17T19:22:00","modified_gmt":"2005-02-17T19:22:00","slug":"the-differences-between-locales-and-languages","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/setup\/the-differences-between-locales-and-languages\/","title":{"rendered":"The Differences between Locales and Languages"},"content":{"rendered":"<p>In a recent change &#8211; while we were still known as Developer Division Sustained Engineering &#8211; I addressed a functional change that relied on locales instead of languages for <a href=\"http:\/\/www.microsoft.com\/globaldev\/DrIntl\/faqs\/muifaq.mspx\">MUI<\/a> support. I see this mistake a lot in developer forums and so I wanted to address what the difference was between a locale and languages.<\/p>\n<p>A locale represents regional settings, the kind of settings you configure in the Regional and Language Options control panel applet without a language pack installed, which you can get through the <a href=\"http:\/\/selectug.mslicense.com\/\">Volume Licensing Program<\/a>&nbsp;or in certain <a href=\"http:\/\/msdn.microsoft.com\/subscriptions\/default.aspx\">MSDN Subscriptions<\/a>&nbsp;for development. Platforms that currently support MUI are Windows 2000, Windows XP, and Windows 2003, as well as the upcoming Windows release codename &#8220;Longhorn&#8221;. For those platforms that do no support MUI or that do not have a language pack installed, the Regional Options&nbsp;control panel will only display locale settings.<\/p>\n<p>Locale settings control how numbers, dates, and times display for your region &#8211; which may be a country, or a portion of country or may not even honor country boundaries. They are independent of your language. Setting a thread&#8217;s locale or changing your system locale will change how numbers, dates, and times are displayed for controls created on that thread or running on your system, respectively.<\/p>\n<p>A language, on the other hand, is what we speak, read, and write. Language settings control in what language text appears independently of the locale settings.<\/p>\n<p>Often developers will use the locale to set both regional and languages settings. In VBScript that only provides the <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/script56\/html\/vsfctgetlocale.asp\">GetLocale<\/a> function, this can be a problem; but, other APIs and frameworks provide plenty of support for getting these settings independently.<\/p>\n<p>If you&#8217;re developing managed applications or libraries, I recommend that you read <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/cpguide\/html\/cpcondesigningglobalapplications.asp\">Developing World-Ready Applications<\/a> in the .NET Framework SDK. For native code, read about the various <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/intl\/nls_8d0z.asp\">National Language Support APIs<\/a> like <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/intl\/nls_08tg.asp\">GetUserDefaultLCID<\/a> and&nbsp;<a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/intl\/nls_5c85.asp\">GetUserDefaultUILanguage<\/a>&nbsp;that get the user&#8217;s preferred locale ID&nbsp;(LCID) or language ID (LANGID). The GetUserDefaultUILanguage API is only supported on MUI-enabled systems, so it&#8217;s a good idea to fall back to <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/intl\/nls_2lgk.asp\">GetUserDefaultLangID<\/a>, which gets the language of the installed OS.<\/p>\n<p>For managed code you have the <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/cpref\/html\/frlrfSystemThreadingThreadClassCurrentCultureTopic.asp\">Thread.CurrentCulture<\/a> and <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/cpref\/html\/frlrfSystemThreadingThreadClassCurrentUICultureTopic.asp\">Thread.CurrentUICulture<\/a> properties that set the locale or language for the specified thread, respectively. Setting <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/cpref\/html\/frlrfSystemGlobalizationCultureInfoClassCurrentCultureTopic.asp\">CultureInfo.CurrentCulture<\/a> and <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/cpref\/html\/frlrfSystemGlobalizationCultureInfoClassCurrentUICultureTopic.asp\">CultureInfo.CurrentUICulture<\/a> is the same as setting the equivalent properties on <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/cpref\/html\/frlrfSystemThreadingThreadClassCurrentThreadTopic.asp\">Thread.CurrentThread<\/a>. The <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/cpref\/html\/frlrfsystemresourcesresourcemanagerclasstopic.asp\">ResourceManager<\/a> that you can use to localize your application uses the CultureInfo.CurrentUICulture property to display localized text.<\/p>\n<p>For more information I recommend the book that&#8217;s required reading at Microsoft, <a href=\"http:\/\/www.amazon.com\/exec\/obidos\/ASIN\/0735615837\/\">Developing International Software, Second Edition<\/a>. <a href=\"http:\/\/www.amazon.com\/exec\/obidos\/tg\/browse\/-\/4000\/\">Other great titles<\/a> are available as well for Windows, XML, Microsoft .NET, and more.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a recent change &#8211; while we were still known as Developer Division Sustained Engineering &#8211; I addressed a functional change that relied on locales instead of languages for MUI support. I see this mistake a lot in developer forums and so I wanted to address what the difference was between a locale and languages. [&hellip;]<\/p>\n","protected":false},"author":389,"featured_media":3843,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[14,22],"class_list":["post-3383","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-development","tag-localization"],"acf":[],"blog_post_summary":"<p>In a recent change &#8211; while we were still known as Developer Division Sustained Engineering &#8211; I addressed a functional change that relied on locales instead of languages for MUI support. I see this mistake a lot in developer forums and so I wanted to address what the difference was between a locale and languages. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/3383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/users\/389"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/comments?post=3383"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/3383\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media\/3843"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media?parent=3383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/categories?post=3383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/tags?post=3383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}