I18n

i18n hooks

npm (scoped)

源码 Code

@spax/i18n

安装 Install

$ yarn add @spax/i18n

使用 Usage

import { setup, changeLng, addT, useT } from "@spax/i18n";

setup(i18nextOptions);

changeLng(currentLanguage);

addT({
  "zh": { ... },
  "en": { ... },
});

// then

function MyFunctionalComponent(props: any) {
  const [ t ] = useT();

  console.log(t("hello"));
}

results matching ""

    No results matching ""