OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Help get current language in openoffice basic

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
serge.sterck@fmsb.be
Newbie
Newbie


Joined: 08 Feb 2006
Posts: 1
Location: Brussel

PostPosted: Wed Feb 08, 2006 1:04 pm    Post subject: Help get current language in openoffice basic Reply with quote

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 Wink
_________________
Serge Sterck
Chef de service informatique adjoiint
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Pitounet
OOo Enthusiast
OOo Enthusiast


Joined: 26 May 2005
Posts: 172
Location: Toulouse / France

PostPosted: Thu Feb 09, 2006 1:14 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group