microsoft-graph-toolkit icon indicating copy to clipboard operation
microsoft-graph-toolkit copied to clipboard

[BUG] LocalizationHelper with disambiguation

Open patrikhellgren opened this issue 1 month ago • 3 comments

Describe the bug When using MGT 4.2.1 in a SPFx solution (React) using disambiguation (which is working), LocalizationHelper is not working the way the documentation says. I spent a few hours troubleshooting why LocalizationHelper wasn't working to set my own localized strings for the people-picker component until I had a look at the source code and figured out that I had to specify the disambiguated component name in the LocalizationHelper strings object. I would have expected that LocalizationHelper followed the disambiguation.

To Reproduce Steps to reproduce the behavior:

  1. Create a SPFx solution using React
  2. Add MGT to the solution
  3. Configure disambiguation for MGT according to the documentation
  4. Use PeoplePicker component in the solution
  5. Add LocalizationHelper and configure custom localization for the "people-picker" component like in the documentation
  6. The LocalizationHelper strings object will not override the ones in PeoplePicker
  7. Change the custom localization to be for string-used-for-disambiguation-people-picker instead
  8. Now the strings in PeoplePicker will be overridden

Expected behavior I expected LocalizationHelper to account for disambiguation. If this is by design then the documentation should clearly mention the intended behavior when using disambiguation, both under Localization and under Disambiguation.

Screenshots

Environment (please complete the following information):

  • OS: Windows 11
  • Browser Edge
  • Framework React
  • Context SharePoint
  • Version 4.2.1
  • Provider SharePointProvider

Additional context

patrikhellgren avatar Jun 02 '24 22:06 patrikhellgren