superset/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-translation
Krist Wongsuphasawat fca5c4bf67 Merge pull request #14 from apache-superset/kristw--publishconf
update package.json to include publishConfig
2021-11-26 11:44:31 +08:00
..
src Merge pull request #13 from apache-superset/kristw--translator-lint 2021-11-26 11:44:31 +08:00
test Merge pull request #13 from apache-superset/kristw--translator-lint 2021-11-26 11:44:31 +08:00
package.json Merge pull request #14 from apache-superset/kristw--publishconf 2021-11-26 11:44:31 +08:00
README.md Merge pull request #12 from apache-superset/kristw--translation 2021-11-26 11:44:31 +08:00

@superset-ui/translation

Version

i18n locales and translation for Superset

SupersetTranslation

Example usage

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

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

console.log(t('text to be translated'));

API

configure({ [languagePack] })

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

t(text[, args])

  • Translate text when no args is provided.
  • Translate text and substitute args into the placeholders specified within text.

For example

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

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

Development

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