Some tutorial on making extension's UI multilingual?

I have a working extension which adds a few menu items across most LO components. Those menu items are “hard coded” in English language. Now I want to extend the language of those added menu items (well, at least a few languages), so it can follow the general UI language of the LO itself as it happens to be at one moment or the other.

I mean (hypothetical examples):

  • English UI for LO ? => extension’s menu also in English
  • French UI for LO ? => extension’s menu also in French by using its built-in translation
  • German UI for LO ? => extension’s menu also in German by using its built-in translation
  • [some language that is not available also for extension] UI for LO ? => extension’s menu fallback in English

Is this possible ? If yes, some tutorial on this ?

Yes, possible. No idea about a tutorial. There are different approaches. Take a look at such extensions as OOoFBTools and Anaphraseus.

Also, I created an extension that adds a menu item appearing localized (I have only three languages, English, Belarusian, Russian). Nothing sophisticated though. The link to download:

Yes, following your model it worked well – which means adding <value xml:lang="xx">translated string</value> under the original <value>original string</value> in Addons.xcu file, with xx as ISO639-1 lang ID. Thank you :slight_smile:

Note: you could move or add this comment as a possible answer instead.

Re-posting my comment as an answer because the asker has found it helpful enough (and combining with the asker’s comment):

Yes, possible. No idea about a tutorial. There are different approaches (including storing localized strings in separate resource files). Take a look at such extensions as OOoFBTools and Anaphraseus.

Also, I created an extension that adds a menu item appearing localized (I have only three languages, English, Belarusian, Russian). Nothing sophisticated though. The link to download:

In the extension, Addons.xcu file follows the model of adding <value xml:lang="xx">translated string</value> under the original <value>original (default) string</value> (“xx” being an ISO language code, “de”, “ru” etc.).