botbuilder-python
botbuilder-python copied to clipboard
port: Make sure "turn.locale" is correctly set in TurnContext, enabling locale can be changed during runtime (#5019)
The changes in Make sure "turn.locale" is correctly set in TurnContext, enabling locale can be changed during runtime (#5019) may need to be ported to maintain parity with microsoft/botbuilder-dotnet.
Closes: #4983 #3993 In this PR, fix a bug of set locale in TurnState. The locale info will be set to the value of key "turn". User can set locale by SetProperty action. For example, suppose the original locale is "en-US": ``` { "$schema": "../../tests.schema", "$kind": "Microsoft.AdaptiveDialog", "generator": "test.lg", "triggers": [ { "$kind": "Microsoft.OnBeginDialog", "actions": [ { "$kind": "Microsoft.SetProperty", "property": "turn.locale", "value": "de-DE" }, { "$kind": "Microsoft.SendActivity", "activity": "${string(1.122)}" }, { "$kind": "Microsoft.SendActivity", "activity": "${formatNumber(1.12345, 4)}" }, { "$kind": "Microsoft.SendActivity", "activity": "${addDays('2018-01-02T02:00:00.000Z', 4, 'D')}" }, { "$kind": "Microsoft.SendActivity", "activity": "${formatNumber(3.1415926, 5)}" } ] } ] } ```
Please review and, if necessary, port the changes.