Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Cone Arex

#1
Hello.
I have a problem regarding the use of translations. Up to now, I have used

Code: ags

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.
Code: ags

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?
SMF spam blocked by CleanTalk