Skip to content

Commit

Permalink
Manually adding zh-CN and zh-TW to LanguagePolicy (#6745)
Browse files Browse the repository at this point in the history
* Manually adding zh-CN and zh-TW to LanguagePolicy

* Only adding zh-cn to LanguagePolicy if missing.

---------

Co-authored-by: Tracy Boehrer <trboehre@microsoft.com>
  • Loading branch information
tracyboehrer and Tracy Boehrer authored Feb 6, 2024
1 parent 84df086 commit e5f7ff6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/LanguagePolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ private static IDictionary<string, string[]> DefaultPolicy(string[] defaultLangu
policy.Add(language, fallback.ToArray());
}

// Locales like zh-CN, zh-TW, etc... are deprecated locales returned by CultureInfo.
// However, many still supply the old value when setting up WebChat. Since we
// really just need the progression to check for LG/LU files, we are manually adding
// them so that these files are found. This is OS version specific.
if (!policy.ContainsKey("zh-cn"))
{
policy.Add("zh-cn", new string[] { "zh-cn", "zh" });
}

if (!policy.ContainsKey("zh-tw"))
{
policy.Add("zh-tw", new string[] { "zh-tw", "zh" });
}

return policy;
}
}
Expand Down

0 comments on commit e5f7ff6

Please sign in to comment.