Skip to content

Conversation

carlosscastro
Copy link
Member

@carlosscastro carlosscastro commented Oct 23, 2020

Fixes #4657

Unfortunately we broke developers who implemented their own ITurnContext when adding a cast to TurnContext in DialogContext.GetLocale(). Furthermore, the GetLocale() method is quite useless considering that whenever the DialogContext is available, a ITurnContext instance is available as well and we could get the locale from there.

I have some broader locale changes in another incoming PR (in which I mark DialogContext.GetLocale() as deprecated among other things), but this is the minimum bar, which is to un-break developers that have been broken because of this change.

@carlosscastro carlosscastro requested review from a team as code owners October 23, 2020 22:27
{
var locale = ((TurnContext)Context).Locale ?? null;
return locale;
return Context.TurnState.Get<string>("turn.locale");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this string is defined in TurnContext. However the goal is to deprecate the GetLocale() method in a future PR, so I don't want to make the constant in TurnContext public just to deprecate it. This coupling should never have happened unfortunately :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Locale to ITurnContext
2 participants