0.0.2 • Published 3 years ago

@abtasty/editor-translations v0.0.2

Weekly downloads
7
License
UNLICENSED
Repository
-
Last release
3 years ago

Google sheets translations

Translations file is located here: https://docs.google.com/spreadsheets/d/13U-j06aW_8FQfhopBrgGHjMNmWjN0UaUaNl5qm12lGg/edit?pli=1#gid=675474690

To run the update command, please, ensure that your node version is about 12 and do:

npm run update:translations

Transifex translations

Converting manually the translation files

The translation files from Transifex are in a GetText format and need to be converted to JSON. There's a gettext converter package that can do it.

You can use it like so:

$ i18next-conv -l en_GB -s abtasty-widgets_en_GB.po -t abtasty-widgets_en_GB.json

Using the translation

We're using the React Intl package for the internationalisations. It wraps our app in a Context Provider, that you can access anywhere in the tree by importing. A very simple usage example:

intl.formatMessage({id: 'translationKey'});

// OR

useTranslation(translationKey, lang);