Hello, can you help me with the branch system?
We are using branches on a project.
For Gitlab+crowdin we don’t use integration, only cli commands
Since we are using key comparison, the merge command for crowdin doesn’t work. I understand the process like this:
We create a branch in gitlab + crowdin “my-test-branch”,
make translations,
download translations to MR “my-test-branch”, → “master-branch”.
gitlab merge this MR into “master-branch”.
Executing the command “crowdin upload sources ” from the master branch of the project using cli.
In my mind, the translations that are now in gitlab (“my-test-branch”, + “master-branch”) should update in crowdin those translations and make duplicate strings from the branch “master strings”. And that’s how it used to work. But now in the master branch of crowdin it’s still the old translation. The “my-test-branch” in crowdin has the correct translation, but it is listed as “duplicated”. What am I doing wrong?
Is it possible that this is due to a separate branch being used as a “spare” branch. Translation corrections are made there without updating the “source” strings. I.e. a string is hidden, it is translated, and then these translations are downloaded to the gitlab branch.
We decided not to do such translations without changing sources in a separate branch, because if we do it in crowdin master files, then when we download translations in other branches, they become immediately available, which is not desirable.
Please clarify how a translation becomes a master string. At what point does it happen?
And what process do you recommend if I need to fix only the translation but not the original? Is there any way to isolate this into a branch?
When you create a branch in GitLab and Crowdin, make translations, and then merge these translations into the master branch in GitLab, the next step is to upload the sources from the master branch to Crowdin using the CLI.
You’re using this approach, correct?
If the translations in the master branch of Crowdin are still old, it could be due to the settings for handling duplicates. If you’re using key comparison and the merge command isn’t working as expected, it’s possible that the translations from “my-test-branch” are being treated as duplicates rather than new master strings. This can be checked in project settings → import → duplicates.
A string becomes a master string when it’s the first one uploaded to the project or when it’s the oldest added sting after the former master (in case you delete the master string, 2nd string will become a new master). You can’t transfer master status on purpose.
If you need to fix only the translation without changing the original text, you can do so in a separate branch.
Yes, we do upload sources after merging translations into gitlab. But in this case these translations remained duplicate and only in the “my-test-branch” branch
We use the “Show within a version branch (strict detection)” strategy.
Do I understand correctly that in this case, when we fix only translations (not sources), we have to manually remove the “master string” so that the duplicate from the branch where the translation was fixed becomes the master string?
Hello @rabbdroid! Yes, you understand correctly. But you can also change the translation in the current Master strings and the change will be reflected in all Duplicates accordingly.
Hello! Thank you so much for the tips.
There is also a case that we don’t understand how to solve. Perhaps you can suggest how it can be implemented.
We automatically create a branch in crowdin (e.g. ‘my-test-branch-1’) in crowdin when there is a change to the en.json file in MR gitlab (using cli).
The translation in this branch is not started or partially started.
merge ‘my-test-branch-1’ branch in gitlab with only en.json (no translations)
Strings from en.json get into the main code
Automatic call crowdin update sources on deploy
Now the main crowdin files have information that these strings have been changed
We do a download of another branch (e.g. ‘my-test-branch-2’)
We get unfinished translations from another branch ‘my-test-branch-1’
I would like to point out that not all branches see the ‘new’ translations. I think only the ones where we call crowdin update sources (we want to keep branches up to date, because during the translation process strings may be added in another task and we want to know about it).
How can we solve this problem when en.json(source file) gets into the project before translations? Is there any way to really isolate branches from each other?
If there is no platform-level solution, we thought about parsing json files. But in the api documentation we don’t see how we can get visible strings in a particular branch (visible_strings flag in crowdin app). We will be fine with cli or api. Is there any way to filter this somehow?
Yes, that’s correct. That’s the option selected. But we can’t use ‘Hide’ or ‘Auto-translate’ or ‘Show all’ either. So no import method is suitable for this case?
In this case, all of the duplicate options are indeed not suitable for you. Maybe you could manually hide strings from translation (via API or CLI also works), but natively JSON does not support hidden strings.