sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Allow to preview translated web part metadata in the toolbox in the workbench

Open waldekmastykarz opened this issue 9 years ago • 5 comments

Category

  • [ ] Question
  • [ ] Typo
  • [ ] Bug
  • [x] Enhancement / Suggestion
  • [ ] Additional article idea

Expected or Desired Behavior

When building multilingual web parts, developers should be able to verify that the different translations are displayed correctly in the web part toolbox. They should be able to verify this during the development process using workbench.

Observed Behavior

By default workbench uses the default values provided in the web part manifest to display web part title and description in the toolbox. Even after changing the value of the currentUICultureName property in the ./node_modules/@microsoft/sp-webpart-workbench/lib/api/workbenchInit.js file to another locale, the workbench still uses the default labels for web part title and description. This has to do with how items to be shown in the toolbox are constructed in ./node_modules/@microsoft/sp-client-preview/lib/local/appBase/components/sp-canvas/canvas/canvasComponent/CanvasStore.js lines 537-543. Here, rather than using the current locale, the toolbox always uses the default value for both title and description.

Steps to Reproduce

  • create new project
  • in the web part manifest, for the title and description properties add a translation in a language other than en-US
  • $ gulp serve --locale=[your locale here]
  • in the ./node_modules/@microsoft/sp-webpart-workbench/lib/api/workbenchInit.js file change the value of the currentUICultureName property to the locale used in the web part manifest
  • reload the workbench by refreshing the page in the browser
    • the toolbox shows default labels rather than labels from the current locale

waldekmastykarz avatar Jan 03 '17 13:01 waldekmastykarz

I can confirm that this is still exactly the same with RC0.

ghost avatar Jan 23 '17 09:01 ghost

It is also possible to set the workbench locale to a different value for your whole team (because it's checked into source control) via: Inside config/write-manifest.json, add the line "debugLocale": "your locale here".

So as an example, my write-manifests.json looks like this:

{
  "cdnBasePath": "<!-- PATH TO CDN -->",
  "debugLocale": "de-de"
}

It is the same as calling gulp serve --locale=[your locale here]. So the behaviour is still exactly the same.

ghost avatar Jan 23 '17 10:01 ghost

While you can change the locale of the workbench @michel-weber, the information in the toolbox is always shown using en-US.

waldekmastykarz avatar Jan 23 '17 12:01 waldekmastykarz

Thanks for the feedback @waldekmastykarz. This is a feature enhancement request and there is a different workflow to follow. Please post your request on our UserVoice. The link is here: https://sharepoint.uservoice.com/forums/329220-sharepoint-dev-platform

amishra0909 avatar May 09 '17 00:05 amishra0909

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 30 '20 00:01 msft-github-bot