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
+7 -5
View File
@@ -68,7 +68,7 @@ type GeneralSettingsProps = {
};
export default function GeneralSettings({ className }: GeneralSettingsProps) {
const { t } = useTranslation(["common"]);
const { t } = useTranslation(["common", "views/settings"]);
const { data: profile } = useSWR("profile");
const { data: config } = useSWR<FrigateConfig>("config");
const logoutUrl = config?.proxy?.logout_url || "/api/logout";
@@ -100,7 +100,9 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
if (response.status === 200) {
setPasswordDialogOpen(false);
toast.success(
t("users.toast.success.updatePassword", { ns: "views/settings" }),
t("users.toast.success.updatePassword", {
ns: "views/settings",
}),
{
position: "top-center",
},
@@ -184,11 +186,11 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
? "cursor-pointer"
: "flex items-center p-2 text-sm"
}
aria-label={t("menu.user.setPassword")}
aria-label={t("menu.user.setPassword", { ns: "common" })}
onClick={() => setPasswordDialogOpen(true)}
>
<LuSquarePen className="mr-2 size-4" />
<span>{t("menu.user.setPassword")}</span>
<span>{t("menu.user.setPassword", { ns: "common" })}</span>
</MenuItem>
)}
<MenuItem
@@ -501,7 +503,7 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
aria-label={t("menu.documentation.label")}
>
<LuLifeBuoy className="mr-2 size-4" />
<span>{t("menu.documentation")}</span>
<span>{t("menu.documentation.title")}</span>
</MenuItem>
</a>
<a