Re: [api-dev] Basic: reading Locale from configuration returns only language for Dutch installation

2009-02-01 Thread Cor Nouws

Hello Ariel,

Ariel Constenla-Haile wrote (1-2-2009 1:46)

On Saturday 31 January 2009 22:14, Cor Nouws wrote:


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:

oLibs = GlobalScope.BasicLibraries
If NOT oLibs.isLibraryLoaded(Tools) Then oLibs.loadLibrary(Tools)


   ( I once understood -but did not check the source code- that
 LoadLibrary itself checks if a library is already loaded. )



Dim aLocale as New com.sun.star.lang.Locale 
aLocale = GetStarOfficeLocale()


Thanks - probably it happens more oftne that I write code for existing 
functions ;-)



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)?


 Nederlands(NL).


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
   valueen-US/value
  /prop
 /node


I had a look there already yesterday before posting.
And it only has nl


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


I'm not sure if that is wrong - see mail Bernard Marcelly.

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?


Yes I know the setup.xcu. And that shows only nl as well.
I'll try later to start with a fress setup.

But the question came up, since for the StringResourceWithLocation (see 
mail on d...@extensions, 16-1-09 (1) ) I need to give a Locale as 
argument. Plus that I see that the files with the strings, indeed are 
named DialogStrings_nl_NL.properties and DialogStrings_fr_FR.properties


I did not check yet if StringResourceWithLocation does allow for an 
Locale with only a value for the country. But definitely there is a 
routine somewhere, that makes it possible for 'locales' nl and fr to 
be used to find the above mentioned files.


Regards,
Cor


1) http://extensions.openoffice.org/servlets/ReadMsg?list=devmsgNo=1507


--
Cor Nouws-nl.OpenOffice.org marketing contact
=  2008: The Year of 3  =  www.nieuwsteoffice.nl  =

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



Re: [api-dev] Basic: reading Locale from configuration returns only language for Dutch installation

2009-02-01 Thread Cor Nouws

Hi Bernard,

Bernard Marcelly wrote (1-2-2009 8:36)
A Locale is primarily a language (the first part, lower case). This 
language may or not be specialised for a particular country (the second 
part, upper case).


The language of your installation depends on the langpack it uses. The 
Locale is indicated in the file names of the installation package.

You can see in the mirror servers that exists:
en-US, fr, de, nl
But not fr-FR, not fr-BE, not nl-NL. This simply means that there is no 
country variant langpack available in OpenOffice.
In the langpacks for 3.0.1RC2 however I can see en-US, en-GB, en-ZA 
(i.e. english variant of South-Africa).


I did not think yet at the link with the names of the packages. Sounds 
quite logic :-)


Thanks
Cor


--
Cor Nouws-nl.OpenOffice.org marketing contact
=  2008: The Year of 3  =  www.nieuwsteoffice.nl  =

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



Re: [api-dev] Basic: reading Locale from configuration returns only language for Dutch installation

2009-02-01 Thread Ariel Constenla-Haile
Hello Cor,

On Sunday 01 February 2009 20:23, Cor Nouws wrote:
  Is this also wrong ( ooLocale is nl and not nl-NL?)?

 I'm not sure if that is wrong - see mail Bernard Marcelly.

Bernard is completely right: there are no language packs for every Spanish 
speaking country in Latin America + Spain, only es. 


 But the question came up, since for the StringResourceWithLocation (see
 mail on d...@extensions, 16-1-09 (1) ) I need to give a Locale as
 argument. Plus that I see that the files with the strings, indeed are
 named DialogStrings_nl_NL.properties and DialogStrings_fr_FR.properties

 I did not check yet if StringResourceWithLocation does allow for an
 Locale with only a value for the country. 

yes it does :-) (I even tryied passing an empty css.lang.Locale, and seems to 
be clever/tolerant enough)


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



Re: [api-dev] Basic: reading Locale from configuration returns only language for Dutch installation

2009-02-01 Thread Cor Nouws

Hello Ariel,

Ariel Constenla-Haile wrote (2-2-2009 5:32)

On Sunday 01 February 2009 20:23, Cor Nouws wrote:



But the question came up, since for the StringResourceWithLocation (see
mail on d...@extensions, 16-1-09 (1) ) I need to give a Locale as
argument. Plus that I see that the files with the strings, indeed are
named DialogStrings_nl_NL.properties and DialogStrings_fr_FR.properties

I did not check yet if StringResourceWithLocation does allow for an
Locale with only a value for the country. 


yes it does :-) (I even tryied passing an empty css.lang.Locale, and seems to 
be clever/tolerant enough)


Indeed. I passed xx_YY when I started to create a fall back in my own 
piece of code ... but the fall back already is there: Service 
StringResourceWithLocation has the property DefaultLocale.


Cor

--
Cor Nouws-nl.OpenOffice.org marketing contact
=  2008: The Year of 3  =  www.nieuwsteoffice.nl  =

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



Re: [api-dev] Basic: reading Locale from configuration returns only language for Dutch installation

2009-01-31 Thread Bernard Marcelly

Message de Cor Nouws  date 2009-02-01 01:14 :

reading this
http://api.openoffice.org/docs/common/ref/com/sun/star/i18n/LanguageCountryInfo.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:


Hi Cor,
A Locale is primarily a language (the first part, lower case). This 
language may or not be specialised for a particular country (the second 
part, upper case).


The language of your installation depends on the langpack it uses. The 
Locale is indicated in the file names of the installation package.

You can see in the mirror servers that exists:
en-US, fr, de, nl
But not fr-FR, not fr-BE, not nl-NL. This simply means that there is no 
country variant langpack available in OpenOffice.
In the langpacks for 3.0.1RC2 however I can see en-US, en-GB, en-ZA 
(i.e. english variant of South-Africa).


Regards
  Bernard

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