spb/autoscholar
Public
1export type Locale = "en" | "fr";2export const DEFAULT_LOCALE: Locale = "en";34const dict = {5 en: {6 "nav.research": "Research",7 "nav.topics": "Topics",8 "nav.series": "Series",9 "nav.about": "About",10 "nav.methodology": "Methodology",11 "nav.infrastructure": "Infrastructure",12 "nav.transparency": "Transparency",13 "nav.admin": "Admin",14 "footer.credit": "Research computed on MacLustr — an Apple Silicon research compute infrastructure.",15 "footer.disclaimer": "AutoScholar working papers are AI-generated and not formally peer reviewed.",16 "disclosure.line": "AI-generated working paper; not formally peer reviewed.",17 byline: "AutoScholar — AI-generated research",18 "search.placeholder": "Search titles, abstracts, keywords or paper IDs",19 "search.empty": "No papers match these filters yet.",20 "library.empty": "The library is empty. Papers appear here after they pass every quality gate.",21 "theme.toggle": "Toggle colour scheme",22 },23 fr: {24 "nav.research": "Recherche",25 "nav.topics": "Thèmes",26 "nav.series": "Séries",27 "nav.about": "À propos",28 "nav.methodology": "Méthodologie",29 "nav.infrastructure": "Infrastructure",30 "nav.transparency": "Transparence",31 "nav.admin": "Admin",32 "footer.credit":33 "Recherche calculée sur MacLustr — une infrastructure de calcul de recherche Apple Silicon.",34 "footer.disclaimer":35 "Les documents de travail AutoScholar sont générés par IA et ne sont pas formellement évalués par des pairs.",36 "disclosure.line": "Document de travail généré par IA ; non évalué formellement par des pairs.",37 byline: "AutoScholar — recherche générée par IA",38 "search.placeholder": "Rechercher des titres, résumés, mots-clés ou identifiants",39 "search.empty": "Aucun document ne correspond à ces filtres.",40 "library.empty":41 "La bibliothèque est vide. Les documents apparaissent ici après avoir passé toutes les vérifications de qualité.",42 "theme.toggle": "Changer le thème",43 },44} as const;4546export type Key = keyof (typeof dict)["en"];47export function t(key: Key, locale: Locale = DEFAULT_LOCALE): string {48 return dict[locale][key] ?? dict.en[key];49}50