export type Locale = "en" | "fr"; export const DEFAULT_LOCALE: Locale = "en"; const dict = { en: { "nav.research": "Research", "nav.topics": "Topics", "nav.series": "Series", "nav.about": "About", "nav.methodology": "Methodology", "nav.infrastructure": "Infrastructure", "nav.transparency": "Transparency", "nav.admin": "Admin", "footer.credit": "Research computed on MacLustr — an Apple Silicon research compute infrastructure.", "footer.disclaimer": "AutoScholar working papers are AI-generated and not formally peer reviewed.", "disclosure.line": "AI-generated working paper; not formally peer reviewed.", byline: "AutoScholar — AI-generated research", "search.placeholder": "Search titles, abstracts, keywords or paper IDs", "search.empty": "No papers match these filters yet.", "library.empty": "The library is empty. Papers appear here after they pass every quality gate.", "theme.toggle": "Toggle colour scheme", }, fr: { "nav.research": "Recherche", "nav.topics": "Thèmes", "nav.series": "Séries", "nav.about": "À propos", "nav.methodology": "Méthodologie", "nav.infrastructure": "Infrastructure", "nav.transparency": "Transparence", "nav.admin": "Admin", "footer.credit": "Recherche calculée sur MacLustr — une infrastructure de calcul de recherche Apple Silicon.", "footer.disclaimer": "Les documents de travail AutoScholar sont générés par IA et ne sont pas formellement évalués par des pairs.", "disclosure.line": "Document de travail généré par IA ; non évalué formellement par des pairs.", byline: "AutoScholar — recherche générée par IA", "search.placeholder": "Rechercher des titres, résumés, mots-clés ou identifiants", "search.empty": "Aucun document ne correspond à ces filtres.", "library.empty": "La bibliothèque est vide. Les documents apparaissent ici après avoir passé toutes les vérifications de qualité.", "theme.toggle": "Changer le thème", }, } as const; export type Key = keyof (typeof dict)["en"]; export function t(key: Key, locale: Locale = DEFAULT_LOCALE): string { return dict[locale][key] ?? dict.en[key]; }