devxlogo

Retrieve Localization Strings

Retrieve Localization Strings

Use this API function wrapper to retrieve localization and personalization information:

 Private Declare Function GetLocaleInfo Lib _	"kernel32" Alias "GetLocaleInfoA" (ByVal _	Locale As Long, ByVal LCType As Long, ByVal _	lpLCData As String, ByVal cchData As Long) _	As Long Public Function WinLocaleInfo(ByVal lnfoType As _	Long) As String	Dim sLCData As String	Dim nRet As Long	nRet = GetLocaleInfo(0, lnfoType, sLCData, 0)	If nRet Then		sLCData = Space$(nRet)		nRet = GetLocaleInfo(0, lnfoType, _			sLCData, Len(sLCData))		If nRet Then			WinLocaleInfo = Left$(sLCData, nRet)		End If	End IfEnd Function

Here are some of the handier parameters you can use for information:

 	LOCALE_SCURRENCY = &H14	' local monetary symbol	LOCALE_SDATE = &H1D	' date separator	LOCALE_SDAYNAME1 = &H2A	' long name for Monday	LOCALE_SDECIMAL = &HE	' decimal separator
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist