mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-25 15:56:19 -05:00
Translate tag
This commit is contained in:
parent
4a2b974fd3
commit
e0d512bd88
|
|
@ -44,6 +44,10 @@ export const meta: MetaFunction = (args) => {
|
|||
};
|
||||
};
|
||||
|
||||
export const handle = {
|
||||
i18n: "calendar",
|
||||
};
|
||||
|
||||
const loaderSearchParamsSchema = z.object({
|
||||
week: z.preprocess(actualNumber, z.number().int().min(1).max(53)),
|
||||
year: z.preprocess(actualNumber, z.number().int()),
|
||||
|
|
@ -354,14 +358,15 @@ function Tags({
|
|||
}: {
|
||||
tags: Unpacked<UseDataFunctionReturn<typeof loader>["events"]>["tags"];
|
||||
}) {
|
||||
const { t } = useTranslation("calendar");
|
||||
|
||||
if (tags.length === 0) return null;
|
||||
|
||||
// xxx: fix name
|
||||
return (
|
||||
<ul className="calendar__event__tags">
|
||||
{tags.map((tag) => (
|
||||
<li key={tag} style={{ backgroundColor: allTags[tag].color }}>
|
||||
Badge prize
|
||||
{t(`tag.${tag}`)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
|
|
|||
3
public/locales/en/calendar.json
Normal file
3
public/locales/en/calendar.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"tag.BADGE_PRIZE": "Badge prize"
|
||||
}
|
||||
2
types/react-i18next.d.ts
vendored
2
types/react-i18next.d.ts
vendored
|
|
@ -5,6 +5,7 @@ import type faq from "../public/locales/en/faq.json";
|
|||
import type contributions from "../public/locales/en/contributions.json";
|
||||
import type user from "../public/locales/en/user.json";
|
||||
import type badges from "../public/locales/en/badges.json";
|
||||
import type calendar from "../public/locales/en/calendar.json";
|
||||
|
||||
declare module "react-i18next" {
|
||||
interface CustomTypeOptions {
|
||||
|
|
@ -15,6 +16,7 @@ declare module "react-i18next" {
|
|||
contributions: typeof contributions;
|
||||
user: typeof user;
|
||||
badges: typeof badges;
|
||||
calendar: typeof calendar;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user