Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

[C#][Bot-Solutions] Fix MultiProviderAuthDialog not being localized #3760

Conversation

VictorGrycuk
Copy link
Contributor

Fix #3560

Purpose

What is the context of this pull request? Why is it being done?
MultiProviderAuthDialog login dialog only works with the fallback language. It should be able to localize it using the user's locale.

The dialog is added in the constructor of MultiProviderAuthDialog, before the activity from the user is received, therefore the locale of the user is unknown at this moment.

This fix revolves around the idea of adding dialogs of known language beforehand, and then using the user locale to retrieve their specific locale's dialog.

Changes

Are there any changes that need to be called out as significant or particularly difficult to grasp? (Include illustrative screenshots for context if applicable.)

  • Overloads ResponseManager's GetResponse to receive a specific locale instead of using the CurrentUICulture.
  • Adds a new method on MultiProviderAuthDialog to add a new login dialog for each configured locale

Tests

Is this covered by existing tests or new ones? If no, why not?

The MultiProviderAuthDialog localization working using a skill connected to a virtual assistant
localization working

Feature Plan

Are there any remaining steps or dependencies before this issue can be fully resolved? If so, describe and link to any relevant pull requests or issues.

Checklist

General

  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the appropriate tests
  • I have updated related documentation

- Allow ResponseManager to create a response using a specific locale
- Make MultiProviderAuthDialog create a new auth dialog by each
configured locale
- Static readonly fields should begin with upper-case letter
@srinaath
Copy link

srinaath commented Feb 3, 2021

@lauren-mills could you take a look at this PR to close the ticket.

Copy link
Contributor

@lauren-mills lauren-mills left a comment

Choose a reason for hiding this comment

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

Are there any changes needed in the VA template to support these changes?

@VictorGrycuk
Copy link
Contributor Author

Hi @lauren-mills, there is no need to modify the templates 🙂.

@srinaath
Copy link

srinaath commented Feb 5, 2021

@ryanlengel Could we get another review on this PR to get it merged

@ryanisgrig ryanisgrig merged commit e0af29b into microsoft:master Feb 5, 2021
@Batta32 Batta32 deleted the feature/southworks/fix-MultiProviderAuthDialog-localization branch February 19, 2021 17:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MultiProviderAuthDialog localization not working
4 participants