How To Work With Multiple Branches in a GIT Repository
One of the goals of any developer is to create an Agile Workflow using Transifex that allows one to make iterative developments/changes to their source files. When using multiple branches one will be the master branch while others will be development branches. Keep in mind there is no set limit of development branches, so you can expand the number of development branches at any time without affecting your workflow.
There are two workflows that will support this setup:
Merging changes into a Master Branch
A developer can work on a development branch, merge their changes to the master branch, then push resources from the Master Branch to Transifex. This workflow can be incorporated into Transifex in one of two ways:
With the GitHub UI Integration you will be able to connect a localization project in Transifex with a specific repository in GitHub using only the Transifex user interface. Any new resources in Github are automatically pushed to Transifex, and any translations are automatically pulled into Github (When translations are 100% complete, or 100% reviewed or 100% proof-read). The benefit of this approach is that its pretty much point and click as it does not require the creation of pull requests, Web-hooks or the use of a Continuous integration tool. This integration is described here.
CLI commands are used to execute a basic workflow with just two basic commands: TX -PUSH to create new resources in Transifex and TX -PULL to transfer the finished translations to the Github master branch.
This last step of transferring finished translations to the master branch can be automated by creating web-hooks in your repository. Transifex can then trigger this web-hook when a translation is 100% completed, 100% reviewed, 100% proof-read or Auto-filled with our Translation memory. The first step of creating new resources can be automated by incorporating a CI (continuous integration tool). The classic Github integration is described here.
The API can be used to perform functions at a string level such as adding instructions, tags, character limits into our Transifex Editor for file formats that do not support metadata. (E.G JSON). On a resource level, the API can be used to perform functions such as updating a resource or retrieving translation statistics such as %Translated or the workload of specific translators. The API works on only one resource at a time, while the CLI client can function on multiple resources at a time.
To ensure that only net new translation keys are added, have developers only push resources with new strings to the master branch. If by accident duplicate strings are found, translation memory auto-fill will automatically populate the translation, however duplicate strings increase your word count.
Each repository/dev Branch will push a Diff based on a comparison with the master branch to Transifex. This process will create a new resource, keeping the initial resource intact, allowing for incremental changes. Transifex can store an unlimited amount of resources. The new resource will only contain net new translation keys. As long as developers are assigned a different set of updates, the addition of existing source strings will be eliminated. This eliminates the addition of duplicate source strings. The workflow for pushing a Diff is as follows:
From the development branch, push the diff to your local workstation.
From the development station, push the diff into Transifex as a new resource, using the CLI or API. This diff should only contain net new translation keys as long as the developers are assigned unique strings to work on.
Transfer the finished translations to the master branch automatically by creating web-hooks in your repository. Transifex can then trigger these web-hooks when a translation is 100% completed, 100% reviewed, 100% proof-read or Auto-filled with our Translation memory.
One more point is that each resource in Transifex is independent. This means that the source content that is hosted in one resource is not being affected by the source content that is hosted in another resource of the same project.