Refactor and clean up i18n (#17198)

* clean up i18n

* fix key

* fix key
This commit is contained in:
Josh Hawkins
2025-03-17 06:26:01 -06:00
committed by GitHub
parent 6e3ae0afc2
commit 03da70cb81
74 changed files with 1243 additions and 799 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ export function shareOrCopy(url: string, title?: string) {
});
} else {
copy(url);
toast.success(t("toast.copyUrlToClipboard"), {
toast.success(t("toast.copyUrlToClipboard", { ns: "common" }), {
position: "top-center",
});
}
+9 -9
View File
@@ -14,24 +14,24 @@ export function getLifecycleItemDescription(
switch (lifecycleItem.class_type) {
case "visible":
return t("objectLifecycle.lifecycleItemDesc.visible", {
label,
ns: "views/explore",
label,
});
case "entered_zone":
return t("objectLifecycle.lifecycleItemDesc.entered_zone", {
label,
ns: "views/explore",
label,
zones: lifecycleItem.data.zones.join(" and ").replaceAll("_", " "),
});
case "active":
return t("objectLifecycle.lifecycleItemDesc.active", {
label,
ns: "views/explore",
label,
});
case "stationary":
return t("objectLifecycle.lifecycleItemDesc.stationary", {
label,
ns: "views/explore",
label,
});
case "attribute": {
let title = "";
@@ -42,34 +42,34 @@ export function getLifecycleItemDescription(
title = t(
"objectLifecycle.lifecycleItemDesc.attribute.faceOrLicense_plate",
{
ns: "views/explore",
label,
attribute: lifecycleItem.data.attribute.replaceAll("_", " "),
ns: "views/explore",
},
);
} else {
title = t("objectLifecycle.lifecycleItemDesc.attribute.other", {
ns: "views/explore",
label: lifecycleItem.data.label,
attribute: lifecycleItem.data.attribute.replaceAll("_", " "),
ns: "views/explore",
});
}
return title;
}
case "gone":
return t("objectLifecycle.lifecycleItemDesc.gone", {
label,
ns: "views/explore",
label,
});
case "heard":
return t("objectLifecycle.lifecycleItemDesc.heard", {
label,
ns: "views/explore",
label,
});
case "external":
return t("objectLifecycle.lifecycleItemDesc.external", {
label,
ns: "views/explore",
label,
});
}
}