Xcstrings file not formatted correctly

Hello!
We have issues with importing to and exporting from Crowdin using xcstrings file format.
The issues are:

  1. iOS specific symbols (for example %@) are not transformed into unified placeholders as per documentation. The option is checked in settings of the project, but new strings are not using unified placeholder and we need to change that manually
  2. On export using XCStrings exporter, we should check both Convert unified placeholders to the iOS format and Convert Android placeholders to the iOS format even if we are using only placeholder values. But doing so results into duplicate % symbol before other symbols, such as %lld (it transforms into not valid %%lld)
    It seems that checking first option only removes square brackets and the second option transforms %s to %@. But we can’t use it like that, because it breaks other symbols, which are identical on both platforms.

Could you please help us?
Thank you in advance:)

Hello @Spiriohub :waving_hand:

If unified placeholders are enabled in your project settings, but %@ is still not converted automatically on import, this is likely related to the current .xcstrings parser behavior.

To investigate this properly, we’ll need a bit more information. Could you please share:

  1. A few example strings from your original .xcstrings file (before import) that contain placeholders such as %@, %d, %lld, %s, etc.

  2. How these same strings look inside Crowdin after import.

Meanwhile, I’d recommend testing this case with only the first option for iOS exports. Using both options at the same time may have caused the exporter to apply the transformation twice, which resulted in invalid placeholders such as %%lld.

Looking forward to your answer!

Hello!

  1. For example we have next strings - %@ enrolled %lld lessons. We need those to be translated to [%s] and [%i]respectively, and then could be downloaded to both iOS xcstrings (%@ and %lld) and Android xml (%s and %d).
  2. On import next string from xcstrings

“test” : {

“extractionState” : “manual”,

“localizations” : {

“en” : {

“stringUnit” : {

“state” : “translated”,

“value” : “Test %@ %lld”

}

}

}

}

stays the same in Crowdin - Test %@ %lld

I think your parser for xcstrings is broken, because it works fine on uploading strings localization files fromm iOS or xml from Android

About both options selected on downloading translations using xcstrings - if I choose only converting from unified symbol - only square brackets are removed from unified symbol ([%s] → %s) and if I choose converting from Android specific symbols - it converts what’s left to correct iOS symbols (%s → %@) but at the same time it breaks other strings present in the bundle (%%@ %%lld).

Could you please fix it?

Hi @Spiriohub !

Thank you for reaching out with the details of the issues you’re experiencing with the .xcstrings file format in Crowdin.

As far as we understand, you are importing .xcstrings file to the project and then you are using a bundle for the export, is that correct? Please share with us more details on how exactly it is configured in the project. You may provide some screenshots to support@crowdin.com

We would also need to review some examples of the original .xcstrings files before import, as well as how these strings appear in Crowdin after the import. This will help us understand where the transformation is not working as expected. Please send the file example also to our support email mentioned above.

Additionally, could you please confirm if the issues with exporting are occurring when using the UI, CLI, API, or Git integration?

Thanks in advance!