I'm trying to get Symfony 5.3's Translation Providers working with Crowdin in my app. I'm using ICU format, trying to translate from pseudo-language to English (from "user.button.add" to "Add User").
The connection up works fine, I can run bin/console translation:push crowdin --force to get all my strings from the local file to appear in their user interface.
Then I go to Crowdin and translate a string, save the translation, approve the translation and quit the editor.
My problem starts when I try to update the local file via the Symfony CLI.
The command I'm using is bin/console translation:pull crowdin --intl-icu --domains=messages --locales=en and I have three observations:
- When I remove my local translation file and run the command, a new file appears, but with default Symfony's translation (__user.button.add)
- When I run the command with the local file in place, it does not get updated with the translations present in Crowdin
- When I go to Crowdin and try to export the XLF file manually, it contains the translations as expected.
I have used localise.biz with some success, but the same set of steps does not work with Crowdin, which makes me think I might be missing something on the Crowdin side of things?
Any kick in the right direction would be appreciated. Thanks for reading.
I have the same problem right now. I have two files for my two locales:
They were extracted by these commands:
All content of these files translated at crowdin. When i pull translations from crowdin the header+intl-icu.uk.xlf with UK locale updated and all OK:
But header+intl-icu.en.xlf file with EN locale just modified but source and target was the same like before:
And I start to dig in...
Crowdin translations managed by
When we try to pull translations by the command
This flow managed by the function in CrowdinProvider.php:
There is a peace of code that executes changing for translation files for different locales:
So in my case if locale === uk used function
And if locale === en function
If I remove this check for the defaultLocale locale all my translations from the crowdin start to work fine. And I don't know what to do next. Looks like it is a native behavior of crowdin-translation-provider.