diff --git a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs index 6502f274..f76aa841 100644 --- a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs +++ b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs @@ -678,15 +678,25 @@ namespace Fungus foreach (Match match in results) { string key = match.Value.Substring(2, match.Value.Length - 3); + + // Look for matching variable first foreach (Variable variable in variables) { if (variable.key == key) { string value = variable.ToString(); subbedText = subbedText.Replace(match.Value, value); - break; + return subbedText; } } + + // Next look for matching localized string + string localizedString = Localization.GetLocalizedString(key); + if (localizedString != null) + { + subbedText = subbedText.Replace(match.Value, localizedString); + return subbedText; + } } return subbedText;