From 24bd628345451dbf069a10316842f94e5a2c20ef Mon Sep 17 00:00:00 2001 From: Tomas Vondracek Date: Sun, 25 Oct 2026 09:48:35 +0100 Subject: [PATCH 1/3] feat: translate the html field editor into the backend locale The html field's Trumbowyg editor always showed its toolbar in English, although Trumbowyg ships translations for 46 languages. They were never loaded, and the editor was never told which language to use. The field template now passes the request locale to the component, the same locale the rest of the backend UI is rendered in. The language files are split into lazy chunks named trumbowyg-lang-.js, so only the one matching the locale is fetched, and the editor is rendered once it has loaded. Locales without a translation keep the built-in English and fetch nothing. Locales are matched from the most to the least specific part (sr_Latn_RS -> sr_latn -> sr), with aliases for the codes Trumbowyg names differently from ISO (uk -> ua, sr -> rs, nn -> nb, zh_Hant -> zh_tw, ...). ISO `my` is Burmese while Trumbowyg's `my` is Malay, so it is never matched as-is. The Arabic, Hebrew and Persian translations also switch the editable area to right-to-left. That direction belongs to the content being edited, not to the backend language, so it is dropped and only the labels are used. --- assets/js/app/editor/Components/Html.vue | 85 ++++++++++++++++++++++- templates/_partials/fields/html.html.twig | 1 + 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/assets/js/app/editor/Components/Html.vue b/assets/js/app/editor/Components/Html.vue index a17e5c85b0..29c1b3d491 100644 --- a/assets/js/app/editor/Components/Html.vue +++ b/assets/js/app/editor/Components/Html.vue @@ -1,14 +1,86 @@