UserInterface Translate()

Lua

Information and discussion for custom maps and mods.
Post Reply
Adrian
Posts: 73
Joined: Wed Feb 12, 2020 5:44 pm

UserInterface Translate()

Post by Adrian »

I read OpenRa Lua documentation now.
https://docs.openra.net/en/release/lua/

And I found a function without description: Translate().
May I ask, what is this?

abcdefg30
Posts: 643
Joined: Mon Aug 18, 2014 6:00 pm

Re: UserInterface Translate()

Post by abcdefg30 »

It is part of the ongoing translation system implementation. You can see translation keys (which are the inputs to this function) and their values (the output of this function) in the "en.ftl" file(s). Our default missions already use this for the English translation.

Adrian
Posts: 73
Joined: Wed Feb 12, 2020 5:44 pm

Re: UserInterface Translate()

Post by Adrian »

It's interesting.

I try to change something in the "en.ftl" file. The text changing in the game too.
What if I (or somebody) create "abcd.ftl" file for abcd language?

Can I choose this language (this file) somewhere in settings?
Or it does not work yet?
Or it does not work this way?

abcdefg30
Posts: 643
Joined: Mon Aug 18, 2014 6:00 pm

Re: UserInterface Translate()

Post by abcdefg30 »

Changing the language is not exposed yet as the translation system is not complete, but in the future you will be able to use new .ftl files for different languages.

Post Reply