Hello Cor,

On Saturday 31 January 2009 22:14, Cor Nouws wrote:
> Hi *,
>
> reading this
> http://api.openoffice.org/docs/common/ref/com/sun/star/i18n/LanguageCountry
>Info.html and knowing what is returned for other languages ("en_GB" for
> exmaple), I wonder how it is possible that for my local Dutch installation,
> I get only "nl" as return value in this function:
>
>    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())
>
>    OOoLangue = oSet.getbyname("ooLocale")  ' might be xx_XX of only xx

>    OOoLanguage = Lcase(Left(trim(OOoLangue),2))
>    OOoCountry = UCase(Right(trim(OOoLangue),2))

you can save your time by reusing existing code: OOo Basic libraries :-)
in this case:

Sub oooLocale
        Dim oLibs
        oLibs = GlobalScope.BasicLibraries
        If NOT oLibs.isLibraryLoaded("Tools") Then oLibs.loadLibrary("Tools")
        
        Dim aLocale as New com.sun.star.lang.Locale     
        aLocale = GetStarOfficeLocale()
End Sub


> Which retuns 'nl' and 'NL' or 'en' and 'GB' etc...
>
> But that might be wrong in some situations. Plus that I don not
> understand what really is the cause of this.
>
> Any ideas?


What do you see under Tools - Options - Language Settings - Languages?:

Languege of
                User interface ....

do you see "Dutch" or "Dutch (Netherlands)"?

If the first, then it is a general OOo issue.
If the second, something may be wrong in your configuration. 

First look at the node, something like

 <node oor:name="L10N">
  <prop oor:name="ooLocale" oor:type="xs:string">
   <value>en-US</value>
  </prop>
 </node>

Is this also wrong ( ooLocale is nl and not nl-NL?)?

If so, try removing the Setup.xcu in the user layer 
~/.openoffice.org/3/user/registry/data/org/openoffice/Setup.xcu (and may be 
also 
the cache in ~/.openoffice.org/3/user/registry/cache/org.openoffice.Setup.dat), 

I don't know if the value is taken from a localized Setup.xcu in the shared 
layer, or OOo sets this at installation on the user layer; at least, the 
default installation 
(/opt/openoffice.org/basis3.0/share/registry/data/org/openoffice/Setup.xcu) has 
the L10N node empty; don't have a localized version to check, but in yours: is 
the L10N node empty? if not, ooLocale is nl or nl-NL?


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


"Aus der Kriegsschule des Lebens
                - Was mich nicht umbringt,
        macht mich härter."
                Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to