From 234cdbdf96fb6063b2f2de1d9adc5aa19e658570 Mon Sep 17 00:00:00 2001 From: Tomas Vondracek Date: Wed, 7 Oct 2026 15:20:35 +0200 Subject: [PATCH] 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 component bundles Trumbowyg's language files and, before the editor initialises, runs only the one matching the locale and sets it as the editor language. Locales without a translation keep the built-in English. 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 | 59 +++++++++++++++++++++++ templates/_partials/fields/html.html.twig | 1 + 2 files changed, 60 insertions(+) diff --git a/assets/js/app/editor/Components/Html.vue b/assets/js/app/editor/Components/Html.vue index a17e5c85b0..e8e3c7d1fd 100644 --- a/assets/js/app/editor/Components/Html.vue +++ b/assets/js/app/editor/Components/Html.vue @@ -5,10 +5,61 @@