mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-02 09:02:15 +03:00
Refactor and clean up i18n (#17198)
* clean up i18n * fix key * fix key
This commit is contained in:
@@ -60,15 +60,15 @@ interface Preset {
|
||||
|
||||
// Define presets
|
||||
const PRESETS: Preset[] = [
|
||||
{ name: "today", label: t("time.today") },
|
||||
{ name: "yesterday", label: t("time.yesterday") },
|
||||
{ name: "last7", label: t("time.last7") },
|
||||
{ name: "last14", label: t("time.last14") },
|
||||
{ name: "last30", label: t("time.last30") },
|
||||
{ name: "thisWeek", label: t("time.thisWeek") },
|
||||
{ name: "lastWeek", label: t("time.lastWeek") },
|
||||
{ name: "thisMonth", label: t("time.thisMonth") },
|
||||
{ name: "lastMonth", label: t("time.lastMonth") },
|
||||
{ name: "today", label: t("time.today", { ns: "common" }) },
|
||||
{ name: "yesterday", label: t("time.yesterday", { ns: "common" }) },
|
||||
{ name: "last7", label: t("time.last7", { ns: "common" }) },
|
||||
{ name: "last14", label: t("time.last14", { ns: "common" }) },
|
||||
{ name: "last30", label: t("time.last30", { ns: "common" }) },
|
||||
{ name: "thisWeek", label: t("time.thisWeek", { ns: "common" }) },
|
||||
{ name: "lastWeek", label: t("time.lastWeek", { ns: "common" }) },
|
||||
{ name: "thisMonth", label: t("time.thisMonth", { ns: "common" }) },
|
||||
{ name: "lastMonth", label: t("time.lastMonth", { ns: "common" }) },
|
||||
];
|
||||
|
||||
/** The DateRangePicker component allows a user to select a range of dates */
|
||||
|
||||
@@ -8,7 +8,7 @@ import { t } from "i18next";
|
||||
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
||||
<nav
|
||||
role="navigation"
|
||||
aria-label={t("pagination.label")}
|
||||
aria-label={t("pagination.label", { ns: "common" })}
|
||||
className={cn("mx-auto flex w-full justify-center", className)}
|
||||
{...props}
|
||||
/>
|
||||
@@ -65,13 +65,13 @@ const PaginationPrevious = ({
|
||||
...props
|
||||
}: React.ComponentProps<typeof PaginationLink>) => (
|
||||
<PaginationLink
|
||||
aria-label={t("pagination.previous.label")}
|
||||
aria-label={t("pagination.previous.label", { ns: "common" })}
|
||||
size="default"
|
||||
className={cn("gap-1 pl-2.5", className)}
|
||||
{...props}
|
||||
>
|
||||
<ChevronLeft className="h-4 w-4" />
|
||||
<span>{t("pagination.previous")}</span>
|
||||
<span>{t("pagination.previous.title", { ns: "common" })}</span>
|
||||
</PaginationLink>
|
||||
);
|
||||
PaginationPrevious.displayName = "PaginationPrevious";
|
||||
@@ -81,12 +81,12 @@ const PaginationNext = ({
|
||||
...props
|
||||
}: React.ComponentProps<typeof PaginationLink>) => (
|
||||
<PaginationLink
|
||||
aria-label={t("pagination.next.label")}
|
||||
aria-label={t("pagination.next.label", { ns: "common" })}
|
||||
size="default"
|
||||
className={cn("gap-1 pr-2.5", className)}
|
||||
{...props}
|
||||
>
|
||||
<span>{t("pagination.next")}</span>
|
||||
<span>{t("pagination.next.title", { ns: "common" })}</span>
|
||||
<ChevronRight className="h-4 w-4" />
|
||||
</PaginationLink>
|
||||
);
|
||||
@@ -102,7 +102,7 @@ const PaginationEllipsis = ({
|
||||
{...props}
|
||||
>
|
||||
<MoreHorizontal className="h-4 w-4" />
|
||||
<span className="sr-only">{t("pagination.more")}</span>
|
||||
<span className="sr-only">{t("pagination.more", { ns: "common" })}</span>
|
||||
</span>
|
||||
);
|
||||
PaginationEllipsis.displayName = "PaginationEllipsis";
|
||||
|
||||
Reference in New Issue
Block a user