import { createI18nApi, declareComponentKeys } from "i18nifty"; //List the languages you with to support export const languages = ["en", "fr"] as const; //If the user's browser language doesn't match any //of the languages above specify the language to fallback to: export const fallbackLanguage = "en"; export type Language = typeof languages[number]; export type LocalizedString = Parameters[0]; export const { useTranslation, resolveLocalizedString, useLang, $lang, useResolveLocalizedString, /** For use outside of React */ getTranslation, } = createI18nApi< | import ("pages/LeaderboardPage/LeaderboardPage").I18n >()( { languages, fallbackLanguage }, { "en": { "LeaderboardPage": { "greating": ({ who })=> `Hello ${who}`, "how are you": "How are you feeling today?", "learn more": ({ href }) => ( <> Learn more about this website. ) }, }, /* spell-checker: disable */ "fr": { "LeaderboardPage": { "greating": ({ who })=> `Bonjour ${who}`, "how are you": "Comment vous sentez vous au jour d'hui?", "learn more": ({ href }) => ( <> En savoir plus à propos de ce site web. ) }, } /* spell-checker: enable */ } );