@nextinq.public/i18n
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@nextinq/i18n

Base i18n utils

Installation

yarn add @nextinq/i18n

Usage

  • Setup: Run on app start-up
import { initLocale } from '@nextinq/i18n';
// Phrases can be loaded from server, bundled with app, ...
import { csPhrases } from './locales/cs';

// Example phrases: csPhrases = { "hello": "Ahoj", "cancel": "Zrušit" };

initLocale({
  locale: 'cs',
  phrases: csPhrases,
});
import { t } from '@nextinq/i18n';

const greeting = t('hello') // => 'Ahoj'

Development

Test

yarn test

CI/CD

See Github actions

NPN Publish Setup

In order to publish packages to npmjs.org or to Github Registry you should add npm_token and/or github_token in Settings -> Secrets of the current project

Readme

Keywords

none

Package Sidebar

Install

npm i @nextinq.public/i18n

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

188 kB

Total Files

21

Last publish

Collaborators

  • jkaramon