When importing localization from .xliff file, that having "\n" character in the string, there is a problem

Originator:Ido.Monzon
Number:rdar://45441022 Date Originated:October 22 2018
Status:Open Resolved:No
Product:xCode Product Version:10.0 (10A255)
Classification:Bug Reproducible:Always
 
Summary:
When importing localization from .xliff file, that having "\n" character in the string, xCode telling that their "Missing Translate in the import" and "Missing Translate in the project" and just don't importing them.
xCode replacing the "\n" characters with literal line brake (Enter), and as you know, double quotes doesn't supports line brake.

The most un-understandable thing here is that I read reports on this bug in very old discussions ((((2015)))) in the Apple Developer forum and they said that they'r reported on it, So why this ***serious bug*** is still existing?!

Steps to Reproduce:
Make `NSLocalizedString("First Line\nSecond Line")` in your project, export it, translate it to `שורה ראשונה\nשורה שנייה` (for example) and see that when you are trying to import it back to eXcode you'r getting "Missing Translate in the import" and "Missing Translate in the project" prompt message because xCode doesn't know how to convert line brakes back to "\n" (you don't even should to convert the \n's to literal line brakes on the export).

Expected Results:
xCode should export and import the strings with \n and not convert it to line brake at any step of this process.

Actual Results:
xCode is converting the \n to line brake which making problems on translating and importing it back.

Version/Build:
10.0 (10A255)

Configuration:
macOS ‏10.14 ‏(18A391‏)
MacBook Pro (15-inch, 2017)

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!