diff --git a/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs b/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs index 3b1fcfe2..d7323305 100644 --- a/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs +++ b/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs @@ -17,7 +17,7 @@ namespace Fungus Localization localization = GameObject.FindObjectOfType(); if (localization != null) { - localization.SetActiveLanguage(languageCode); + localization.SetActiveLanguage(languageCode, true); } Continue(); diff --git a/Assets/Fungus/Narrative/Scripts/Localization.cs b/Assets/Fungus/Narrative/Scripts/Localization.cs index 05f8a08e..8c5d5378 100644 --- a/Assets/Fungus/Narrative/Scripts/Localization.cs +++ b/Assets/Fungus/Narrative/Scripts/Localization.cs @@ -297,7 +297,7 @@ namespace Fungus * Scan a localization CSV file and copies the strings for the specified language code * into the text properties of the appropriate scene objects. */ - public virtual void SetActiveLanguage(string languageCode) + public virtual void SetActiveLanguage(string languageCode, bool forceUpdateSceneText = false) { if (!Application.isPlaying) { @@ -357,7 +357,13 @@ namespace Fungus localizedStrings[fields[0]] = fields[languageIndex]; } - return; + + // Early out unless we've been told to force the scene text to update. + // This happens when the Set Language command is used to reset back to the standard language. + if (!forceUpdateSceneText) + { + return; + } } // Using a localized language text column