-
Notifications
You must be signed in to change notification settings - Fork 1
Contribute a Translation via GitHub Codespaces
This page describes how to contribute a translation to a brdgm.me Solo Helper Application. It uses the Ark Nova Solo Helper as example, but works for all applications found in GitHub.
This page describes an advanced approach using GitHub Codespaces, which allows you to prepare a translation, test it in the running application and then provide a pull request to contribute it back to the main code base. All this works in your browser.
If you do not have a GitHub account, go to https://github.com and create one via "Sign up" - it's free!
Go to the code repository of the brdgm.me application, e.g. https://github.com/brdgm/ark-nova-solo-helper and click the "Fork" button and confirm to create the fork in the next screen. You now have a copy of the repository in your personal GitHub profile and can work on it.
On your fork of the repository, create a new codespace via "Code -> Codespaces -> Create codespace on develop". It make take a bit when you open it the first time.
Each Solo Helper Application has an English master file located inside the code repository at src/locales/en.json
. Open it in the tree browser.
Via "File -> Save As..." save the file in the same directory using a new name. Save it with the 2-letter ISO 639-1 language code of the target language (e.g. "fr.json" for french).
Translate all strings in the JSON file into the target language. Changes are saved automatically.
See JSON Translation File Semantics for details on the conventions used in the file.
If you want to preview the changes, enter the following command in the "Terminal" window at the bottom of the screen:
npm run serve
This can take a bit of time to start up.
A message will be displayed asking you to open the application from port 8080 in a browser, confirm by clicking the "Open in Browser" button. It may take a bit until it shows the application in the new browser window. You may have to reload it.
Then you can update the translation and verify them inside of the application at the same time. Changes in the JSON files are saved automatically. You need to refresh the browser window to see the changes in effect.
Once you are happy with your translation, follow these steps to create a pull request.
On the bottom of the screen, click on the "develop" branch name, and choose "+ Create new branch..." from the list that pops up.
On the left side, click on the "Source Control" button, and provide a commit message in the text box, then click the "Commit" button.
You may get a message that there are now stages changes to commit. Click on "yes" or "always" to include the new translated file you created.
Then, click on the "Publish Branch" button (this uploads you changes to your copy of the GitHub repository).
Finally, create a pull request with your changes and click on the "Create" button.