lequanghuylc / quickly-react-text-i18n

Localization i18n for React & React Native, friendly CMS to update translations on the go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install

yarn add quickly-react-text-i18n

Usage

import { create } from 'quickly-react-text-i18n';
const { TranslationGroup, useTranslation } = create({
  localData: {
    en: {
      'Hello World': 'Hello World'
    },
    vi: {
      'Hello World': 'Xin chào thế giới'
    }}
  },
});

<TranslationGroup type="screen" id="y">
  <ScreenContainer>
    <Col flex1 middle>
      <Text>Hello World</Text>
    </Col>
  </ScreenContainer>
</TranslationGroup>

// or

const SomeTextComponent = ({ children }) => {
  const [text] = useTranslation(children);
  return <h1>{text}</h1>
}

<TranslationGroup type="screen" id="y">
  <div>
    <SomeTextComponent>Hello World</SomeTextComponent>
  </div>
</TranslationGroup>

Example

Comming soon

Road maps

  • Nice & friendly interface to update translations
  • Has the option to download as local data
  • Change language and update real-time via Iframe

About

Localization i18n for React & React Native, friendly CMS to update translations on the go


Languages

Language:TypeScript 100.0%