This package has been deprecated

Author message:

We merged all @superset-ui packages. Use @superset-ui/core instead.

@superset-ui/translation
TypeScript icon, indicating that this package has built-in type declarations

0.14.23 • Public • Published

@superset-ui/translation

Version David (path)

i18n locales and translation for Superset

SupersetTranslation

Example usage

import { configure, t, tn } from '@superset-ui/translation';

configure({
  languagePack: {...},
});

console.log(t('text to be translated'));
console.log(tn('singular text', 'plural text', value));

API

configure({ [languagePack] })

  • Initialize the translator
  • Initialize with the default language if no languagePack is specified.

t(text[, args])

  • Translate text.
  • If args is provided, substitute args into the sprintf placeholders specified within text translation.

For example

t('Hello %(name)s', user);

See sprintf-js for more details on how to define placeholders.

tn(singular, plural, num, [, args])

  • Translate and choose between singular and plural based on num.
  • If args is provided, substitute args into the sprintf placeholders specified within singular or plural translations.

For example

tn('%d duck', '%d ducks', 2, 2);

Development

@data-ui/build-config is used to manage the build configuration for this package including babel builds, jest testing, eslint, and prettier.

Package Sidebar

Install

npm i @superset-ui/translation

Weekly Downloads

88

Version

0.14.23

License

Apache-2.0

Unpacked Size

28.7 kB

Total Files

24

Last publish

Collaborators

  • eschutho
  • arash_suri
  • michael.s.molina
  • suddjian
  • superset-ui-owner
  • kristw
  • data-ui
  • conglei
  • christopher.card.williams
  • soboko
  • mistercrunch
  • cdchambers
  • khtruong
  • erik_ritter
  • graceguo-supercat
  • michellet
  • supersetbot
  • ktmud
  • villebro
  • rusackas
  • kgabryje