From 6a12ac560e253ccafabe745ae78942707a4fb8a0 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Thu, 10 Jul 2025 12:38:28 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90(frontend)=20keep=20simple=20tag=20?= =?UTF-8?q?during=20export?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we export translations, we want to keep the simple tags like `` instead of converting it to `<1>` and ``. --- CHANGELOG.md | 4 ++++ src/frontend/packages/i18n/i18next-parser.config.mjs | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1629809d..8ddcbc5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to ## [Unreleased] +### Fixed + +- 🌐(frontend) keep simple tag during export #1154 + ## [3.4.0] - 2025-07-09 ### Added diff --git a/src/frontend/packages/i18n/i18next-parser.config.mjs b/src/frontend/packages/i18n/i18next-parser.config.mjs index 506129c7..9d6fb31b 100644 --- a/src/frontend/packages/i18n/i18next-parser.config.mjs +++ b/src/frontend/packages/i18n/i18next-parser.config.mjs @@ -7,6 +7,16 @@ const config = { keySeparator: false, nsSeparator: false, namespaceSeparator: false, + lexers: { + tsx: [ + { + lexer: 'JsxLexer', + functions: ['t'], + transSupportBasicHtmlNodes: true, // Disable automatic conversion + transKeepBasicHtmlNodesFor: ['strong', 'b', 'i', 'code', 'br'], + }, + ], + }, }; export default config;