Translation tool

Hi there, what is the best translation tool for Xojo?

In Ruby, there is

You just write in the code like _(“my Awesome Label”) and then with tools like poEdit you can translate that text in any language. Or, in our case: Translation is made by Customers.
Dont have to invent keys for every text piece, you just write the App in one language and then translate to another.

is there any similar tool for xojo?

Or, What do you prefer?


For Xojo there is an app called Lingua which really sucks. Thomas Tempelmann wrote an app called Open Lingua. I updated the app and added Deepl support. With Open Lingua you can also export to csv and then import the changed valued from csv. App is available at Xojo + Alfred .

So, i see that that, my idea, not is available yet.
Currently i do’nt have the time for writing ist.
I am a Ruby Programmer, i wrote just 2 apps in Xojo.
But it could save a lot of time for many developers, so i post the idea, for the case anyone wants to write it.
And if, i also want to use it :slight_smile:

At the end it would be not more than a little command-line tool and one xojo class.

So, let’s say, having a Xojo Class, called “L”, with a single constructor method and a command line tool, call it “xojo-translator” by example. In class App could be a string property “CurrentLanguage” for that the class “L” would be always referring to.

Inside the App Code:

a) label1.text = L(“Create new record”)
b) label2.text = L(“Create next record”)
c) label3.text = L(“main-window|Create new record”)
=> all before the pipe is a optional, internal, additional key, for separating translations. Escaping of pipe should be possible, if you need pipe as text
d) label4.text = L(“Create new record”)
=> same as a) results in one translation for both

and, if nothing more is done, the Labels on the UI would result in:

a) “Create new record”
b) “Create next record”
c) “Create new record”
d) “Create new record”

no additional work for the developer, the app would already run.
The huge advantage is that you can search for labels, in the primary language, directly in the app code and having not to handle annoying placeholders for every translation or Constants. In Rails, we save a lot oft time with that. Gettext has 24 mio downloads.

So, the next feature, if you want to add translations, go to the terminal, cd into the app directory and make:

$ xojo-translator --add-languages de

then it would generate a Yaml file inside the app, lets say under “locales/de.yml”. Spaces would be replaced by underscore:

   de: "Neuen Datensatz erstellen"
      de: "Datensatz erstellen"

this yml file, you could edit by a simple text editor.
If the xojo class “L” finds a translation for the selected language ist selects that and the fallback is always the original string. On every run of $ xojo-translator the lib would run through the app code, adding missing keys inside the existing languages and purge keys that are not used anymore. Note: Wrapping text strings in quotes, like this example, is optional, in yaml.

it may be necessary saving the app not as xojo-binary-project for that the lib is able to reading app code. But, there are enough profis here for such special questions.

In our case the translation files are synced to nextcloud, by a sync script combined with the nextcloud client. So, also the customer or other developers can access and translations and add own languages. So the work of the developer is just write the app in one language. Translating of technical terms in specific language is much better done by the customer itself.

better than the .yml format could be a format for a official translation UI like PO Edit

So, the idea is out of my head :slight_smile:


You don’t have to re-invent the wheel as Lingua is capable of doing most of this. Maybe you first have a look at it or Beatrix/Thomas fork.

Searching and replacing in code is - in my opinion - a really bad idea. A lot of potential for bad mistakes…

1 Like

Hi Thomas,

Searching and replacing in code is - in my opinion - a really bad idea

Replacing in Code is not the idea! - just analyzing.

What the lib does is to modify the translation files (not the app code) and thats the time saver.
like said: this practice is tested: 25 million downloads in rails community.

and, like said: i checked Lingua. Working with Constant Editor, hundreds of constants, is a tedious task, from my view. Always have to check for doubles! You are not able to give the work to the customer! At the end, i would not translate the app. Thats a lot of work which can be done by machine. With a feature like above i work every day in rails: Writing a app for multiple languages is not much more work than writing a single language app.

Working with the Constant Editor is - in my opinion - a good and easy way to localize Xojo apps - I use this way in everyone of my apps. German and English are part of every app, some are localized to up to seven languages, without the need of an external tool.

You can give Lingua and the translation file to customers, Lingua is freely available.

Automated translations in Lingua, like Beatrix DeepL Integration in OpenLingua, is a helpful feature.

Thanks, Thomas, for Discussion!
good to know your experience in short words.
For me, like said, for my few apps i will not write a tool.