translate scripts



  • Hello Arkthus,

    With pleasure. Until I put them on the github (I finish a script in progress before transferring them), I can already send them to you by email if you want.

    Hello Xansta,

    Thank you for your answers. E2. Ok, I will adapt the text message accordingly

    I created a Github account, as soon as I have a little time I will put them online. I'm waiting to finish translating and testing Defender Hunter.

    I have also updated your latest updates. :-)

    Hello Khornu,

    It's good news. Like I said above, I will put all the translated .lua scripts online

    The .lua files that I haven't translated yet are the tutorials and following scenarios: 49, 50, 54, 56, 57, 58, 59, 60 and 62. Everything else is already translated and fixed.

    So that all the scenarios are translated, if you want to take care of these scenarios first, people can have everything faster.

  • edited March 2020

    Hey @muerte ,

    I understood from this thread that you haven’t been able to translate everything (only full sentences).

    I created a Simple system that allows us to translate everything, whether it’s a full sentence in a comm message or a ship name in a parameter that you shouldn’t change otherwise. And it is extensible to other languages.

    It also allows people to switch languages in a few clicks without having to overwrite scripts.

    I have no idea how you did it, or whether you’ve been able to translate everything. If you did, I’d be happy to help you finish the translation.

    If not, we can integrate you translations in my system quite easily, so no work is lost ;)



  • In the mean time, I'll look into the translation of the GUI

  • I've created an issue on GitHub to present my solution.

    You can find it right here :

    Please have a look and tell me what you think about it.

  • Hi there,

    I created a pull request for my translation mechanism :

    It does not include scenarios translations (as you already translated them) besides 00_basic (for reference).

    It however contains common data translations (ships, stations, factions, global comms).

  • FYI,

    there’s been quite a long discussion with Daid about this.

    We abort my system, ‘cause he already implemented one.

    He also shared a documentation on how we should translate scripts :

    If you are not confortable editing the scripts, I can do it, and then you copy-paste your translations in the translation file.

    Khörnu / Aprexia

  • It means that :

    1 the modifications of the lua files ((_...)) by Daid, I have to make the same modifications on the files that I have translated?

    2 Or do I just have to rename my translated lua files to

    3 Or do the files only contain the translated text? And that I have to take the files and transfer only the translated text inside?

  • edited March 2020


    1. Yes, but it can be tricky with texts that contains dynamic values
    2. Nope, fr.po file is a new one that contains only translations
    3. Yes that's it ;)

    Daid asked for every script to have it's own pull request so I propose we work together on this.

    Please contact me on Discord : Aprexia#6886 so we can voice chat about it ;)

    I propose I do the coding part and you do the fr.po file part as I'm better at programming than in english and I understood you are better at translating than programming ;)

    I can test (EE development environment all set up) and deal with the GitHub pull requests as well.

    See you

  • There is also a quite comfortable way to edit the .po files:

  • edited March 2020

    OK, thanks.

    Yes why not but I will still wait to see the new version of the game to understand how it works a little more and if it is really good.

    Big scenarios like 53_escape which makes 5600 lines we will have to start all over. Ok for the sentences in the second file fr.po but for the words translated everywhere: Example: goodsList = {{"nourriture",0}, {"medicaments",0},

    How will it be?

  • edited March 2020

    I’ll do the whole translation of 1 shared data file and 1 scenario so you can have a concrete example.

    Then, a little screen sharing session would be worth 1000 words ;)

  • I don't have Discord.

    Give me an email that I send you what I have already translated + the last 2 lua files modified by Daid.

    I'm not that good in English, I use Google translation a lot, then I modify, correct and test the scenarios so that the translation is really as consistent as possible with the story. Which means that I spent a lot of time there.

  • edited March 2020

    Yes why not but I will still wait to see the new version of the game to understand how it works a little more and if it is really good.

    The new version of the game won't look different in that regard, unless someone actually starts translations.

    That system is used in a vast number of projects, so I think there are chances you could consider it good as well :-)

    To your question how the translation files will look like, you can just have a look at the example file daid provided for the main part. (don't intent to completely translate that yet, as it is far from complete).

    You basically have to fill out the msgstr parts, while letting the original english strings untouched. Or as I said before, just load the files into poedit.

    So in essence, waiting for the new game version won't do much, wait for Khörnu providing you with po files instead :-)

  • edited March 2020

    Thanks BlueShadow, I'm going to watch this.

    I wanted to wait for the new version because I thought there would be an integrated selection button to choose the language

    My main question is: Isn't it heavier and "redundant" in the end than simply overwriting the files with fr files? Knowing that I have modified the presentation a little, which appear on the selecting scenarios screen for clarity.

  • edited March 2020

    Problem with "simply overwriting the files with fr files" is that it's not maintainable in the long run. Every time a scenario gets updates/fixes/improvements/additions you need to put those in your translated version as well. (You are free to maintain these translated copies, but it's not something that will end up in the main distribution)

    Also, for scenarios, I haven't setup the support scripts yet. So it doesn't generate the "base files" (english files without translation) for those yet. As I want to make sure I cover the names/variants/descriptions of scenarios as well, and those require a bit of special handling.

    For more complex things in scenarios, where strings are used in multiple places, there are various solutions. The best solution depends on the actual case. But for example, you can mark multiple strings with _(), and it will end up in the translation .po file only once. Ensuring consistent translation. The _() function does not care where it is used, it simply translates the input to the output.

    You can however have cases where these strings have a secondary use as well. Borderline Fever is one of these cases. In which case you should only use the _() function when it gets displayed to the user. But then this display does not contain a static string, so it won't get picked up by the tooling generating the base translation file. So then there needs to be a "shadow list" of these words somewhere in the script with these words surrounded by _().

    As for dynamic values. Those will require proper format calls. For example, from Borderline Fever: ctd.characterDeadEnd = "Never heard of " .. ctd.character needs to become: ctd.characterDeadEnd = string.format(_("Never heard of %s"), ctd.character)

  • I wanted to wait for the new version because I thought there would be an integrated selection button to choose the language

    That button would just be an options.ini switch by now, so not much to see here.

    My main question is: Isn't it heavier and "redundant" in the end than simply overwriting the files with fr files?

    Of course it will be redundant in the sense that you would have to do many of your work again. But on the bright side, the hard translation part is already done and you just have to copy and paste it (which is still quite tedious for sure).

    And of course it is heavier in the sense that new code was included. But I don't think that will have much impact. And daid has already done that, so what? And I can't emphasize this strongly enough, that system is very common.

    And don't forget the advantages: The point of that system is to seperate the programming from the translation. You don't have to translate in the code files, with the risk of accidentally editing code parts. Just use poedit to edit the po files. Also, you will always see the original text to check your translation instead of overwrite it. And as daid mentioned, the translation will also be much easier to maintain.

  • @muerte :

    send me a mail there, I’ll give you a real one. I just don’t wanna share a real e-mail address in a public forum ;)

  • But for example, you can mark multiple strings with _(), and it will end up in the translation .po file only once. 

    What should we do with this kind of stuff :


    Something something]]



    Something something

    And by the way potatoes patatoes]]

    Should we separate the second one in two different strings so the first part is translated only once ?

    Or should we copy paste the translation of the first part for both texts ?

  • @daid : Its seems like it works really fine with common data (e.g. FactionInfo), but I can't get it to work with scenarios.

    I tried a proper scenario and a tutorial, none of which appeared in French in the game.

    I saved the .po right next to the scenario file (in scripts directory) but nothing happens :/

  • Sorry, I changed that but forgot to update the wiki page. By placing the .po files next to the script files, the scripts folder became a bigger mess. So I changed it so it should look like:


    I've also added a python script ( that will generate the base files. It sets scenario names and descriptions as well, but the code that reads those does not translate them yet. So you can start translating there, but you won't see the results.

    Variations still need to be processed by the script.

  • Also, I notice that you guys are directly running into every single problem that is in the code related to translations (faction names, system names to name two) so please do not get frustrated that I do not accept changes yet and want those issues solved. It's a bunch of tough hurdles that we need to fix but after that, it should start to become relatively effortless.

    I posted this on a github issue as well, but I think it's good to repeat this, top priority for me are:

    1. Do not break scenario scripts when language is changed
    2. Do not break features if clients use a different language then the server (it is accepted that comms message will not match your selected language)

    So, if the option is between breaking one of those rules and not having a certain field/piece of text translated. I will opt not translating it.

  • Thanks ;)

    Yep no worries, that a fair point.

    I wouldn’t wanna break anything either ;)

  • @daid : I works just fine for both Common Data and regular scenarios now.

    It still doesn't with tutorials though :/

  • edited March 2020
  • BTW : is there a way to fast-forward the scenarios so I don't have to play them all to test my translations ?

  • I pulled your last commit.

    It seems like I can't build anymore :

    [build] [2/3  33% :: 0.666] Building CXX object CMakeFiles/EmptyEpsilon.dir/C_/Users/lacom/source/repos/EmptyEpsilonFork/SeriousProton/src/i18n.cpp.obj
    [build] FAILED: CMakeFiles/EmptyEpsilon.dir/C_/Users/lacom/source/repos/EmptyEpsilonFork/SeriousProton/src/i18n.cpp.obj 
    [build] c:\Users\lacom\source\repos\EmptyEpsilonFork\EmptyEpsilon\..\mingw32\bin\g++.exe  -DDEBUG -DSFML_NO_DEPRECATED_WARNINGS -DVERSION_NUMBER=20200310 -DWINDOW_TITLE=\"EmptyEpsilon\" -I../../src -I../../../SeriousProton/src -IC:/Users/lacom/source/repos/EmptyEpsilonFork/SFML-2.5.1/include -Wall -g   -std=gnu++11 -MD -MT CMakeFiles/EmptyEpsilon.dir/C_/Users/lacom/source/repos/EmptyEpsilonFork/SeriousProton/src/i18n.cpp.obj -MF CMakeFiles\EmptyEpsilon.dir\C_\Users\lacom\source\repos\EmptyEpsilonFork\SeriousProton\src\i18n.cpp.obj.d -o CMakeFiles/EmptyEpsilon.dir/C_/Users/lacom/source/repos/EmptyEpsilonFork/SeriousProton/src/i18n.cpp.obj -c C:/Users/lacom/source/repos/EmptyEpsilonFork/SeriousProton/src/i18n.cpp
    [build] C:/Users/lacom/source/repos/EmptyEpsilonFork/SeriousProton/src/i18n.cpp: In member function 'bool i18n::Catalogue::load(const string&)':
    [build] C:/Users/lacom/source/repos/EmptyEpsilonFork/SeriousProton/src/i18n.cpp:59:19: error: 'io' has not been declared
    [build]      auto stream = io::ResourceProvider::get(resource_name);
    [build]                    ^~
    [build] [2/3  66% :: 1.121] Building CXX object CMakeFiles/EmptyEpsilon.dir/src/tutorialGame.cpp.obj
    [build] FAILED: CMakeFiles/EmptyEpsilon.dir/src/tutorialGame.cpp.obj 
    [build] c:\Users\lacom\source\repos\EmptyEpsilonFork\EmptyEpsilon\..\mingw32\bin\g++.exe  -DDEBUG -DSFML_NO_DEPRECATED_WARNINGS -DVERSION_NUMBER=20200310 -DWINDOW_TITLE=\"EmptyEpsilon\" -I../../src -I../../../SeriousProton/src -IC:/Users/lacom/source/repos/EmptyEpsilonFork/SFML-2.5.1/include -Wall -g   -std=gnu++11 -MD -MT CMakeFiles/EmptyEpsilon.dir/src/tutorialGame.cpp.obj -MF CMakeFiles\EmptyEpsilon.dir\src\tutorialGame.cpp.obj.d -o CMakeFiles/EmptyEpsilon.dir/src/tutorialGame.cpp.obj -c ../../src/tutorialGame.cpp
    [build] ../../src/tutorialGame.cpp: In constructor 'TutorialGame::TutorialGame(bool, string)':
    [build] ../../src/tutorialGame.cpp:53:28: error: 'PreferencesManager' has not been declared
    [build]      i18n::load("locale/" + PreferencesManager::get("language", "en") + ".po");
    [build]                             ^~~~~~~~~~~~~~~~~~
    [build] ../../src/tutorialGame.cpp:54:37: error: 'PreferencesManager' has not been declared
    [build]      i18n::load("locale/tutorial." + PreferencesManager::get("language", "en") + ".po");
    [build]                                      ^~~~~~~~~~~~~~~~~~
    [build] ninja: build stopped: subcommand failed.
    [build] La build s'est achevée avec le code de sortie 1
    [main] Échec de la préparation de la cible exécutable nommée 'undefined'
  • Depends on the scenario. Some have build-in options in the GM screen.

  • @daid : I think our messages have crossed, have you seen my last one ?

    Thnaks for the answer though ;)

  • @Khörnu until this it fixed, you can easily apply the fix by yourself. Just open the file tutorialGame.cpp and add this line at the top:

    #include "preferenceManager.h"

  • Thanks,

    Sorry I have no clue in C++ :D

Sign In or Register to comment.