swiftlang / swift-corelibs-foundation

The Foundation Project, providing core utilities, internationalization, and OS independence
swift.org
Apache License 2.0
5.27k stars 1.13k forks source link

[SR-8869] NSLocalizedString does not work with .stringsdict on Linux #3626

Open swift-ci opened 5 years ago

swift-ci commented 5 years ago
Previous ID SR-8869
Radar None
Original Reporter Momo (JIRA User)
Type Bug

Attachment: Download

Environment Ubuntu Bionics with Swift 4.2
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Foundation | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 7296fb981847b28e625d1dbaafe4fe89

Issue Description:

As the title says, NSLocalizedString does not work with .stringsdict on Linux.

See this code for reproduction.

https://github.com/viltit/NSLocalizedString

If you run the the code with strace, you will notice that the .stringsdict file gets opend and read by the system, but the output of the code is the still the unformatted string.

On Apple, the code works as expected, so this seems to be a Linux-only issue.

swift-ci commented 5 years ago

Comment by Maik Koslowski (JIRA)

I can confirm this bug on the latest Swift version on unix systems. Running any code that tries to use a .stringsdict will result in a Segmentation Fault.