From d3283746fcc534a4f0a64a9c2c284ae962942662 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Fri, 28 Feb 2025 08:30:35 +0100 Subject: [PATCH] fix(type_widgets/doc): import i18next since we don't export the full i18n object (not sure why?), I had to add an additional export "getCurrentLanguage" -> needs to be a function, because otherwise it will be a static value (being set to undefined), which is *not* what we want --- src/public/app/services/i18n.ts | 1 + src/public/app/widgets/type_widgets/doc.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/public/app/services/i18n.ts b/src/public/app/services/i18n.ts index 8abdba46e..449381f06 100644 --- a/src/public/app/services/i18n.ts +++ b/src/public/app/services/i18n.ts @@ -16,3 +16,4 @@ export async function initLocale() { } export const t = i18next.t; +export const getCurrentLanguage = () => i18next.language; diff --git a/src/public/app/widgets/type_widgets/doc.ts b/src/public/app/widgets/type_widgets/doc.ts index 57fc7eda8..12eff71f3 100644 --- a/src/public/app/widgets/type_widgets/doc.ts +++ b/src/public/app/widgets/type_widgets/doc.ts @@ -2,6 +2,7 @@ import type { EventData } from "../../components/app_context.js"; import type FNote from "../../entities/fnote.js"; import { applySyntaxHighlight } from "../../services/syntax_highlight.js"; import TypeWidget from "./type_widget.js"; +import { getCurrentLanguage } from "../../services/i18n.js"; const TPL = `