Localization

RSS for tag

Localization is the process of adapting and translating your app to multiple languages.

Posts under Localization tag

87 Posts

Post

Replies

Boosts

Views

Activity

Localisation on Apple Watch
Hi everyone! I’m a new developer diving into my first Apple Watch project, and I’m really excited to get started! This app relies heavily on using the most precise location data possible. Could anyone point me to some official documentation or helpful resources on how to achieve high-accuracy location tracking specifically for watchOS? Any tips or best practices would also be greatly appreciated! Thanks in advance for your help!
1
0
68
Apr ’25
Unable to localise CFBundleName on iOS Home Screen in en-US
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?
4
0
170
Mar ’25
Seeking KeyboardLayout ID for All Native Keyboards in iOS and macOS
Hello everyone, I am currently working on a project that requires me to programmatically manage keyboard layouts on both iOS and macOS devices. I'm looking for a comprehensive list of KeyboardLayout ID values for all the native keyboard layouts available in both iOS and macOS. While I can extract some of this information from the /System/Library/Keyboard Layouts/ directory on macOS, I cannot extract all without adding every keyboard layout active, having a complete and pre-compiled list would be immensely helpful. Does anyone here have such a list or know where I might find one? Any guidance on this matter would be greatly appreciated. Thank you in advance for your assistance! JJ
4
0
891
Mar ’25
Custom SwiftUI view with localization support similar to the SwiftUI Text view
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() } }
1
0
267
Mar ’25
Use String Catalog and Localization with class and struct
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
3
0
372
Mar ’25
Siri misreads local currency in notifications (Bug reported, still unresolved)
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?
1
1
646
Feb ’25
¿How do I make Siri announce the local currency on notifications?
I'm currently testing the announce notifications feature and I can't seem to find out how to make Siri read aloud the current currency instead of dollars. My locale is es-CL (Chile). It uses the currency symbol $ and reads as Pesos locally or Chilean Pesos where the number 5000.1 is represented as 5.000,1 This is the notification content         let content = UNMutableNotificationContent()         content.body = "¡Has recibido un pago por $5.000!" Siri reads it aloud as "¡Has recibido un pago por 5.000 Dolares!" which translates to "You have received a payment for 5,000 Dollars", instead of the expected "¡Has recibido un pago por 5.000 Pesos!" -> "You have received a payment for 5,000 Pesos" I've tried changing the development region of the app, interpolating the string with NumberFormatter.localizedString(from: 5000, number: .currency), and with others styles( .currencyAccounting, .currencyISOCode and .currencyPlural) without good results. The last one seems to work buts it's not ideal since it outputs "5.000 pesos chilenos" which gets read as "5 pesos chilenos" which is not the correct amount (bug), it's as is you're not on Chile and I personally prefer it to be a symbol instead of words. I'm testing with my device which is setup with the region "Chile" Could someone help me find a solution?
5
1
1.3k
Feb ’25
xcstringstool not producing all localisations
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
2
0
691
Feb ’25
OTP autocomplete not working as expected
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!
3
0
874
Feb ’25
Inconsistency Between Translation API Language Identifiers and Foundation Locale
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!
1
0
307
Feb ’25
Local Authentication & localized reason string
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
7
0
813
Feb ’25
Swift Playgrounds on iPad localization
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?
2
1
478
Feb ’25
Incorrect support language displayed at App Store
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.
5
0
1.2k
Feb ’25
Leaderboard localization
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
2
0
874
Jan ’25