sandpie wrote: ↑Thu Nov 30, 2023 4:38 pm
it's stating that the program should please put the value of the variable "message" at this position
Can you please elaborate? at which position?
What do you mean? At the position inside the string, that is enclosed with quotes. In this case the message makes up the whole string. Just read the part about interpolating data in the link I provided.
Speaking about the !t flag: I thought I understood that to make the strings translatable we should enclose them between _( and ) and I checked that they are successfully exported.. is there any difference between the two "methods"?
The function _(...)
just marks strings as translatable (you only need it when it's not a dialogue line, so for example strings in screens etc.) That means when you later use "Generate translations" within the Renpy GUI, it will include those strings inside the translation file for you to translate. Just try it and then look inside the translation files within the folder called tl
. After you did that, it will automatically translate those enclosed strings when a translation is found.
The tag !t
just says that Renpy should *look* for a possible translation of the string that is inside this variable (in this case "message"). Otherwise it wouldn't get translated by default. This is mostly important if you need parts of a string translated. So it will look inside the earlier created translation file and find a possible string translation and then display the translation instead of the original string. Sounds complicated? Yes, but it's actually not, once you use Renpy's translation system. So don't worry about it, if you don't plan to.
Code: Select all
# mark this word as translatable, so it will show up in the translation file
default gender = _("female")
# interpolated data doesn't get translated by default, you have to enforce it
e "Hey, I'm Eileen and I am [gender!t]."
So if you would translate this into say German and didn't
include the !t
, it would wrongly show:
"Hey, ich bin Eileen und ich bin female
." instead of weiblich