diff --git a/.github/workflows/translations-pull-request.yml b/.github/workflows/translations-pull-request.yml new file mode 100644 index 000000000..74a692beb --- /dev/null +++ b/.github/workflows/translations-pull-request.yml @@ -0,0 +1,46 @@ +name: Translations download and PR + +on: + workflow_dispatch: + schedule: + - cron: '00 3 * * 1' + + + +jobs: + crowdin-translations-to-pr: + name: Create a PR with the latest translations from Crowdin + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Download Crowdin translations and create Pull Request + uses: crowdin/github-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + project_id: ${{ secrets.CROWDIN_PROJECT_ID }} + token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + config: 'crowdin.yml' + crowdin_branch_name: ${{ github.ref_name }} + + upload_sources: false + upload_translations: false + + download_translations: true + download_translations_args: '-l zh-CN' + localization_branch_name: update-translations-crowdin + push_translations: true + commit_message: 'Update translations' + + create_pull_request: true + pull_request_title: 'Update translations' + pull_request_body: | + **This is an automated PR.** + + This PR updates the translations using the content from Crowdin. Thanks to all the translators for the really hard work!!! + + If you want to help to make the localization better, or add a new language, go to [Crowdin](https://crowdin.com/project/expresslrs-configurator/) and start helping!. + + [crowdin.com/expresslrs-configurator](https://crowdin.com/project/expresslrs-configurator/) diff --git a/.github/workflows/translations-upload.yml b/.github/workflows/translations-upload.yml new file mode 100644 index 000000000..6c0998051 --- /dev/null +++ b/.github/workflows/translations-upload.yml @@ -0,0 +1,34 @@ +name: Upload translation keys to Crowdin + +concurrency: upload-crowdin + +on: + workflow_dispatch: + push: + branches: + - master + paths: + - 'locales/en/**' + +jobs: + upload-message-keys-to-crowdin: + name: Messages file to Crowdin + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Upload messages file + uses: crowdin/github-action@1.5.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + project_id: ${{ secrets.CROWDIN_PROJECT_ID }} + token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + config: 'crowdin.yml' + crowdin_branch_name: ${{ github.ref_name }} + + upload_sources: true + upload_translations: false + + download_translations: false diff --git a/.gitignore b/.gitignore index 246baceda..1ef6bc439 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ npm-debug.log.* /src/api/src/services/BinaryFlashingStrategy/firmware __pycache__ r2 +crowdin_env.sh diff --git a/README.md b/README.md index 526b9c79e..f27053acf 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,21 @@ ExpressLRS Configurator is a cross-platform build & configuration tool for the ## Support ExpressLRS -Supporting ExpressLRS is as easy as contributing a feature, either code or just a fleshed out idea. Coding not your thing? Testing a Pull Request using the convenient Configurator tab and providing feedback is essential as well. We're all working together. +Supporting ExpressLRS is as easy as contributing a feature, either code or just a fleshed out idea. Coding not your +thing? Testing a Pull Request using the convenient Configurator tab and providing feedback is essential as well. We're +all working together. -If you don't have the time to contribute in that way, consider making a small donation. Donations are used to buy test equipment, software licenses, and certificates needed to further the project and make it securely accessible. ExpressLRS accepts donations through [Open Collective](https://opencollective.com/expresslrs), which provides recognition of donors and transparency on how that support is utilized. +If you don't have the time to contribute in that way, consider making a small donation. Donations are used to buy test +equipment, software licenses, and certificates needed to further the project and make it securely accessible. ExpressLRS +accepts donations through [Open Collective](https://opencollective.com/expresslrs), which provides recognition of donors +and transparency on how that support is utilized. [![Open Collective backers](https://img.shields.io/opencollective/backers/expresslrs?label=Open%20Collective%20backers)](https://opencollective.com/expresslrs) ## Quick Start Guide -If you have hardware that you want to flash, please refer to our guides on the [website](https://www.expresslrs.org/), and our [FAQ](https://www.expresslrs.org/3.0/faq/) + +If you have hardware that you want to flash, please refer to our guides on the [website](https://www.expresslrs.org/), +and our [FAQ](https://www.expresslrs.org/3.0/faq/) ## Installation @@ -40,9 +47,11 @@ The minimum required version of windows is Windows 8. #### macOS Changes to the security model used in the latest versions of MacOS X 10.14 (Mojave) and 10.15 (Catalina) -mean that the operating system will show an error message ('"ExpressLRS Configurator.app" cannot be openend because the developer cannot be verified') when trying to install the application. +mean that the operating system will show an error message ('"ExpressLRS Configurator.app" cannot be openend because the +developer cannot be verified') when trying to install the application. -To work around this, click `ExpressLRS Configurator.app` while pressing `control` key, and click `Open`. In the popup, you'll be able to forcefully open the application. (you may need to try this twice.) +To work around this, click `ExpressLRS Configurator.app` while pressing `control` key, and click `Open`. In the popup, +you'll be able to forcefully open the application. (you may need to try this twice.) Alternatively, run the following command in a terminal after installing: @@ -110,6 +119,38 @@ sudo apt update sudo apt install git ``` +## Localisation + +**Please do not submit pull requests for translation changes, but read and follow the instructions below!** + +ExpressLRS Configurator has been translated into several languages. The application will try to detect and use your +system language if a translation into this language is available. + +If you prefer to have the application in English or any other language, you can select your desired language in the +"Settings" menu. + +We want to make ExpressLRS accessible for pilots who are not fluent in English. We have got a team of volunteer +translators who do this work, but additional translators are always welcome to share the workload, and we are keen to +add additional languages. If you would like to help us with translations, you have got the following options: + +- if you help by suggesting some updates or improvements to translations in a language you are familiar with, head + to [crowdin.com](https://crowdin.com/project/expresslrs-configurator) and add your suggested translations there. +- if you would like to start working on the translation for a new language, or take on responsibility for proof-reading + the translation for a language you are very familiar with, please head to the ExpressLRS Discord chat + (registration [here](https://discord.gg/dS6ReFY)), and join the + [#configurator-translation](https://discord.com/channels/596350022191415318/1121712995505021059) channel - the people + in there can help you to get a new language added, or set you up as a proof reader. + +Our localisation progress: + +![Translations progress](https://badges.awesome-crowdin.com/translation-15884405-596659-update.png) + +## Screenshots + +![Main screen](docs/readme/screenshots/main_screen.jpg) + +![Compile result](docs/readme/screenshots/compile_result.jpg) + ## Architecture ``` @@ -150,7 +191,7 @@ yarn install --frozen-lockfile yarn start ``` -In order to simulate WI-FI devices on your local network you can start application with +In order to simulate WI-FI devices on your local network you can start application with `MULTICAST_DNS_SIMULATOR_ENABLED` environment variable: ``` @@ -165,16 +206,6 @@ Generate TypeScript types from Graphql schema and Queries located in [src/ui/gql yarn run gql-codegen ``` -## Screenshots - -![Main screen](docs/readme/screenshots/main_screen.jpg) - -![Compile result](docs/readme/screenshots/compile_result.jpg) - -## Credits - -- [electron-react-boilerplate](https://github.com/electron-react-boilerplate/electron-react-boilerplate) - ## Legal disclaimer The use and operation of this type of device may require a license, and some countries may forbid its use. It is diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 000000000..54cae226a --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,13 @@ +project_id_env: CROWDIN_PROJECT_ID +api_token_env: CROWDIN_PERSONAL_TOKEN +"base_path": "." +"base_url": "https://api.crowdin.com" + +"preserve_hierarchy": true + +files: [ + { + "source": "/src/i18n/locales/en/messages.json", + "translation": "/src/i18n/locales/%two_letters_code%/%original_file_name%", + } +] diff --git a/src/i18n/index.ts b/src/i18n/index.ts index c45b223e2..7fa855898 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -10,7 +10,7 @@ i18n .init({ fallbackLng: 'en', backend: { - loadPath: './i18n/{{lng}}/translation.json', + loadPath: './i18n/locales/{{lng}}/messages.json', }, debug: process.env.NODE_ENV === 'development' || diff --git a/src/i18n/en/translation.json b/src/i18n/locales/en/messages.json similarity index 100% rename from src/i18n/en/translation.json rename to src/i18n/locales/en/messages.json diff --git a/src/i18n/zh-CN/translation.json b/src/i18n/locales/zh-CN/messages.json similarity index 100% rename from src/i18n/zh-CN/translation.json rename to src/i18n/locales/zh-CN/messages.json