Hi there,
I've seen people ask for translations for the game for the longest time, and we're on our way to create something more official, using crowdsourced translations. But, in the meantime, if you wish to translate the game, there are several tools at your disposal :
Calling labels, and how the game does it :
The game has a function in the Game class to select different dialogues based on the language class attribute defined there. To change that attribute, it's just a matter of writing this piece of code in a separate ".rpy" file.
The game will then, every time a dialogue is called, look for the label name + the language string at the end. For instance, the label "bank_liu_account_info" has the english version in, to overwrite that dialogue, you'd have "bank_liu_account_info_fr" or "bank_liu_account_info_es" depending on the value of the language string.
This method can be used to translate any normal dialogues in the game.
For cutscenes :
For cutscenes, every cutscene uses the "FilteredText" displayable, which means that you have to set "config.say_menu_text_filter" to a function that will take the original string as an argument, and returned a changed string.
Keep in mind that renpy won't handle dicts that are too large, if so, you can split the dictionnaries in several smallers dicts, and change the function like so :
Happy translating.
I've seen people ask for translations for the game for the longest time, and we're on our way to create something more official, using crowdsourced translations. But, in the meantime, if you wish to translate the game, there are several tools at your disposal :
Calling labels, and how the game does it :
The game has a function in the Game class to select different dialogues based on the language class attribute defined there. To change that attribute, it's just a matter of writing this piece of code in a separate ".rpy" file.
Python:
init 1 python:
Game.language = "es" # for spanish for instance, "fr" for french, etc
This method can be used to translate any normal dialogues in the game.
For cutscenes :
For cutscenes, every cutscene uses the "FilteredText" displayable, which means that you have to set "config.say_menu_text_filter" to a function that will take the original string as an argument, and returned a changed string.
Python:
init 10 python:
fr_translations = {"Using the key and stool, I was able to get into our attic.\nI had never been up there before.\nI was filled with excitement wondering what treasures {b}[deb_name]{/b} and dad had stashed away.": "En utilisant la clé et le tabouret, je suis allé dans le grenier.\nJe n'y avais jamais été auparavent.\nJ'étais excité de découvrir tous les trésors cachés par {b}[deb_name]{/b} là-haut."}
def fr_text_filter(text):
if text in fr_translations.keys():
return fr_translations[text]
else:
return text
config.say_menu_text_filter = fr_text_filter
Python:
def fr_text_filter(text):
if text in fr_translations_1.keys():
return fr_translations_[text]
elif text in fr_translations_2.keys():
return fr_translations_2[text]
else:
return text