Hello.
I have a problem regarding the use of translations. Up to now, I have used
Code: ags
to check for translation and display different graphics for different translations. But this doesn't seem to work all the time. There were people who saw the untranslated graphic of note despite having an active translation. While testing, I've noticed that the above checking never works when playing the game with the Linux, Android or ScummVM ports of AGS.
Someone told me to first use IsTranslationAvailable() and then compare strings to check which translation is used.
Code: ags
I can confirm this works all the time or least I've yet to encounter problems with it. Thing is, that it isn't really good coding style.
Any advice? What is the "correct" way to display graphics depending on the selected translation?
I have a problem regarding the use of translations. Up to now, I have used
if (Game.TranslationFilename == "English")
{
// Do stuff
}
to check for translation and display different graphics for different translations. But this doesn't seem to work all the time. There were people who saw the untranslated graphic of note despite having an active translation. While testing, I've noticed that the above checking never works when playing the game with the Linux, Android or ScummVM ports of AGS.
Someone told me to first use IsTranslationAvailable() and then compare strings to check which translation is used.
if (IsTranslationAvailable())
{
if (GetTranslation("Bertholds Rückkehr") == "Berthold's Return")
{
// Do stuff
}
}
I can confirm this works all the time or least I've yet to encounter problems with it. Thing is, that it isn't really good coding style.
Any advice? What is the "correct" way to display graphics depending on the selected translation?