Handle crowdin sync in adblockplusui
Background / User story
Background
As you can see from the current comment buildtools are deprecated and seems like ABPUI team needs to implement/maintain Crowdin sync script.
In order to have something more reliable and minimize maintenance effort a preference towards ready integration options provided by Crowdin were given priority. As the Crowdin's Gitlab integration, keeps automatically pushing changes each time there is a new string(unless we switch our development workflow), that will let source strings being available to the Crowdin community before being available in XTM, also that makes the integration process less flexible, ex. harder to maintain separate enhacement scripts, like removing descriptions, or empty files generated by Crowdin. For that reason, seems like the best option will be to use Crowdin's CLI tool, which let you push changes anytime you want and be somehow a middle ground solution, between custom Crowdin API integration and fully automated Gitlab Integration.
What to change
- Design: N/A
- Research: Notes for different methods of the Crowdin integration.
- Spec: N/A
-
Development:
- Start using Crowdin CLI tool
- Create crowdin.yml
- Specify all source string files that needs to be translated by Crowdin.
- Set Crowdin API using ENV variable.
- Remove description from the translation files.
- Delete empty files created by Crowdin.
- Create crowdin.yml
- Start using Crowdin CLI tool
Hints for testers
In order to test the Script, project_identifier needs to be switched to this-is-very-much-a-test-proje, afterwards test can be done using commands bellow:
CROWDIN_API_KEY="1111" npm run $ crowdin.download-translations
CROWDIN_API_KEY="1111" npm run $ crowdin.upload-strings
CROWDIN_API_KEY="1111" npm run $ crowdin.upload-translations
Note: Use actual this-is-very-much-a-test-proje Crowdin project key instead of "1111".
Also Crowdin CLI needs to be installed.
Hints for translators
Moving to using Crowdin CLI, will allow us manage translation files we would like to upload to the Crowdin and those we wish only handle in XTM.
Also new CLI does reorder the file differently from deprecated phython script, that means that during the first synchronization there will be a lot of changes shown in the MR.
Integration notes
None.
Further information
see -> https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/issues/686