mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-14 02:52:11 +03:00
simplify
This commit is contained in:
parent
5b9b138035
commit
130b7f3984
@ -9,9 +9,7 @@ export const getTranslatedLabel = (
|
|||||||
) => {
|
) => {
|
||||||
if (!label) return "";
|
if (!label) return "";
|
||||||
|
|
||||||
if (type === "manual") {
|
if (type === "manual") return label;
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
const normalize = (s: string) =>
|
const normalize = (s: string) =>
|
||||||
s
|
s
|
||||||
@ -23,12 +21,9 @@ export const getTranslatedLabel = (
|
|||||||
|
|
||||||
const key = normalize(label);
|
const key = normalize(label);
|
||||||
|
|
||||||
if (type === "audio") {
|
const ns = type === "audio" ? "audio" : "objects";
|
||||||
return t(`audio.${key}`, { ns: "audio" });
|
|
||||||
}
|
|
||||||
|
|
||||||
// fallback
|
return t(key, { ns });
|
||||||
return t(key, { ns: "objects" });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
i18n
|
i18n
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user