| View previous topic :: View next topic |
| Author |
Message |
serge.sterck@fmsb.be Newbie

Joined: 08 Feb 2006 Posts: 1 Location: Brussel
|
Posted: Wed Feb 08, 2006 1:04 pm Post subject: Help get current language in openoffice basic |
|
|
Hello i have created a addon that created a new toolbar but i must support 2 languages
here is a part of my xcu file
<node oor:name="btn01" oor:op="replace">
<prop oor:name="Context" oor:type="xs:string">
<value>com.sun.star.text.TextDocument</value>
</prop>
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="fr-BE">Nouveau_document</value>
<value xml:lang="nl-BE">Nieuw_document</value>
</prop>
<prop oor:name="URL" oor:type="xs:string">
<value>macro:///doc306fr.Module1.Nouveau_document</value>
</prop>
<prop oor:name="Target" oor:type="xs:string">
<value>_self</value>
</prop>
<prop oor:name="ImageIdentifier" oor:type="xs:string">
<value>%origin%/doc306fr/bitmaps/bt_01</value>
</prop>
</node>
as you see i can select the language to display the toolltip
but i'm not be able to do the same for the macro://........
so i need to test in my macro witch is the current language can somebody tell
me how to do this in oobasic
many thx  _________________ Serge Sterck
Chef de service informatique adjoiint |
|
| Back to top |
|
 |
Pitounet OOo Enthusiast


Joined: 26 May 2005 Posts: 172 Location: Toulouse / France
|
Posted: Thu Feb 09, 2006 1:14 am Post subject: |
|
|
Hi,
Does this macro (which use OOo 2.0 macros libraries) solves your problem?
| Code: | Sub TestLanguage
Dim oLocale
Dim oLanguage
' Use function of the Standard OOo library
oLocale = GetStarOfficeLocale()
oLocale = ThisComponent.CharLocale
oLanguage = oLocale.Language
End Sub |
oLanguage will give you "fr" for a french version of OOo.
Antoine. |
|
| Back to top |
|
 |
|