swiftlang / swift-corelibs-foundation

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

[SR-9605] Date formatter grammar mistake #3563

Open swift-ci opened 5 years ago

swift-ci commented 5 years ago
Previous ID SR-9605
Radar None
Original Reporter royalaaaaa (JIRA User)
Type Bug
Environment Swift 4.2 macOS, iOS (haven't tested it on tvOS but i'm pretty sure that it's also qualifying)
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Foundation | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: d80bfb31bbcc9308f8b2835bdac5537e

Issue Description:

In Polish language this example have one minor grammar mistake:

let dateFormatter = DateFormatter()
dateFormatter.setLocalizedDateFormatFromTemplate("MMMMy")
let date = dateFormatter.string(from: Date())

print(date)

date variable outputs "styczeń 2019" (on 6th of January 2019) when it should capitalize first letter of month (as in "Styczeń 2019"). I couldn't find any format template that capitalizes it and i had to do it manually (by creating an extension to String). It is not critical or anything, but it's definitely not correct.

spevans commented 5 years ago

The month names that Foundation uses come from libICU and ultimately the CLDR (
Unicode Common Locale Data Repository) so cant easily be fixed in Foundation. This ICU bug (https://unicode-org.atlassian.net/browse/ICU-8893) may give further insight, especially the last comment.