Translation section: structural, API, and editing UX improvements #23991
Replies: 2 comments 5 replies
|
I always wondered why this didn't at least follow the create Section and add Keys (all be it flat) to mirror localizations in packages. And if it needed to be flat, at least if you create keys like We also have localizations in packages that follow camel+snake I guess my comment is more about overarching consistency? A nested I18N-style spec for the api would be prefered?
|
|
I completely agree with you, Richard. Ideally, you should be able to create folders alongside keys — something I’ve also been missing for years. The translation API could then return the data as a tree structure. Something like this: And wouldn't it be absolutely fantastic to have a "translate all empty fields" button somewhere? I think that could be nicely combined with Umbraco.AI. ps. great talk on headless last Tuesday! |
Uh oh!
There was an error while loading. Please reload this page.
Translation section: structural, API, and editing UX improvements
Summary
The current Dictionary/Translation section has a flat key structure, no translation API, and a plain-text editing experience. This discussion proposes structural, API, and editor improvements, plus a V2 idea for per-site overrides.
Current behaviour
Dictionary keys need to be unique so we need to do some hacks in our solution, for example:
App.News.HeaderApp.News.ReadMoreApp.TitleWebsite.News.HeaderWesbite.News.ReadMoreWebsite.TitleProposed structure
Instead of flat, duplicated key paths, keys should be organised under shared parent nodes with common child nodes underneath, for example:
AppNewsHeaderTitleWebsiteNewsHeaderTitleMuch better UX in the tree
Missing: Translation API
There is currently no dedicated Translation API exposing an I18N-style spec built from this structure. The API should output composed, dot-notation keys derived from the tree, for example:
{ "app.news.header": "News", "app.news.readMore": "Read more", "app.title": "welcome", "website.news.header": "Our awesome news!", "website.title": "Welcome on out awesome site", "wesbite.news.readMore": "Read more" }Custom one created:
There is already a different discussion for this #15214
Editor UX
The current editing experience for a dictionary item is a plain text box. This should support:
V2 idea: per-site overrides
For a more complete solution, it should be possible to localize or override a shared translation key on a per-website (or per-start-node) basis. For example, a key used across nine websites could have its value overridden for a single specific website or start node, without affecting the shared default value used everywhere else.
All reactions