Since https://github.com/crowdin/crowdin-cli/issues/486 has been fixed, crowdin download successfully fetches translations to our InfoPlist.xcstrings file. However, it also removes the English source text from that file.
When I run that, InfoPlist.xcstrings no longer contains any English text, just the translations into other languages. The file in question is https://crowdin.com/editor/inaturalistios/728
Is this a bug or do I need to change my config somehow?
Yes, we have multiple code repos pulling from that Crowdin project so I don’t want to leave that setting unchecked and destabilize them, so I unchecked it temporarily, then ran crowdin download as I said and got the result I described.
What are you expecting to happen when I run crowdin download after unchecking “Export only approved translations”? We don’t actually want to incorporate unapproved translations into any of our code so if this is your solution to this problem, it won’t work for us in the long term.
Hi @kueda , the cause is that you have an English target language, and since the file is multilingual, when exporting we pull strings from the target language first, not from the source.
To avoid this behavior, you can go in two ways:
Remove the English target language
Do not use the Skip untranslated strings option, use only Export only approved translations (but in this case, all existing locales will be filled with the source string)
Thank you, that seems to have worked! For the record and for anyone else experiencing similar problems, I disabled English (en) as a translation language only for this file, ran crowdin download again, and it worked with no other changes. However, changing the target language seemed to remove all existing translations for that file and I had to repopulate them with pre-translation and Translation Memory, which was fine but not ideal.
However, I think these are problems you at Crowdin should be handling on your end. An .xcstrings file specifies which locale is the source locale in the sourceLanguage attribute, so a Crowdin manager like me should not need to tell Crowdin that it should not be writing translations to that file for that locale.
FWIW, after trying to get this xcstrings integration to work correctly, I have three changes in functionality I’d like to request:
Crowdin should never write translations to an xcstrings file for the locale specified in the sourceLanguage attribute of that file.
multilingual: true should be the default configuration for xcstrings files, i.e. authors of crowdin.yml config files should not have to specify that because xcstrings files are always multilingual.
Crowdin should automatically hide from translators any strings in an xcstrings file that specify "shouldTranslate": false
Have an update from our development team, please see below:
So, why do you translate this file into English, if you don’t want the strings to be rewritten? The only improvement that can be made here is to take into account the excluded language for cases like yours, but since it’s the only request we’ve received so far, this change will not be released anytime soon.
At the CLI level there is no way to make it automatic due to the specifics of the approach in validating the config file.