Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translations: refactor cli #322

Merged

Conversation

zzacharo
Copy link
Member

@zzacharo zzacharo commented Jul 5, 2021

Workflow to translate

 1) Add a new language
    npm run init_catalog lang <lang>
 2) Extract translation keys/values
    $ npm run extract_messages
 3) Update the src/lib/translations/messages/index.js file
    import TRANSLATE_<lang> from './<lang>/translations.json'
    export const translations = {
      ...rest,
      <lang>: { translation: TRANSLATE_<lang> }
    }
 4) Install the transifex-client
    $ pip install transifex-client
 5) Push source (.pot) and translations (.po) to Transifex
    $ tx push -s -t
 6) Pull translations for a single language from Transifex
    $ tx pull -l <lang>
 7) Pull translations for all languages from Transifex
    $ tx pull -a
 8) Compile .po files for all languages
    $ npm run compile_catalog
 9) Convert .po file for a single language
    $ npm run compile_catalog lang <lang>

Screenshot 2021-07-06 at 16 09 46

Added as bonus some greek translations :)

src/lib/i18next.js Outdated Show resolved Hide resolved
Copy link
Contributor

@mb-wali mb-wali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so far so good!

@zzacharo zzacharo marked this pull request as ready for review July 6, 2021 14:08
@zzacharo
Copy link
Member Author

zzacharo commented Jul 6, 2021

Once merged update the #319 with the new workflow :)

Copy link
Contributor

@mb-wali mb-wali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lnielsen lnielsen merged commit 2393433 into inveniosoftware:master Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants