0.14.23 • Published 4 years ago

@superset-ui/translation v0.14.23

Weekly downloads
792
License
Apache-2.0
Repository
github
Last release
4 years ago

@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.

0.14.23

4 years ago

0.14.20

4 years ago

0.14.9

4 years ago

0.14.0

4 years ago

0.13.27

4 years ago

0.13.21

4 years ago

0.13.9

4 years ago

0.13.3

4 years ago

0.13.0

4 years ago

0.12.19

4 years ago

0.12.21

4 years ago

0.12.14

4 years ago

0.12.13

4 years ago

0.12.12

4 years ago

0.12.8

4 years ago

0.12.5

5 years ago

0.12.0

5 years ago

0.11.9

5 years ago

0.11.5

5 years ago

0.11.4

5 years ago

0.11.0

5 years ago

0.10.0

5 years ago

0.9.5

5 years ago

0.9.3

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago