{"id":110,"date":"2018-02-10T10:48:40","date_gmt":"2018-02-10T10:48:40","guid":{"rendered":"http:\/\/basicwebsitesolutions.com\/blog\/?p=110"},"modified":"2018-02-10T10:48:40","modified_gmt":"2018-02-10T10:48:40","slug":"delphi-retrieving-various-locale-information","status":"publish","type":"post","link":"https:\/\/basicwebsitesolutions.com\/blog\/2018\/02\/10\/delphi-retrieving-various-locale-information\/","title":{"rendered":"Delphi : Retrieving various locale information"},"content":{"rendered":"<p>I got this info from a website that showcases all of the identifiers for each pc. Thought of posting it here also in my blog for future references<\/p>\n<p>Question: How can I determine various locale information using delphi?<\/p>\n<p>Answer:<br \/>\nDelphi has a function called GetLocaleInfo which you can use to retrieve information such as the system language, currency symbol, number of decimal digits and so forth.<\/p>\n<p>Here is a function that will return locale information based on the parameter &#8220;flag&#8221; :<\/p>\n<p>&#8230;&#8230;..<br \/>\nfunction TForm1.GetLocaleInformation(Flag: Integer): String;<br \/>\nvar<br \/>\npcLCA: Array[0..20] of Char;<br \/>\nbegin<br \/>\nif( GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,Flag,pcLCA,19) pcLCA[0] := #0;<br \/>\nend;<br \/>\nResult := pcLCA;<br \/>\nend;<br \/>\n&#8230;&#8230;..<\/p>\n<p>Example of using the function:<\/p>\n<p>&#8230;&#8230;..<br \/>\nprocedure TForm1.Button1Click(Sender: TObject);<br \/>\nbegin<br \/>\nShowMessage(GetLocaleInformation(LOCALE_SENGLANGUAGE));<br \/>\nend;<br \/>\n&#8230;&#8230;..<\/p>\n<p>&#8220;Flag&#8221; can take the following values (as seen in Windows.pas):<\/p>\n<p>LOCALE_NOUSEROVERRIDE { do not use user overrides }<br \/>\nLOCALE_USE_CP_ACP { use the system ACP }<br \/>\nLOCALE_ILANGUAGE { language id }<br \/>\nLOCALE_SLANGUAGE { localized name of language }<br \/>\nLOCALE_SENGLANGUAGE { English name of language<br \/>\nLOCALE_SABBREVLANGNAME { abbreviated language name }<br \/>\nLOCALE_SNATIVELANGNAME { native name of language }<br \/>\nLOCALE_ICOUNTRY { country code }<br \/>\nLOCALE_SCOUNTRY { localized name of country }<br \/>\nLOCALE_SENGCOUNTRY { English name of country }<br \/>\nLOCALE_SABBREVCTRYNAME { abbreviated country name }<br \/>\nLOCALE_SNATIVECTRYNAME { native name of country }<br \/>\nLOCALE_IDEFAULTLANGUAGE { default language id }<br \/>\nLOCALE_IDEFAULTCOUNTRY { default country code }<br \/>\nLOCALE_IDEFAULTCODEPAGE { default oem code page }<br \/>\nLOCALE_IDEFAULTANSICODEPAGE { default ansi code page }<br \/>\nLOCALE_IDEFAULTMACCODEPAGE { default mac code page }<br \/>\nLOCALE_SLIST { list item separator }<br \/>\nLOCALE_IMEASURE { 0 = metric, 1 = US }<br \/>\nLOCALE_SDECIMAL { decimal separator }<br \/>\nLOCALE_STHOUSAND { thousand separator }<br \/>\nLOCALE_SGROUPING { digit grouping }<br \/>\nLOCALE_IDIGITS { number of fractional digits }<br \/>\nLOCALE_ILZERO { leading zeros for decimal }<br \/>\nLOCALE_INEGNUMBER { negative number mode }<br \/>\nLOCALE_SNATIVEDIGITS { native ascii 0-9 }<br \/>\nLOCALE_SCURRENCY { local monetary symbol }<br \/>\nLOCALE_SINTLSYMBOL { intl monetary symbol }<br \/>\nLOCALE_SMONDECIMALSEP { monetary decimal separator }<br \/>\nLOCALE_SMONTHOUSANDSEP { monetary thousand separator }<br \/>\nLOCALE_SMONGROUPING { monetary grouping }<br \/>\nLOCALE_ICURRDIGITS { # local monetary digits }<br \/>\nLOCALE_IINTLCURRDIGITS { # intl monetary digits }<br \/>\nLOCALE_ICURRENCY { positive currency mode }<br \/>\nLOCALE_INEGCURR { negative currency mode }<br \/>\nLOCALE_SDATE { date separator }<br \/>\nLOCALE_STIME { time separator }<br \/>\nLOCALE_SSHORTDATE { short date format string }<br \/>\nLOCALE_SLONGDATE { long date format string }<br \/>\nLOCALE_STIMEFORMAT { time format string }<br \/>\nLOCALE_IDATE { short date format ordering }<br \/>\nLOCALE_ILDATE { long date format ordering }<br \/>\nLOCALE_ITIME { time format specifier }<br \/>\nLOCALE_ITIMEMARKPOSN { time marker position }<br \/>\nLOCALE_ICENTURY { century format specifier (short date) }<br \/>\nLOCALE_ITLZERO { leading zeros in time field }<br \/>\nLOCALE_IDAYLZERO { leading zeros in day field (short date) }<br \/>\nLOCALE_IMONLZERO { leading zeros in month field (short date) }<br \/>\nLOCALE_S1159 { AM designator }<br \/>\nLOCALE_S2359 { PM designator }<br \/>\nLOCALE_ICALENDARTYPE { type of calendar specifier }<br \/>\nLOCALE_IOPTIONALCALENDAR { additional calendar types specifier }<br \/>\nLOCALE_IFIRSTDAYOFWEEK { first day of week specifier }<br \/>\nLOCALE_IFIRSTWEEKOFYEAR { first week of year specifier }<br \/>\nLOCALE_SDAYNAME1 { long name for Monday }<br \/>\nLOCALE_SDAYNAME2 { long name for Tuesday }<br \/>\nLOCALE_SDAYNAME3 { long name for Wednesday }<br \/>\nLOCALE_SDAYNAME4 { long name for Thursday }<br \/>\nLOCALE_SDAYNAME5 { long name for Friday }<br \/>\nLOCALE_SDAYNAME6 { long name for Saturday }<br \/>\nLOCALE_SDAYNAME7 { long name for Sunday }<br \/>\nLOCALE_SABBREVDAYNAME1 { abbreviated name for Monday }<br \/>\nLOCALE_SABBREVDAYNAME2 { abbreviated name for Tuesday }<br \/>\nLOCALE_SABBREVDAYNAME3 { abbreviated name for Wednesday }<br \/>\nLOCALE_SABBREVDAYNAME4 { abbreviated name for Thursday }<br \/>\nLOCALE_SABBREVDAYNAME5 { abbreviated name for Friday }<br \/>\nLOCALE_SABBREVDAYNAME6 { abbreviated name for Saturday }<br \/>\nLOCALE_SABBREVDAYNAME7 { abbreviated name for Sunday }<br \/>\nLOCALE_SMONTHNAME1 { long name for January }<br \/>\nLOCALE_SMONTHNAME2 { long name for February }<br \/>\nLOCALE_SMONTHNAME3 { long name for March }<br \/>\nLOCALE_SMONTHNAME4 { long name for April }<br \/>\nLOCALE_SMONTHNAME5 { long name for May }<br \/>\nLOCALE_SMONTHNAME6 { long name for June }<br \/>\nLOCALE_SMONTHNAME7 { long name for July }<br \/>\nLOCALE_SMONTHNAME8 { long name for August }<br \/>\nLOCALE_SMONTHNAME9 { long name for September }<br \/>\nLOCALE_SMONTHNAME10 { long name for October }<br \/>\nLOCALE_SMONTHNAME11 { long name for November }<br \/>\nLOCALE_SMONTHNAME12 { long name for December }<br \/>\nLOCALE_SMONTHNAME13 { long name for 13th month (if exists) }<br \/>\nLOCALE_SABBREVMONTHNAME1 { abbreviated name for January }<br \/>\nLOCALE_SABBREVMONTHNAME2 { abbreviated name for February }<br \/>\nLOCALE_SABBREVMONTHNAME3 { abbreviated name for March }<br \/>\nLOCALE_SABBREVMONTHNAME4 { abbreviated name for April }<br \/>\nLOCALE_SABBREVMONTHNAME5 { abbreviated name for May }<br \/>\nLOCALE_SABBREVMONTHNAME6 { abbreviated name for June }<br \/>\nLOCALE_SABBREVMONTHNAME7 { abbreviated name for July }<br \/>\nLOCALE_SABBREVMONTHNAME8 { abbreviated name for August }<br \/>\nLOCALE_SABBREVMONTHNAME9 { abbreviated name for September }<br \/>\nLOCALE_SABBREVMONTHNAME10 { abbreviated name for October }<br \/>\nLOCALE_SABBREVMONTHNAME11 { abbreviated name for November }<br \/>\nLOCALE_SABBREVMONTHNAME12 { abbreviated name for December }<br \/>\nLOCALE_SABBREVMONTHNAME13 { abbreviated name for 13th month (if exists) }<br \/>\nLOCALE_SPOSITIVESIGN { positive sign }<br \/>\nLOCALE_SNEGATIVESIGN { negative sign }<br \/>\nLOCALE_IPOSSIGNPOSN { positive sign position }<br \/>\nLOCALE_INEGSIGNPOSN { negative sign position }<br \/>\nLOCALE_IPOSSYMPRECEDES { mon sym precedes pos amt }<br \/>\nLOCALE_IPOSSEPBYSPACE { mon sym sep by space from pos amt }<br \/>\nLOCALE_INEGSYMPRECEDES { mon sym precedes neg amt }<br \/>\nLOCALE_INEGSEPBYSPACE { mon sym sep by space from neg amt }<br \/>\nLOCALE_FONTSIGNATURE { font signature }<br \/>\nLOCALE_SISO639LANGNAME { ISO abbreviated language name }<br \/>\nLOCALE_SISO3166CTRYNAME { ISO abbreviated country name }<\/p>\n<p>URL:<br \/>\nhttp:\/\/delphi.cjcsoft.net\/\/viewthread.php?tid=45725<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I got this info from a website that showcases all of the identifiers for each pc. Thought of posting it here also in my blog for future references Question: How can I determine various locale information using delphi? Answer: Delphi has a function called GetLocaleInfo which you can use to retrieve information such as the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/basicwebsitesolutions.com\/blog\/2018\/02\/10\/delphi-retrieving-various-locale-information\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Delphi : Retrieving various locale information&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,1,2],"tags":[],"class_list":["post-110","post","type-post","status-publish","format-standard","hentry","category-delphi-and-interbase","category-life-as-a-programmer","category-windows-and-beyond"],"_links":{"self":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":2,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"predecessor-version":[{"id":120,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/110\/revisions\/120"}],"wp:attachment":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}