Skip to content

Instantly share code, notes, and snippets.

@zoontek
Last active July 6, 2020 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoontek/8cab77e760825f670c1bbee412713b6a to your computer and use it in GitHub Desktop.
Save zoontek/8cab77e760825f670c1bbee412713b6a to your computer and use it in GitHub Desktop.
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