The txgh server got updated to create branches and pull requests.

Maikel
2018-06-20 09:33:51 +10:00
parent 677c45c854
commit be42707073

13
i18n.md

@@ -10,20 +10,19 @@ Quite regularly, a developer changes some code that involves changing text. Text
Translators may notice that their language is not 100% translated due to changes of the source file. Then they translate and once a language reaches 100% again, Transifex notifies our CI server.
Our CI server is running [txgh](https://github.com/transifex/txgh) to listen to Transifex. When a translation reaches 100%, it will download it from Transifex and push it to Github on the "transifex" branch. There we can check if everything is alright, we can open a pull request and merge the changes into master for the next release.
Our CI server is running [txgh](https://github.com/transifex/txgh) to listen to Transifex. When a translation reaches 100%, it will download it from Transifex and push it to Github on the "transifex" branch. It will create the branch if it doesn't exist. It also opens a pull request so that we can easily merge the changes into master for the next [[release|Releasing#how-to-make-a-release-spiral_notepad-white_check_mark]].
This process has several flaws and people get utterly confused about the whole thing.
* If the transifex branch does not exist, our CI server doesn't create it. No translations are automatically pushed to Github and we need to fix this manually.
* Once a translation reached 100%, Transifex doesn't notify our CI server about any further changes. We need to manually push it to Github.
* We need to create a pull request for changes on the Transifex branch every release ([Github issue](https://github.com/openfoodfoundation/openfoodnetwork/issues/1549)). The steps involved for releasing are described [[here|Releasing#how-to-make-a-release-spiral_notepad-white_check_mark]].
Please note that once a translation reached 100%, Transifex doesn't notify our CI server about any further changes. You can trigger another notification by reviewing the translation to 100%. Any updates after the review have to be downloaded and committed manually.
The [Transifex client](https://github.com/transifex/transifex-client) is a command line tool that helps with manually downloading translations. After installing, you can replace all locales with the latest Transifex version:
```sh
# cd openfoodnetwork
tx pull --force
```
## Development
### Clear cache after translation changes
When making changes to `config/locales/en.yml` or other locals, ensure you reload I18n js translations to see the changes in the application.
@@ -53,7 +52,9 @@ Scopes/keys must be unique at all levels. If duplicated, they may work in the b
fruit:
apple: 'apple'...
```
### JavaScript translations: Prefer Angular Filter over global `t` function
In JavaScript it's better to use our Angular filter for translations:
Bad