Skip to content

Commit

Permalink
Only adding zh-cn to LanguagePolicy if missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tracy Boehrer committed Feb 6, 2024
1 parent bcfc084 commit b9a23be
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/LanguagePolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,16 @@ private static IDictionary<string, string[]> DefaultPolicy(string[] defaultLangu
// 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.
policy.Add("zh-cn", new string[] { "zh-cn", "zh" });
policy.Add("zh-tw", new string[] { "zh-tw", "zh" });
// 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 b9a23be

Please sign in to comment.