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

Create translation files for bridge UI and sync them with Crowdin #132

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

nop33
Copy link
Member

@nop33 nop33 commented Jun 14, 2024

Related to #131

Comment on lines +4 to +7
workflow_dispatch:
push:
paths: ['bridge_ui/locales/**']
branches: [master]
Copy link
Member Author

Choose a reason for hiding this comment

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

This workflow will run either when we manually run it, or when there is any change in the translation files when pushing to master.

@@ -0,0 +1,36 @@
name: Sync translations
Copy link
Member Author

Choose a reason for hiding this comment

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

This workflow will:

  1. Upload new translation strings to Crowdin
  2. Download any new approved translations from Crowdin

Comment on lines +9 to +11
permissions:
contents: write
pull-requests: write
Copy link
Member Author

Choose a reason for hiding this comment

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

This is required so that Crowdin can open PRs in this repo. We need to make sure that GitHub Actions are allowed to do that. This can be toggled in the settings of this repo: https://github.com/alephium/wormhole-fork/settings/actions

It looks like this:

image

Comment on lines +35 to +36
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to set these 2 secrets up in this project. Hit me up to give you the secrets.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the source file of all translations. When updating the UI, new strings need to be added here so that they are synced with Crowdin at the next push on master.

@@ -42,6 +42,7 @@
"qrcode.react": "^3.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-i18next": "^14.1.2",
Copy link
Member Author

Choose a reason for hiding this comment

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

This library takes care of using the right translation file based on the choice of the user (language switcher component will be implemented later, once we have some translations, for now we only have the English source file).

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the config file for Crowdin, defining the source and translation files.

@nop33 nop33 requested review from polarker and Lbqds June 14, 2024 13:04
Copy link
Member

@polarker polarker left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@nop33 nop33 merged commit 7eec02b into master Jun 14, 2024
10 of 12 checks passed
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.

2 participants