I use the GetLocale() macro from Andrew Macros to get the locale name of the system (see code below).
A brazilian user of my applications (TexMaths) has a 'pt_BR' locale, but the GetLocale() macro only returns 'pt'. So, it's not possible to distinguish between portuguese and brazilian portuguese.
Is there a way to get the complete locale name or, at least, the country name?
Any help much appreciated,
RB
Code: Select all
' Get application locale
' Author : Laurent Godard
' e-mail : listes.godard@laposte.net
Function GetLocale() as string
Dim oSet as Variant, oConfigProvider as Variant
Dim oParm(0) As New com.sun.star.beans.PropertyValue
Dim sProvider as String, sAccess as String
sProvider = "com.sun.star.configuration.ConfigurationProvider"
sAccess = "com.sun.star.configuration.ConfigurationAccess"
oConfigProvider = createUnoService(sProvider)
oParm(0).Name = "nodepath"
oParm(0).Value = "/org.openoffice.Setup/L10N"
oSet = oConfigProvider.createInstanceWithArguments(sAccess, oParm())
Dim str as String
str = oSet.getbyname("ooLocale")
print str
GetLocale() = str
End Function