From 130b7f398420c5e42b54923460a6ef2b3ac328fe Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 15 Oct 2025 13:45:56 -0500 Subject: [PATCH] simplify --- web/src/utils/i18n.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/web/src/utils/i18n.ts b/web/src/utils/i18n.ts index d5c9045ab..1a386ccb3 100644 --- a/web/src/utils/i18n.ts +++ b/web/src/utils/i18n.ts @@ -9,9 +9,7 @@ export const getTranslatedLabel = ( ) => { if (!label) return ""; - if (type === "manual") { - return label; - } + if (type === "manual") return label; const normalize = (s: string) => s @@ -23,12 +21,9 @@ export const getTranslatedLabel = ( const key = normalize(label); - if (type === "audio") { - return t(`audio.${key}`, { ns: "audio" }); - } + const ns = type === "audio" ? "audio" : "objects"; - // fallback - return t(key, { ns: "objects" }); + return t(key, { ns }); }; i18n