Xcode XLIFF Import loses Translations

Originator:oliver.drobnik
Number:rdar://23410520 Date Originated:
Status:Open Resolved:
Product:Xcode Product Version:7.1
Classification:Serious Bug Reproducible:Always
 
Summary:
Xcode requires for <source> tags to be exactly identical to the strings in Interface Builder. This cannot be guaranteed because services like POEditor.com let you change the contents of the source if you e.g. change the English text.

Xcode should ignore the <source> tags for importing translations and only use the translation identifier for imports belonging to base-localization XIBs and storyboards.

Steps to Reproduce:
1. Have a label that contains text with several line breaks in the middle
2. Export XLIFF
3. Import XLIFF in POEditor.com
4. Add German localization
5. Export translated XLIFF 
6. Import XLIFF into Xcode

Please refer to the blog post I mention in the notes for a much more detailed chain of events including screenshots that cause the issue.

You can also reproduce it with the sample app I have attached. This is steps 1-5 executed from the steps above.

1. Open the project
2. Import German.xliff from the project folder


Expected Results:
- The translated multi-paragraph text should be present
- There should be 5 strings in the newly created Main.strings (German)

Actual Results:
- The translated multi-paragraph text shows up in the translation diff view
- but it is missing from the resulting German strings file
- only if you replace the contents in the <source> node with the exact string from the export, then the translation shows up 

Version:
Version 7.1 (7B91b), OS X 10.11.1 (15B42)

Notes:
I have documented the entire chain of the problem here: https://www.cocoanetics.com/2015/11/the-case-of-the-missing-translation/

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!