From b84e14b8ced718bb25dd49c98481210a2e703a66 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 16 May 2025 10:49:35 +0300 Subject: [PATCH] refactor(client): use proper imports for translation --- apps/client/src/services/content_renderer.ts | 2 +- apps/client/src/widgets/note_language.ts | 3 +-- apps/client/src/widgets/type_widgets/content_widget.ts | 2 +- apps/client/src/widgets/type_widgets/options/i18n/language.ts | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/client/src/services/content_renderer.ts b/apps/client/src/services/content_renderer.ts index 0bf7bca28..619d2d7a6 100644 --- a/apps/client/src/services/content_renderer.ts +++ b/apps/client/src/services/content_renderer.ts @@ -14,7 +14,7 @@ import { applySingleBlockSyntaxHighlight, applySyntaxHighlight } from "./syntax_ import { loadElkIfNeeded, postprocessMermaidSvg } from "./mermaid.js"; import { normalizeMimeTypeForCKEditor } from "./mime_type_definitions.js"; import renderDoc from "./doc_renderer.js"; -import { t } from "i18next"; +import { t } from "../services/i18n.js"; import WheelZoom from 'vanilla-js-wheel-zoom'; let idCounter = 1; diff --git a/apps/client/src/widgets/note_language.ts b/apps/client/src/widgets/note_language.ts index 45fcf02c9..398951e20 100644 --- a/apps/client/src/widgets/note_language.ts +++ b/apps/client/src/widgets/note_language.ts @@ -1,7 +1,6 @@ import { Dropdown } from "bootstrap"; import NoteContextAwareWidget from "./note_context_aware_widget.js"; -import { getAvailableLocales, getLocaleById } from "../services/i18n.js"; -import { t } from "i18next"; +import { getAvailableLocales, getLocaleById, t } from "../services/i18n.js"; import type { EventData } from "../components/app_context.js"; import type FNote from "../entities/fnote.js"; import attributes from "../services/attributes.js"; diff --git a/apps/client/src/widgets/type_widgets/content_widget.ts b/apps/client/src/widgets/type_widgets/content_widget.ts index 3283672a4..00c30f5f7 100644 --- a/apps/client/src/widgets/type_widgets/content_widget.ts +++ b/apps/client/src/widgets/type_widgets/content_widget.ts @@ -40,7 +40,7 @@ import ShareSettingsOptions from "./options/other/share_settings.js"; import AiSettingsOptions from "./options/ai_settings.js"; import type FNote from "../../entities/fnote.js"; import type NoteContextAwareWidget from "../note_context_aware_widget.js"; -import { t } from "i18next"; +import { t } from "../../services/i18n.js"; import LanguageOptions from "./options/i18n/language.js"; import type BasicWidget from "../basic_widget.js"; import CodeTheme from "./options/code_notes/code_theme.js"; diff --git a/apps/client/src/widgets/type_widgets/options/i18n/language.ts b/apps/client/src/widgets/type_widgets/options/i18n/language.ts index 7a10e0a15..7b38067a9 100644 --- a/apps/client/src/widgets/type_widgets/options/i18n/language.ts +++ b/apps/client/src/widgets/type_widgets/options/i18n/language.ts @@ -1,7 +1,7 @@ import OptionsWidget from "../options_widget.js"; import type { OptionMap } from "@triliumnext/commons"; import { getAvailableLocales } from "../../../../services/i18n.js"; -import { t } from "i18next"; +import { t } from "../../../../services/i18n.js"; const TPL = /*html*/`