Skip to content

Commit

Permalink
Update TRANSLATING.md now that qm files are built automatically.
Browse files Browse the repository at this point in the history
  • Loading branch information
softins committed Jul 15, 2024
1 parent fe1e668 commit 63d749b
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions docs/TRANSLATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Do not click on **Publish branch** just yet.

Open Qt Linguist, and navigate to the directory `src/translation` within your project directory.

In this directory are translation source files for each language, each with a `.ts` suffix. Don't worry about the `.qm` files, as they are compiled when building the release code.
In this directory are translation source files for each language, each with a `.ts` suffix.

Open the `.ts` file for the language being worked on.

Expand Down Expand Up @@ -268,16 +268,20 @@ The following section describes how to add a new language and what to do or wait
Please open an issue on GitHub and introduce yourself first, even if you intend to add the translation files yourself.

After having opened an issue on GitHub:
1. Fork the Jamulus repository as described above, then install Qt on your machine (See [COMPILING.md](../COMPILING.md)). (You will need `lrelease` and `lupdate` later on.)
1. Fork the Jamulus repository as described above, then install Qt on your machine (See [COMPILING.md](../COMPILING.md)). (You will need `lupdate` later on.)
2. Create a branch based on the `main` branch: Locally navigate to the folder you cloned the repo to (with `cd /path/to/jamulus/repo`) and type `git checkout -b "translate-add-xx_YY"` (where xx_YY is the language code of the new language).
3. Open Jamulus.pro in an editor such as `nano`: `nano Jamulus.pro` and add your language file (which will be created later) in alphabetical order to the `TRANSLATIONS` variable. The format should match the other present languages.
4. Also add `src/translation/translation_xx_YY.qm` to the DISTFILES variable similar to the other files
5. Save and close Jamulus.pro.
6. Add the `.qm` file in `src/resources.qrc` similar to other languages.
7. Now move back to the repository root and run `lupdate Jamulus.pro`. Afterwards, run `lrelease Jamulus.pro` which should create all of the necessary files.
8. Finally, add, commit and push the changes to your repository with the following commands: `git add Jamulus.pro src/translation/translation_xx_YY.* src/resources.qrc`, `git commit -m "Translation: Add empty xx_YY translation"`, `git push`
9. Open a pull request from your repo to the main repo with a brief description that you plan to translate Jamulus to your language
10. Once the pull request is merged, Weblate should pick up the new language.
4. Save and close Jamulus.pro.
5. Now move back to the repository root and run `lupdate Jamulus.pro`. This will create a new language file `src/translation/translation_xx_YY.ts` for your new language.
6. If the source files have changed since the other language `.ts` files were last updated, the `lupdate` above will create updates to all of them. You can check if this has happened with `git status` and look for files flagged as "modified". You don't want to update them all in your pull request, so you need to restore all except your new language file. The easiest way to do this is to stash your own file, restore everything else, and then un-stash your own file, as follows:
```
git stash -- src/translation/translation_xx_YY.ts
git restore src
git stash pop
```
7. Finally, add, commit and push the changes to your repository with the following commands: `git add Jamulus.pro src/translation/translation_xx_YY.ts`, `git commit -m "Translation: Add empty xx_YY translation"`, `git push`
8. Open a pull request from your repo to the main repo with a brief description that you plan to translate Jamulus to your language
9. Once the pull request is merged, Weblate should pick up the new language.

### Adding a translation to the Windows installer

Expand Down

0 comments on commit 63d749b

Please sign in to comment.