Hi,
I have an app that has a different name in en-GB and en-US. In the past I have created localised InfoPlist.strings files,
InfoPlist.strings (English)
InfoPlist.strings (English (United Kingdom))
InfoPlist.strings (English (United States))
and added
CFBundleName = "Default Name",
CFBundleName = "UK Name", and
CFBundleName = "US Name",
for example to each of the three files respectively.
After building/installing/running this has worked as expected; if you set the device language to en_GB the display name on the iOS Home Screen is "UK Name", if you set it to en_AU for example it would be "Default Name" and if you set it to en_US it would be "US Name".
Furthermore, when the name appears in system modals the correct name would appear based on locale too. For example, with the device language set to en_US, if you long press the app icon on the iOS home screen and tap Remove App, a modal will appear which says 'Remove "US Name"?'.
This no longer appears to work correctly. For that same project having made no changes, simply running it on an iOS 17 or iOS 18 device; with the language set to en_US, the name on the home screen will be "Default Name", however, if you again long press and tap remove app, it will say 'Remove "US Name"'. It works correctly for en-GB.
Like I said, I remember this working in the past, so I checked on an old device I have running iOS 15.8.2 as well as a simulator running iOS 15.2 and it does work as expected in both of those cases.
I tried to create a new minimal project to see if something had changed and therefore if the setup I have is now incorrect and saw that the preferred method of localization now involves making a string catalog instead of multiple strings files. For a new project; duplicating the setup at the top of this post using a string catalogue file named InfoPlist.xcstrings results in the same incorrect behaviour when setting the device language to en_US.
I guess my question is, is this a bug in iOS? Or is it likely that I am doing something wrong here?
Localization
RSS for tagLocalization is the process of adapting and translating your app to multiple languages.
Posts under Localization tag
91 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I'd like to create a custom SwiftUI view that supports extracting its title string along with the localization comment into a string catalog. Like the SwiftUI Text view does. I have a view with an init similar to the localization init of Text. But it looks like I'm missing something obvious.
Two questions:
How do I get the actual localized string using a LocalizedStringKey?
Why is the comment not picked up and added to the string catalog?
// 1) My custom view with localization support:
// I'd like to build a view which supports extraction of strings into a string catalog like the SwiftUI `Text` view does.
struct MyLocalizableView: View {
private var localizedTitle: String
init (_ titleKey: LocalizedStringKey, table: String? = nil, bundle: Bundle? = nil, comment: StaticString? = nil) {
// PROBLEM I:
// The following line does not work. I is a fantasy call. It depicts my idea how I would expect it to work.
// My question is: How do I get the actual localized string using a `LocalizedStringKey`?
self.localizedTitle = String(localizedKey: titleKey, table: table, bundle: bundle, comment: comment)
}
var body: some View {
// At this point I want to do an operation on an actual string and not on a LocalizedStringKey. So I can't just pass the LocalizedStringKey value along.
// Do `isEmpty` or some other operation on an actual string:
if localizedTitle.isEmpty {
Text("Show one thing")
} else {
Text("Show another thing")
Text("** \(localizedTitle) **")
}
}
}
// 2) The call site:
struct ContentView: View {
var body: some View {
// PROBLEM II: "My title key" is picked up and is extracted into the string catalog of the app. But the comment is NOT!
MyLocalizableView("My title key", comment: "The title of the view...")
.padding()
}
}
Hello, the LocalizedStringKey does not work in the live activity. What do you suggest me to use in order to get localization in the live activity?
Hi Everyone,
I was able to create the String Catalog with all my strings getting automatic into the stringCatalog except the strings from my models where is not swiftUI and where all I have a class with a lot of info for my app.
Some classes are short and I was able to just make the strings localizable by adding on every line:
(String(localized: "Telefone"))
But I have one class which has Line: 1071 and Col: 1610 and every line I have 7 strings that needs to get localized. These 7 strings are repeated on every line.
So I was trying to create a localization for these 7 strings on this class without having to write (String(localized: "Telefone")) 7 times on every line.
is there a way?
Here is short version of my class:
import Foundation
class LensStructFilter: Identifiable {
var description: String
init(description: String) {
self.description = description
}
}
let lensEntriesFilter: [LensStructFilter] = [
LensStructFilter(description: "Focal: 24mm \nAbertura Máxima: F2.8 \nCobertura: FULL FRAME \nBocal: Nikon F \nFoco Mínimo: 0,30m \nDiâmetro Frontal: 52mm \nPeso: 275g \n\nFocal: 35mm \nAbertura Máxima: F2.0 \nCobertura: FULL FRAME \nBocal: Nikon F \nFoco Mínimo: 0,25m \nDiâmetro Frontal: 52mm \nPeso: 205g \n\nFocal: 50mm \nAbertura Máxima: F1.8 \nCobertura: FULL FRAME \nBocal: Nikon F \nFoco Mínimo: 0,45m \nDiâmetro Frontal: 52mm \nPeso: 185g \n\nFocal: 85mm \nAbertura Máxima: F1.8 \nCobertura: FULL FRAME \nBocal: Nikon F \nFoco Mínimo: 0,80m \nDiâmetro Frontal: 67mm \nPeso: 350g \n\nFocal: 105mm MACRO \nAbertura Máxima: F2.8 \nCobertura: FULL FRAME \nBocal: Nikon F \nFoco Mínimo: 0,31m \nDiâmetro Frontal: 62mm \nPeso: 720g"),
LensStructFilter(description: "Focal: 16-35mm \nAbertura Máxima: F2.8 \nCobertura: FULL FRAME \nBocal: EF \nFoco Mínimo: 0,28m \nDiâmetro Frontal (rosca): 82mm \nPeso: 790Kg"),
Thanks
In my code, I do this:
Text("\(languagesManager.availableWords.count)")
And next time I build, this creates an entry in Localizable.strings: %lld
Is there a way I can flag this UI element to indicate its string doesn't need to be localized?
I’m experiencing an issue where Siri incorrectly announces currency values in notifications. Instead of reading the local currency correctly, it always reads amounts as US dollars.
Issue details:
My iPhone is set to Region: Chile and Language: Spanish (Chile).
In Chile, the currency symbol $ represents Chilean Pesos (CLP), not US dollars.
A notification with the text:
let content = UNMutableNotificationContent()
content.body = "¡Has recibido un pago por $5.000!"
is read aloud by Siri as:
”¡Has recibido un pago por 5.000 dólares!”
(English: “You have received a payment of five thousand dollars!”)
instead of the correct:
”¡Has recibido un pago por 5.000 pesos!”
(English: “You have received a payment of five thousand pesos!”)
Another developer already reported the same issue back in 2023, and it remains unresolved: https://developer.apple.com/forums/thread/723177
This incorrect behavior is not limited to iOS notifications; it also occurs in other Apple services:
watchOS, iPadOS, and macOS (Siri misreads currency values in various system interactions).
Siri’s currency conversion feature misinterprets $ as USD even when the device is set to a region where $ represents a different currency.
Announce Notifications on AirPods also exhibits this issue, making it confusing when Siri announces transaction amounts incorrectly.
Apple Intelligence interactions are also affected—for example, asking Siri to “read my latest emails” when one of them contains a monetary value results in Siri misreading the currency.
I have submitted a bug report via Feedback Assistant, and the Feedback ID is FB16561348.
This issue significantly impacts accessibility and localization for users in regions where the currency symbol $ is not associated with US dollars.
Has anyone found a workaround, or is there any update from Apple on this?
Topic:
Accessibility & Inclusion
SubTopic:
General
Tags:
Siri and Voice
User Notifications
Localization
Apple Intelligence
Hi iOS peeps !
Was just wondering if anyone has had this issue before with String Catalogs. I have an iOS project where I am using String Catalogs for localisation ( the project is split up into multiple local swift packages with each project having its own Localizable.xcstrings ) and the app currently only supports en as the base and en-US for US localisation
During the build process however some of the swift packages only produce the en-US localisation and is missing the en default localisation in the binary. Having a look at the build log for some xcstringstool will only produce one set of Localizable.strings (en-US.lproj) instead of (en.lproj and en-US.proj)
I haven't been able to find much documentation from Apple on xcstringstool as well / not sure where to find more info about this
I have a UITextField with UITextContentType equal to oneTimeCode.
It works as expected if the message is in English and the keyword "OTP" exists.
It doesn't work if the message is in Greek and the keyword "OTP" is translated also in greek.
Is the OTP keyword really needed? Is there any alternative? Which are the keywords for any case? Are these keywords only in English?
Thanks in advance!
I recently noticed an inconsistency in how languages are represented in Apple’s new Translation API compared to Foundation’s Locale system.
Observation from the Translation API
When retrieving the list of supported languages using:
let availableLanguages = try await LanguageAvailability().supportedLanguages
The results are:
Language(components: Foundation.Locale.Language.Components(languageCode: Optional(uk), script: nil, region: Optional(UA)))
Language(components: Foundation.Locale.Language.Components(languageCode: Optional(zh), script: nil, region: Optional(TW)))
Language(components: Foundation.Locale.Language.Components(languageCode: Optional(ko), script: nil, region: Optional(KR)))
Language(components: Foundation.Locale.Language.Components(languageCode: Optional(en), script: nil, region: Optional(GB)))
Language(components: Foundation.Locale.Language.Components(languageCode: Optional(de), script: nil, region: Optional(DE)))
Language(components: Foundation.Locale.Language.Components(languageCode: Optional(zh), script: nil, region: Optional(CN)))
Language(components: Foundation.Locale.Language.Components(languageCode: Optional(ja), script: nil, region: Optional(JP)))
Language(components: Foundation.Locale.Language.Components(languageCode: Optional(id), script: nil, region: Optional(ID)))
Language(components: Foundation.Locale.Language.Components(languageCode: Optional(nl), script: nil, region: Optional(NL)))
....
Key points:
• The script component is always nil.
• Region codes (CN, TW, etc.) determine the script for languages like Chinese (Simplified or Traditional).
• Other languages (e.g., en-GB, en-US, pt-BR) also rely on region-based identification.
Observation from Foundation Locale (Locale.current.language)
When retrieving the user’s system language setting:
systemLanguageObj = Locale.current.language
I get a different format where the script component is present, but the region may vary based on user settings. This means that mapping between script and region is not consistent between the two APIs, requiring manual handling.
My key questions:
1. Is my current approach correct, or is there a better way to get user language settings that match Translation API identifiers?
2. If no alternative exists, could the Translation API align its language identification method with Foundation Locale to reduce ambiguity?
Any insights or suggestions would be greatly appreciated!
Hey, meanwhile it's a great thing to program apps on the iPad and to be able to load them into the App Store Connect and the App Store.
What about localization in the meantime? When I open the folder en.lproj in sample apps from XCode, then there are two files stored in it:
Glossary.plist (XML) and
Localizable.strings (binary)
Is it correct that XCode creates binary files from the strings? Otherwise, Swift Playgrounds already offers localization in the localized learning content, but i guess the binary files can only be created in XCode?
In a project I was using Local Authentication to authenticate a user. When I got a request to support smartcard/PIV token authentication (which Local Authentication does not support), I had to switch to Authorization Services, which works pretty. There's only one issue I have. Local Authentication's evaluatePolicy:localizedReason:reply: requires a reason in the form "<appname>" is trying to <localized reason>. The app is currently translated into 41 languages and I would like to use the localized strings for the AuthorizationEnvironment of Authorization Services as well. The problem is that Local Authentication prefixes the localized string with something like "<appname>" is trying to and Authorization Services does not do this. Is there a way to get this prefix from somewhere so I can manually add it to the (partially) localized string? Any help would be highly appreciated.
Thank you,
Marc
when we launch the application and change the language from german/french to english or any other language then in also it is changing app language, but bluetooth connection screen with pair or cancel alert is showing on previous selected language. Since that alert is system alert, is there any wayto debug/resolve that issue.
Topic:
App & System Services
SubTopic:
General
Tags:
iOS
Internationalization
Localization
Core Bluetooth
Hello,
I setup a leaderboard in the default language English and everything works and the app is live in the store.
Now I am adding localization to the leaderboard and noticed than some languages have the data entry "Score Format Suffix" and some languages the data entries "Score Format Suffix (Singular)" and "Score Format Suffix (Plural)" instead.
Is this an error or intentional?
Kind Regards,
Chris
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store Connect
Localization
GameKit
Having the app localised and configured to Dutch from Belgium (nl_BE), I open a url with WKWebView. The website locale detects Dutch from Netherlands (nl_NL)
Hello,
I have the app localised to many languages and its variants, like English from Australia or Dutch from Belgium.
My phone language is en_UK and the region is configured to ES.
I cannot find a way to get the regional language code (ex: en_au, nl_be), it always gets simplified to the language (ex: en, nl), or adds my device region (ex: en-ES, nl-ES).
Here I attach some examples while I have the app on en_au
Locale.preferredLanguages
▿ 3 elements
- 0 : "en-ES"
- 1 : "ca-ES"
- 2 : "es-ES"
Bundle.main.preferredLocalizations
▿ 1 element
- 0 : "en"
NSLocale.current.languageCode
▿ Optional<String>
- some : "en"
Locale.current
▿ en_001@rg=eszzzz (fixed en_001@rg=eszzzz)
- identifier : "en_001@rg=eszzzz"
- locale : "fixed en_001@rg=eszzzz"
Locale.autoupdatingCurrent.languageCode
▿ Optional<String>
- some : "en"
Locale.current.languageCode
▿ Optional<String>
- some : "en"
Locale.preferredLanguages[0]
"en-ES"
struct DeployAndWithdrawDefensesAppIntent: WidgetConfigurationIntent {
// An example configurable parameter.
@Parameter(title:LocalizedStringResource("ax_alarm_device_name"))
}
In the process of using iOS widgetKit development team a, configuration item title need language internationalization (@ Parameter (title: LocalizedStringResource (" ax_alarm_device_name "))),
but found no effect. I first changed the language of the system on the iphone and found that the widget worked. However, just changing the language of the app did not take effect. Is there any way to just change the app language and make the widgets change? Thank you very much!
We have a requirement in the App in which for certain countries/regions we have to support only certain languages. If the User's current language is not supported, We would have a custom fallback/default language for specific regions. like it could be Arabic for middle east countries, English for Europe etc.
Since iOS localization allows fallback to only one Base localizations, we had to take a custom approach to implement the same.
To achieve the same, we checked the User's current language and Country and if required we overrode the
"kLanguageBundleKey" property within the Bundle class, and
set the following user defaults, (here for example say english)
Foundation.UserDefaults.standard.set(["en"], forKey: "AppleLanguages")
Foundation.UserDefaults.standard.synchronize().
And it works!
The problem is that in iOS, post this override, when the user changes language from the Phone's settings app. Launches our app, Bundle.main.preferredLocalizations.first always gives what we overwrote and not the one present in the Phone's settings.
Given this,
Is there way to get the user's current language even after such overrides? or should we do the language overrides some other way?
Our app support English and Traditional Chinese only, so the Xcode config and the app store setting include these 2 languages only now.
However, the support languages displayed at the App Store show our app support Simplified Chinese.
Would like to know is there any config we missed or wrong setting we have done?
Appreciate for any reply or suggestion.
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store
iOS
Internationalization
Localization
NavigationTitle does not change when the app language changes. It works well in iOS 17.5 but does not in iOS 18.x
Setup
I have 2 swift packages and I try to use stirng catalog to manage your localizations
I would like to use some specific keys in these packages and some common ones (e.g. "ok_button_tittle")
Problem statement
I really don't like the idea of creating separate (but the same) translations in these packages
I have tried using something like
String(
localized: "ok_button_title",
table: "Localizable",
bundle: .main,
comment: "Ok button title"
)
This does use translations from the main bundle, however this does not automatically create the keys in string catalog
Question
Is there any possibility to reuse the translations from the main bundle?
Maybe there is a hack to make the keys appear automatically in the correct bundle? Or is it a bug?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Swift Packages
Swift
Asset Catalog
Localization