[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libreoffice-users] Localized Basic macros


Hi!
I'm playing a little with macros (my level is probably one step or two
above beginner) and making extensions out of them. I found a few examples
online and I got it to work.

I don't know if I'm going to share anything in the future (because I don't
think my extensions will fulfil anyone else's needs than my own and they
are probably poorly written anyway), but if I want to do that, there's a
minor problem: My macros interact with the user (usually me) in Swedish,
and I guess it would be a good idea to at least write an English version
for sharing with others.

However, it would be nice if the extension adapts to the user's locale when
installed (and falls back to English when the user's locale is not
available, that is in most cases). Is that possible? A link to some guide
of some sort would be appreciated. I found nothing so far.

Experimenting with the stuff gave me nothing yet. All I came up with is a
box in the Basic IDE in which I can select a language, but I'm not sure how
to use it. After adding some languages I can now select en-US and sv-SE,
but then what? Should I just copy all of the code to a new module,
translate everything there and select the language I used in that box?

And what do I need to do when packaging the whole thing? I realised a few
things. For instance in the Addons.xcu file, I can use several different
languages for the tool tip text like so:
<value xml:lang="en">My description</value>
<value xml:lang="sv-SE">Min beskrivning</value>

But in my library folder (the one LibreOffice created for me when exporting
as Basic library), there are three files:
dialog.xlb
MyMacro.xba
script.xlb
If I want to use several languages, what would happen here? Or would there
be one ”library” for each language?

So, obviously I haven't grasped the concept for this at all yet. Any hints?



Kind regards

Johnny Rosenberg

--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Follow-Ups:
Re: [libreoffice-users] Localized Basic macrosjean-francois <jean-francois.nifenecker@laposte.net>
Re: [libreoffice-users] Localized Basic macrosRegina Henschel <rb.henschel@t-online.de>
Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.