mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
perf!: monorepo setup + fully static + webp images
BREAKING CHANGE: minimum supported Node.js >= 22.0.0 and pnpm >= 9.5.0
This commit is contained in:
30
packages/i18n/src/config.tsx
Normal file
30
packages/i18n/src/config.tsx
Normal file
@ -0,0 +1,30 @@
|
||||
import type { RichTranslationValues } from "next-intl"
|
||||
|
||||
export const LOCALES = ["en-US", "fr-FR"] as const
|
||||
export type Locale = (typeof LOCALES)[number]
|
||||
export const LOCALE_DEFAULT = "en-US" satisfies Locale
|
||||
export const LOCALE_PREFIX = "never"
|
||||
|
||||
export interface LocaleProps {
|
||||
params: {
|
||||
locale: Locale
|
||||
}
|
||||
}
|
||||
|
||||
export const defaultTranslationValues: RichTranslationValues = {
|
||||
br: () => {
|
||||
return <br />
|
||||
},
|
||||
strong: (children) => {
|
||||
return <strong>{children}</strong>
|
||||
},
|
||||
em: (children) => {
|
||||
return <em>{children}</em>
|
||||
},
|
||||
s: (children) => {
|
||||
return <s>{children}</s>
|
||||
},
|
||||
u: (children) => {
|
||||
return <u>{children}</u>
|
||||
},
|
||||
}
|
27
packages/i18n/src/i18n.ts
Normal file
27
packages/i18n/src/i18n.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import deepmerge from "deepmerge"
|
||||
import type { AbstractIntlMessages } from "next-intl"
|
||||
import { getRequestConfig } from "next-intl/server"
|
||||
import { notFound } from "next/navigation"
|
||||
|
||||
import type { Locale } from "./config"
|
||||
import { defaultTranslationValues, LOCALE_DEFAULT, LOCALES } from "./config"
|
||||
|
||||
export default getRequestConfig(async ({ locale }) => {
|
||||
if (!LOCALES.includes(locale as Locale)) {
|
||||
return notFound()
|
||||
}
|
||||
|
||||
const userMessages = (await import(`./translations/${locale}.json`)).default
|
||||
const defaultMessages = (
|
||||
await import(`./translations/${LOCALE_DEFAULT}.json`)
|
||||
).default
|
||||
const messages = deepmerge<AbstractIntlMessages>(
|
||||
defaultMessages,
|
||||
userMessages,
|
||||
)
|
||||
|
||||
return {
|
||||
messages,
|
||||
defaultTranslationValues,
|
||||
}
|
||||
})
|
10
packages/i18n/src/messages.d.ts
vendored
Normal file
10
packages/i18n/src/messages.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import type en from "./translations/en-US.json"
|
||||
|
||||
type Messages = typeof en
|
||||
|
||||
declare global {
|
||||
/**
|
||||
* Use type safe message keys with `next-intl`.
|
||||
*/
|
||||
interface IntlMessages extends Messages {}
|
||||
}
|
9
packages/i18n/src/navigation.ts
Normal file
9
packages/i18n/src/navigation.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { createSharedPathnamesNavigation } from "next-intl/navigation"
|
||||
|
||||
import { LOCALES, LOCALE_PREFIX } from "./config"
|
||||
|
||||
export const { Link, redirect, usePathname, useRouter, permanentRedirect } =
|
||||
createSharedPathnamesNavigation({
|
||||
locales: LOCALES,
|
||||
localePrefix: LOCALE_PREFIX,
|
||||
})
|
75
packages/i18n/src/translations/en-US.json
Normal file
75
packages/i18n/src/translations/en-US.json
Normal file
@ -0,0 +1,75 @@
|
||||
{
|
||||
"meta": {
|
||||
"title": "Théo LUDWIG",
|
||||
"description": "Developer Full Stack • Open-Source Enthusiast"
|
||||
},
|
||||
"locales": {
|
||||
"en-US": "English",
|
||||
"fr-FR": "French"
|
||||
},
|
||||
"footer": {
|
||||
"all-rights-reserved": "All rights reserved"
|
||||
},
|
||||
"errors": {
|
||||
"error": "Error",
|
||||
"page-doesnt-exist": "This page doesn't exist!",
|
||||
"not-found": "Not Found",
|
||||
"server-error": "Internal Server Error!",
|
||||
"return-to-home-page": "Return to the home page?",
|
||||
"try-again": "Try again?"
|
||||
},
|
||||
"home": {
|
||||
"about": {
|
||||
"pronouns": {
|
||||
"label": "Pronouns",
|
||||
"value": "He/Him"
|
||||
},
|
||||
"birth-date": {
|
||||
"label": "Birth date",
|
||||
"value": "{birthDate} ({age} years old)"
|
||||
},
|
||||
"nationality": {
|
||||
"label": "Nationality",
|
||||
"value": "Alsace, France"
|
||||
},
|
||||
"email": {
|
||||
"label": "Email",
|
||||
"value": "{email}"
|
||||
},
|
||||
"description": "I constantly wonder how to <strong>improve our present, to make our future better</strong>, particularly thanks to the advancements in <strong>computer science</strong>."
|
||||
},
|
||||
"interests": {
|
||||
"title": "Interests",
|
||||
"code": {
|
||||
"title": "Developer Full Stack",
|
||||
"description": "My priority is to craft <strong>intuitive user experiences (<abbr-ux>UX</abbr-ux>)</strong>, that meet the needs of the users <strong>in the most efficient way possible</strong>. <br></br> Mainly focused on the development of <strong>Web solutions</strong>. <br></br> I am also interested in mobile and desktop application development, among other areas within the field of computer science."
|
||||
},
|
||||
"open-source": {
|
||||
"title": "Open-Source Enthusiast",
|
||||
"description": "I value the <strong>sharing of knowledge and collaboration</strong> to collectively resolve problems. <br></br> The source code of the website is available on <github-link>GitHub</github-link>."
|
||||
}
|
||||
},
|
||||
"skills": {
|
||||
"title": "Skills",
|
||||
"programming-languages": "Programming languages",
|
||||
"frontend": "Frontend",
|
||||
"backend": "Backend",
|
||||
"software-tools": "Software and tools"
|
||||
},
|
||||
"portfolio": {
|
||||
"title": "Portfolio",
|
||||
"carolo": {
|
||||
"title": "Carolo",
|
||||
"description": "Strategy board game similar to chess which allows grandiose moves (only available in French)."
|
||||
},
|
||||
"leon": {
|
||||
"title": "Leon",
|
||||
"description": "Leon is your open-source personal assistant."
|
||||
}
|
||||
},
|
||||
"open-source": {
|
||||
"title": "Open-Source",
|
||||
"description": "Most famous open source projects I contributed to."
|
||||
}
|
||||
}
|
||||
}
|
75
packages/i18n/src/translations/fr-FR.json
Normal file
75
packages/i18n/src/translations/fr-FR.json
Normal file
@ -0,0 +1,75 @@
|
||||
{
|
||||
"meta": {
|
||||
"title": "Théo LUDWIG",
|
||||
"description": "Développeur Full Stack • Enthousiaste de l'Open-Source"
|
||||
},
|
||||
"locales": {
|
||||
"en-US": "Anglais",
|
||||
"fr-FR": "Français"
|
||||
},
|
||||
"footer": {
|
||||
"all-rights-reserved": "Tous droits réservés"
|
||||
},
|
||||
"errors": {
|
||||
"error": "Erreur",
|
||||
"page-doesnt-exist": "Cette page n'existe pas !",
|
||||
"not-found": "Introuvable",
|
||||
"server-error": "Erreur interne du serveur !",
|
||||
"return-to-home-page": "Retour à la page d'accueil ?",
|
||||
"try-again": "Réessayer ?"
|
||||
},
|
||||
"home": {
|
||||
"about": {
|
||||
"pronouns": {
|
||||
"label": "Pronoms",
|
||||
"value": "Il/Lui"
|
||||
},
|
||||
"birth-date": {
|
||||
"label": "Date de naissance",
|
||||
"value": "{birthDate} ({age} ans)"
|
||||
},
|
||||
"nationality": {
|
||||
"label": "Nationalité",
|
||||
"value": "Alsace, France"
|
||||
},
|
||||
"email": {
|
||||
"label": "Email",
|
||||
"value": "{email}"
|
||||
},
|
||||
"description": "Je me demande constamment comment <strong>améliorer notre présent, afin de rendre notre futur meilleur</strong>, particulièrement grâce aux progrès de <strong>l'informatique</strong>."
|
||||
},
|
||||
"interests": {
|
||||
"title": "Intérêts",
|
||||
"code": {
|
||||
"title": "Développeur Full Stack",
|
||||
"description": "Ma priorité réside dans la création <strong>d'expériences utilisateurs (<abbr-ux>UX</abbr-ux>) intuitives</strong>, répondant aux besoins des utilisateurs de la <strong>manière la plus efficace que possible</strong>. <br></br> Principalement axé sur l'élaboration de <strong>solutions en Développement Web</strong>. <br></br> Je suis également intéressé par le développement d'applications mobiles parmis d'autres domaines de l'informatique."
|
||||
},
|
||||
"open-source": {
|
||||
"title": "Enthousiaste de l'Open-Source",
|
||||
"description": "J'apprécie le <strong>partage des connaissances et la collaboration</strong> pour résoudre des défis collectivement. <br></br> Le code source du site est accessible sur <github-link>GitHub</github-link>."
|
||||
}
|
||||
},
|
||||
"skills": {
|
||||
"title": "Compétences",
|
||||
"programming-languages": "Langages de programmation",
|
||||
"frontend": "Frontend",
|
||||
"backend": "Backend",
|
||||
"software-tools": "Logiciels et outils"
|
||||
},
|
||||
"portfolio": {
|
||||
"title": "Portfolio",
|
||||
"carolo": {
|
||||
"title": "Carolo",
|
||||
"description": "Jeu de plateau stratégique similaire aux échecs qui permet des coups grandioses, reposant sur des enchaînements remarquables."
|
||||
},
|
||||
"leon": {
|
||||
"title": "Leon",
|
||||
"description": "Leon est votre assistant personnel open source."
|
||||
}
|
||||
},
|
||||
"open-source": {
|
||||
"title": "Open-Source",
|
||||
"description": "Projets open source les plus célèbres auxquels j'ai contribué."
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user