4
packages/webapp/src/@types/i18next.d.ts
vendored
4
packages/webapp/src/@types/i18next.d.ts
vendored
@@ -1,8 +1,10 @@
|
|||||||
import type { resources } from "@/i18n"
|
import type { defaultNS, resources } from "@/i18n"
|
||||||
|
|
||||||
|
|
||||||
declare module "i18next" {
|
declare module "i18next" {
|
||||||
interface CustomTypeOptions {
|
interface CustomTypeOptions {
|
||||||
|
enableSelector: true
|
||||||
|
defaultNS: typeof defaultNS
|
||||||
resources: typeof resources["en"]
|
resources: typeof resources["en"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export const en = {
|
export const en = {
|
||||||
|
common: {},
|
||||||
nav: {
|
nav: {
|
||||||
gitRepos: "Git repositories",
|
gitRepos: "Git repositories",
|
||||||
sourceCode: "Source code",
|
sourceCode: "Source code",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import type { en } from "./en"
|
|||||||
|
|
||||||
|
|
||||||
export const fr = {
|
export const fr = {
|
||||||
|
common: {},
|
||||||
nav: {
|
nav: {
|
||||||
gitRepos: "Dépôts Git",
|
gitRepos: "Dépôts Git",
|
||||||
sourceCode: "Code source",
|
sourceCode: "Code source",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { en } from "./en"
|
|||||||
import { fr } from "./fr"
|
import { fr } from "./fr"
|
||||||
|
|
||||||
|
|
||||||
|
export const defaultNS = "common"
|
||||||
export const resources = { en, fr } as const
|
export const resources = { en, fr } as const
|
||||||
|
|
||||||
await i18n
|
await i18n
|
||||||
@@ -12,6 +13,7 @@ await i18n
|
|||||||
.use(LanguageDetector)
|
.use(LanguageDetector)
|
||||||
.init({
|
.init({
|
||||||
supportedLngs: ["en", "fr"],
|
supportedLngs: ["en", "fr"],
|
||||||
|
defaultNS,
|
||||||
resources,
|
resources,
|
||||||
interpolation: {
|
interpolation: {
|
||||||
escapeValue: false
|
escapeValue: false
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ function RootComponent() {
|
|||||||
<div className="container mt-10 mr-auto ml-auto flex flex-row items-center justify-center gap-20">
|
<div className="container mt-10 mr-auto ml-auto flex flex-row items-center justify-center gap-20">
|
||||||
<div className="flex flex-row items-center justify-center gap-2">
|
<div className="flex flex-row items-center justify-center gap-2">
|
||||||
<Button asChild>
|
<Button asChild>
|
||||||
<a href="https://git.valverde.cloud"><DiGit /> {t("nav:gitRepos")}</a>
|
<a href="https://git.valverde.cloud"><DiGit /> {t($ => $.gitRepos, { ns: "nav" })}</a>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button asChild>
|
<Button asChild>
|
||||||
<a href="https://git.valverde.cloud/thilawyn/website"><FaCode /> {t("nav:sourceCode")}</a>
|
<a href="https://git.valverde.cloud/thilawyn/website"><FaCode /> {t($ => $.sourceCode, { ns: "nav" })}</a>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button>Resumé</Button>
|
<Button>Resumé</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user