mirror of
https://github.com/apache/superset.git
synced 2024-09-19 20:19:37 -04:00
fca5c4bf67
update package.json to include publishConfig |
||
---|---|---|
.. | ||
src | ||
test | ||
package.json | ||
README.md |
@superset-ui/translation
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 noargs
is provided. - Translate
text
and substituteargs
into the placeholders specified withintext
.
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.