mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-13 00:50:06 +08:00
typesafe i18n
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"about": "About",
|
||||
"account_settings": "Account",
|
||||
"admin_dashboard": "Admin Dashboard",
|
||||
"connect": "Connect",
|
||||
"conversational": "Conversational AI for everyone.",
|
||||
"dashboard": "Dashboard",
|
||||
|
||||
@@ -27,10 +27,10 @@ export function Faq() {
|
||||
return (
|
||||
<ListItem className="space-y-10" key={`question_${index}`}>
|
||||
<Text as="h3" className={`text-lg font-semibold leading-6 ${headingColorClass}`}>
|
||||
{t(`faq_items.q${index}`)}
|
||||
{t(`faq_items.q${index as 0}`)}
|
||||
</Text>
|
||||
<Text as="p" className={`mt-4 text-sm ${textColorClass}`}>
|
||||
{t(`faq_items.a${index}`)}
|
||||
{t(`faq_items.a${index as 0}`)}
|
||||
</Text>
|
||||
</ListItem>
|
||||
);
|
||||
|
||||
@@ -24,7 +24,7 @@ const Home = () => {
|
||||
<>
|
||||
<Head>
|
||||
<title>{t("title")}</title>
|
||||
<meta name="description" content={t("description")} />
|
||||
<meta name="description" content={t("index:description")} />
|
||||
</Head>
|
||||
<Box as="main" className="oa-basic-theme">
|
||||
<Hero />
|
||||
|
||||
@@ -11,19 +11,19 @@ const Leaderboard = () => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{`${t("leaderboard")} - ${t("common:title")}`}</title>
|
||||
<title>{`${t("leaderboard:leaderboard")} - ${t("common:title")}`}</title>
|
||||
<meta name="description" content="Leaderboard Rankings" charSet="UTF-8" />
|
||||
</Head>
|
||||
<Box display="flex" flexDirection="column">
|
||||
<Heading fontSize="2xl" fontWeight="bold" pb="4">
|
||||
{t("leaderboard")}
|
||||
{t("leaderboard:leaderboard")}
|
||||
</Heading>
|
||||
<Tabs isFitted isLazy>
|
||||
<TabList>
|
||||
<Tab>{t("daily")}</Tab>
|
||||
<Tab>{t("weekly")}</Tab>
|
||||
<Tab>{t("monthly")}</Tab>
|
||||
<Tab>{t("overall")}</Tab>
|
||||
<Tab>{t("leaderboard:daily")}</Tab>
|
||||
<Tab>{t("leaderboard:weekly")}</Tab>
|
||||
<Tab>{t("leaderboard:monthly")}</Tab>
|
||||
<Tab>{t("leaderboard:overall")}</Tab>
|
||||
</TabList>
|
||||
|
||||
<TabPanels>
|
||||
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
import "i18next";
|
||||
|
||||
import type common from "../public/locales/en/common.json";
|
||||
import type index from "../public/locales/en/index.json";
|
||||
import type leaderboard from "../public/locales/en/leaderboard.json";
|
||||
|
||||
declare module "i18next" {
|
||||
interface CustomTypeOptions {
|
||||
resources: {
|
||||
common: typeof common;
|
||||
index: typeof index;
|
||||
leaderboard: typeof leaderboard;
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user