Approximation Phrase of DateComponentsFormatter does not respect the calendar's locale

Number:rdar://FB9113411 Date Originated:2021-05-21
Status:Open Resolved:
Product:Foundation Product Version:14.5
Classification:Incorrect/Undefined Behavior Reproducible:Always
The DateComponentsFormatter’s behavior can be changed by setting a different calendar. To also change the locale we can set a different locale on the provided calendar. This is mostly respected by the formatter but when setting `includesApproximationPhrase = true` the approximation phrase uses the system’s current locale. 

Sample code (see attached Playground):
let dateComponentsFormatter = DateComponentsFormatter()
dateComponentsFormatter.calendar = Calendar(identifier: .gregorian)
dateComponentsFormatter.calendar?.locale = Locale(identifier: "de_DE")

dateComponentsFormatter.includesApproximationPhrase = true
dateComponentsFormatter.unitsStyle = .full

let output = dateComponentsFormatter.string(from: 1_000)

“Ungefähr 16 Minuten und 40 Sekunden"

"About 16 Minuten und 40 Sekunden"

To not break backwards compatibility for developers who don’t use the abbreviation the formatter should always use the calendar’s locale for localized String lookups (just like it does for he components). 



Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at 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!