Last active
July 6, 2020 12:14
-
-
Save zoontek/8cab77e760825f670c1bbee412713b6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import frenchkiss, { TranslationParams } from "frenchkiss"; | |
const en = { | |
"button.hello": "Hello", | |
}; | |
type TranslationKey = keyof typeof en; | |
const fr: { [key in TranslationKey]: string } = { | |
"button.hello": "Bonjour", | |
}; | |
frenchkiss.locale("en"); | |
frenchkiss.set("en", en); | |
export const t = (key: TranslationKey, params?: TranslationParams) => | |
frenchkiss.t(key as string, params); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment