It's better to use a method like https://developer.apple.com/documentation/foundation/locale/2293396-localizedstring to get the localized names of regions.
Post
Replies
Boosts
Views
Activity
See below
Could you include the code you're using? I'm getting the expected values with my source.
let templateFormatter = DateFormatter()
templateFormatter.locale = Locale(identifier: "pl")
templateFormatter.formattingContext = .standalone
templateFormatter.setLocalizedDateFormatFromTemplate("MMMM")
let gregorianCalendar = Calendar(identifier: .gregorian)
for month in 1...12 {
let date = gregorianCalendar.date(from: DateComponents(era: 1, year: 2022, month: month, day: 1, hour: 0, minute: 0, second: 0))!
let formattedValue = templateFormatter.string(from: date)
print(formattedValue)
}
Rather than setDateFormat use setLocalizedDateFormatFromTemplate and let the parameter be yMMMM.
Some regions prefer to use Western digits rather than Arabic-Indic digits, so you'll see this discrepancy for these locales:
ar_AE
ar_DZ
ar_EH
ar_LY
ar_MA
ar_TN
Is this what you mean when you say it doesn't work?
Alternatively, if you add the Arabic-Indic numbering system to your locale identifier, you can override the default, but it may be confusing to users for those locales:
ar_AE@numbers=arab
I'm not sure of the better forum for this question, but this one is for internationalization/localization, as in multiple languages.
Would you submit a feedback request along with how your app is launched, either by using Safari or by an embedded web view in an application? If by an embedded web view, are you using WKWebView?
Would you submit a feedback request, including actual steps and a screen recording, and if you can reproduce this in an Apple app, please try it from there.