Phrase is designed to give you flexibility when it comes to customization. This article shows a few example integrations
We have recently updated our CLI, instead of phraseapp, it is now called phrase.
Although we try to keep things as similar and compatible as possible, there might be some changes.
All documentation now refers to the phrase CLI.
You can access the previous version of the article here
If you have any questions, please contact us at email@example.com.
How can I download my strings into a CI environment?
2) Add a new bash script or step to your CI.
To upload new strings into Phrase, add this command to your script:
# upload new strings to Phrase as configured in the .phrase.yml
The relevant parameters are listed in the linked section:
Make sure to set update_translation or update_description if you intend to not only add new values but also update existing values.
To download translated strings into your current workspace, try something like this:
# get new strings from phrase as configured in the .phrase.yml
Make sure to include the right keys using tags, as well as your desired options for verified and translated entries.3) Register a webhook to subscribe to the desired events.
You can register a webhook for any number of events. Check out our help page for a list of all possible events.
How can I react to changes to my translations?
We offer a webhook for each major event (e.g., a processed upload or completed order). One common workflow is to set up a notification for newly created comments in your Slack channel, as well as import scripts for job completions. Naturally, you can also use our API to query the current state of these items as well, depending on your update cycles.
Does Phrase work with branches?
Phrase has its own concept of branches for versioning, which differs from the typical application of Git branches. Our branches can certainly be used alongside Git branches. Just check in the branch name in the configuration file for that branch and run your CI steps in it.
When you add features, you’ll generally add translations without removing any existing ones. For that reason, we recommend adding tags to the branches you are working on and uploading them to the main branch. This allows you to not only track which features share keys but also pull and test on certain subsets without having to worry about confused translators.