When I export my crowdin project to the new Apple String Catalog file (Seamless Translation of xcstrings Files | Crowdin), it says “Build failed. Apple Strings Catalog Exporter: Files were not exported. Custom format endpoint is unreachable”.
I tested some more xcstrings exporter and it seems like it has a couple more issues besides plural :
Formatting of locale inside don’t seem to be correct (ex: fr_CA where it should be fr-CA in Apple standards)
If a key doesn’t have a translation in a certain language, it currently fills translation with empty string where it should not fill translation for that language at all to allow iOS to use default language
Thank you a lot for sharing your feedback! We are always working on improvements and the feedback of customers helps us a lot to understand your needs,
As for the first issue. Currently, we are already working on the possibility of adding a language mapping to the .xcstrings file format, so you will be able to customize the language code. (internal task number for support team 42647).
Meanwhile, as a workaround, you can use the the Regex app to replace language codes inside your file from fr_CA to fr_CA.
As for the second issue. Relatively recently (on January 25) we changed a bit the logic of the xcstrings files export and now if the file has untranslated languages on export it will be filled with source strings. With this approach, you would make sure to never have a missing translation but the English fallback for all the keys.
However, you mentioned that in your case on export you see the empty keys? I just did a quick test on my project and the untranslated string was filled with English values. Can you please share more details regarding your case? Like the example of the file and the name of the project where it happened?
Please feel free to correct me if I misunderstood you,
As for the first point, I’m glad there is a customization in the works for the tricky cases, but I also feel like the exporter should by default use same format as %osx_code% (without the .lproj of course ^^) so that we don’t have to list each of our regional languages as exceptions in language mapping
For the second one, I test on this project : Crowdin. You can see it by downloading “channel 1 iOS string catalog” target bundle. For all untranslated strings, you can see an empty string. For example for recipe_title in en_CA:
In my opinion, you shouldn’t need to put the “en_CA” key at all. That’s what XCode does if you create a new key but never translate it in some language.
Thank you for the suggestion. Passing it to the team!
As for the second issue. I just did a quick test and indeed using the Apple Strings Catalog Exporter the untranslated strings are exported as empty values. I will also pass on to the team that we should improve the exporter as well as it was done with a natively supported file format recently.
The format of language/region seems to match %osx_code% with en-CA for example instead of en_CA which is great news ! Also the error “Unable to export to apple string catalog file: Custom format endpoint is unreachable” seems to be fixed when dealing with plurals which is also great !
The only remaining issue (minor) is the presence of the empty strings in “needs_review” state for untranslated keys. Maybe the fix isn’t deployed yet for this.
Anyway with these fixes we can start using .xcstrings in our project so this is great !
As for the second issue with “needs_review” state. It can be a cache. Can you please add/change the translation in the Editor to each target language and tell me the result? You can for example just add a space or a dot. Changing the translations should reset the cache.
Just received an update from the development team about the language code improvement for .xscstrings files (the possibility of adding a language mapping) so now you should be able to customize the language code
Hi @Dima, we have a use case where we want to map es-419 to es. But adding language mapping doesn’t seem to have any effect on the exported file. Can you provide more details on how to set up language mapping for .xcstrings files? Thanks.
Language mapping does not change the language codes inside the file. If you want to make changes inside the file you need to use Regex Content Processor app
Also what are we supposed to do for language mappings ? @Dima if language mapping is handled, what placeholder is supposed to be used ? @Roman If we are supposed to use regex content processor, I see two drawbacks :
I’m afraid this will slow down our exports as we have multiple big projects
It’s way harder to setup. (For now I’m unable to make it work, see screenshot where I try to replace Norwegian which is “no” for crowdin but “nb” for Apple)
Can you please let me know on what project you are working on so I can double-check from my side the issue with empty strings? I’ve just a test again in my project and was not able to achieve the same result.
As for the question regarding the language mapping. We are so sorry for confusing you! currently, the language mapping is added only to the native exporter and the bundles don’t have this option yet.
As for the Regex app issue. Checking with the tech team about the error.
UPD about the Regex app. Can you please try to close the app and reload the page? The error message should disappear. It allowed me to save the rule in my test project:
Thank you for your answer.
You’re right about the error on regex app, it seems to work now ^^’
But it doesn’t seem to change anything to the result xcstring when I export my bundle. Can you confirm the regex is correct for a temporary replacement of a proper language mapping ?
You can test it and the empty string issue on this project : Crowdin. I have a bundle called “current iOS string catalog” that exports the .xcstrings