Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PORT]Add configuration for default languagePolicy #2348

Merged
merged 7 commits into from
Jun 16, 2020

Conversation

Danieladu
Copy link
Contributor

close: #2028
Composer requires a customized language policy for language fallback, than the default "en-us" => "en" => "".

In composer scenario, we want be able to fallback to specific language instead of empty, for example fallback to en-us when activity.locale = fr-fr, because the bot is only configured with en-us assets.

This change include

  1. Replace the lazy trick in LanguagePolicy by a class singleton, to make sure json deserialization work.
  2. Register the root dialog's policy as default one in TurnContext, if children dialog don't configured with a policy, it will pick that one.

@coveralls
Copy link

coveralls commented Jun 15, 2020

Pull Request Test Coverage Report for Build 138552

  • 24 of 26 (92.31%) changed or added relevant lines in 5 files are covered.
  • 17 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.1%) to 80.832%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botbuilder-dialogs-adaptive/src/generators/multiLanguageGeneratorBase.ts 12 13 92.31%
libraries/botbuilder-dialogs-adaptive/src/languageGenerationMiddleware.ts 3 4 75.0%
Files with Coverage Reduction New Missed Lines %
libraries/botframework-streaming/src/webSocket/webSocketTransport.ts 2 80.65%
libraries/botframework-streaming/src/webSocket/webSocketServer.ts 7 66.67%
libraries/botbuilder-dialogs-adaptive/src/languageResourceLoader.ts 8 69.34%
Totals Coverage Status
Change from base Build 138551: -0.1%
Covered Lines: 12821
Relevant Lines: 15144

💛 - Coveralls

@Danieladu Danieladu merged commit 1af14c9 into master Jun 16, 2020
@Danieladu Danieladu deleted the hond/multi-locale-fix branch June 16, 2020 07:49
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.

[PORT] Add extension for default languagePolicy
3 participants