What is a project branch? #️⃣
When a new branch is created, it creates a copy of the main project (or the project branch), including the glossary, screenshots, and contributors/user roles. You can also decide if you want to create a 1:1 copy (includes all content and translations), or an empty branch (without any content).
This allows you to invite specific people, experiment with different context information, or separate the branch as a standalone project to maintain separate versions of your software or, e.g., create separate branches for white-labeled solutions.
All changes made inside a branch are isolated, and you can work with it as you need until it’s time to merge the changes.
How are source keys in branches counted? #️⃣
Localazy only counts the number of “affected” source keys inside the branch. So no matter if you create an empty branch, or not, the initial state of the source keys that count against your organization limit will always start at a zero.
Manage branches in Console #️⃣
Navigate to the Localazy Console -> Branching. You will see an overview of your projects and their branches.
Using the Actions buttons, you can manage the branches from this screen, with the following actions.
Create new branch #️⃣
Creating a new branch is useful when you want to iterate on the translations and later re-introduce the changes to the parent branch. It’s also used often for white-labeled solutions or migration projects.
You get a full copy of the project that is fully separated from its parent, and nothing limits you in how you want to update translations, change context information, or the structure of your files.
Create a new empty branch #️⃣
Empty branches are particularly useful for new feature development. The branch doesn’t have any content, but it keeps the link to the parent branch.
You can use the branch during development, iterate on texts and their translations for new features and once the new feature is merged to the main, you can use the same logic with translations and merge the branch back to the main translations.
During development, texts are always changing more rapidly and so separating new feature development from the main product line is always a good idea.
Rename #️⃣
This one is self-explanatory - change the branch name to something different.
Set as main #️⃣
If needed, you can promote any of the branches to become the new main.
It’s useful when one of the branches is more mature and is about to replace the main for future development.
The process of changing the main branch is as follows:
- The selected branch becomes the main branch.
- The current main is renamed and moved under the new main.
- Sub-branches of the selected branch are left untouched.
- Other branches are moved under the new main branch.
Separate #️⃣
Separating the branch removes it completely from the structure and the branch becomes a stand-alone project.
It’s a useful concept for making project copies. You can just create a branch and then separate it out of the structure. It’s often used during project migration (the branch is used during migration and later separated when the migration is done).
The process of separation is as follows:
- The selected branch becomes a standalone project.
- Sub-branches of the selected branch are reparentized to the parent of the selected branch.
Once you separate a branch from the main, it can not be merged with the original project or its other branches!
Remove #️⃣
Removing branches should always be done carefully, as it’s an irreversible operation that removes the whole branch and all its content.
It’s not possible to remove a branch that is not a leaf.
Merge branch to… #️⃣
This action allows you to merge the branch content into another branch (not necessarily the main branch). This means that the content in both branches will be synchronized fully or partially - depending on the conflict resolution.
The branch is not removed after merging it with another branch!
You will be prompted to configure they way in which the two project branches become merged.
You have the following checkbox options that will affect what will be merged and how:
- Process only conflicting translations
- Create new keys and translations in the target branch
- Create new files in the target branch
- Create new languages in the target branch
- Skip all keys with existing translations
- Deprecate keys missing in the source branch
You also have the option to choose conflict resolution strategy, and the languages that will be processed during the merge.
Press apply changes to display a Merge Overview and Conflicts.
Merge Overview #️⃣
Once you prepare your merge, you will see the conflicts, affected languages and translations.
On the image below, you can see that my branch has one change in the source language, and adds 20 new translations in the German language, which is not present in the target branch at all.
Conflict Resolution #️⃣
There are many ways to resolve the conflicts that arise during the merge process. You can resolve conflicts automatically or manually.
Automatic Conflict Resolution Strategies #️⃣
Time-based automatic resolution
Resolves changes automatically based on the timestamp of the last change to the translation. The newer version is used. The bidirectional variant affects source and target branches, propagating changes to both of them.
Reference-based automatic resolution
When merging a branch into its direct parent, Localazy can resolve the changes automatically if the parent translation hasn’t changed. In any other situation, conflicts are escalated for manual resolution.
Manual Conflicts resolution #️⃣
Before you perform merge, make sure to check the conflicts on the Conflicts tab.
Here, you can see the values in the source branch (the one you are merging into the target branch) and the target branch. In the example below, there is just one conflict, and it is the change in source language of the project.
Click on the preferred value to display an arrow indicating the direction of the conflict resolution. The selected value will overwrite the value the arrow is pointing to. In the image below, you can see the Target branch will overwrite the content of the Source branch.
You can select these directions independently for each conflict, and even skip the conflicts. You can also use the buttons in the top right corner to apply the direction to all conflicts.
Manage branches using CLI #️⃣
You can also manage branches using the Localazy CLI.
Learn more about using Branching with CLI