Allow to preview translated web part metadata in the toolbox in the workbench
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
I can confirm that this is still exactly the same with RC0.
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.
While you can change the locale of the workbench @michel-weber, the information in the toolbox is always shown using en-US.
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
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