Localization

RSS for tag

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

Posts under Localization tag

88 Posts

Post

Replies

Boosts

Views

Activity

macOS Document-Based SwiftUI App: “Save” menu item not localized in French
Hi everyone, I’ve run into a strange localization issue with macOS document-based apps in SwiftUI/AppKit. I created a standard document-based macOS app in Xcode (SwiftUI template) and added a French localization to the project. All system-generated menu bar commands (File → New, Close, Print, etc.) are correctly translated into French… except for “Save”, which remains in English. To rule out problems in my own code, I created a fresh, unmodified document-based app project in Xcode, and immediately added French localization without touching any code. Same result: all commands are translated except “Save”. This suggests the issue isn’t specific to my app code, but either the project template, or possibly macOS itself. My environment • Xcode version: 16.4 • macOS version: 15.6.1 Sequoia] • Swift: Swift 6 Questions 1. Has anyone else seen this issue with the “Save” command not being localized? 2. Is this expected behavior (maybe “Save” is handled differently from other menu items)? 3. If it’s a bug in the template or OS, is there a known workaround? Thanks for any insights P.S. Please note that I'm a total beginner
4
0
79
2d
Network extension doesn't get the updated preferred language after changing phone language
We’ve noticed an issue where after running a network extension, if the phone’s language is changed the Locale.preferredLanguages array is not updated and still returns the old array. It only returns the updated array when the app is reinstalled or the phone is restarted. This is unlike the app itself where using the same Locale.preferredLanguages API immediately returns the updated array. We think this issue is also the cause of notifications that are sent by the network extension being in the previous language as long as the app isn’t reinstalled or the phone is restarted, despite our Localizable file having localised strings for the new language. Feedback ID: FB20086051 The feedback report includes a sample project with steps on how to reproduce the issue.
5
1
109
6d
Swift Package Manager – Support for Multiple Targets with Distinct Localization Files
I am an SDK provider working with Swift Package Manager (SPM) to deliver libraries for iOS developers. My SDK currently uses SPM targets to modularize functionality. However, SPM enforces strict resource bundling, which prevents me from efficiently offering multiple targets—each with a different set of localization files—in a single package. Current Limitation: When multiple SPM targets share the same source and resource directory but require distinct sets of .lproj localization folders (for app size or client requirements), SPM raises “overlapping sources” errors. The only workaround is to manually split resource directories or have clients prune localizations post-build, which is inefficient and error-prone. Feature Request: Please consider adding native support in Swift Package Manager for: Defining multiple targets within a single package that can process overlapping source/resource directories, Each target specifying a distinct subset of localization resource files via the exclude or a new designated parameter, Enabling efficient modular delivery of SDKs to clients needing different localization payloads, without redundant resource duplication or error-prone manual pruning. Support for this feature would greatly ease SDK distribution, lower app sizes, and improve package maintainability for iOS and all Swift platforms.
0
0
857
1w
Force a locale from string catalog
I'm writing an iOS app that shares content with buddies. So my app will run in one language but the shared content will use the locale configured for the buddy. I found this Apple documentation which suggests that locale: (Locale(identifier: is the solution. Apple Documentation But I can't get it to work. Here's sample code. struct LocalizationDemoView: View { @State var isEnglish = true var body: some View { var myLocale: String { isEnglish ? "en": "de" } VStack { Toggle("Switch language", isOn: $isEnglish).frame(maxWidth: 200) HStack { Text("\(myLocale): ") Text(String(localized: "Hello world!", locale: (Locale(identifier: myLocale)), comment: "To share")) } } } } And here's the excerpt from the string catalog: { "sourceLanguage" : "en", "strings" : { "Hello world!" : { "comment" : "To share", "localizations" : { "de" : { "stringUnit" : { "state" : "translated", "value" : "🇩🇪 Moin Welt!" } }, "en" : { "stringUnit" : { "state" : "translated", "value" : "🇬🇧 Hello world!" } } } } } } Has Apple reduced support for string catalogs or is my code wrong? Xcode 16.4 compiled on MacOS 15.6.1, device iOS 18.6.2
4
0
209
3w
How to use String Catalogs for intents definition file / custom intents?
Hi, I'm migrating my project from the old .strings files to String Catalogs (.xcstrings files). Everything is migrating over fine except for my custom intents. Right now the localization files for my custom intents all live "under" the definition file like so: But there is no option to migrate to a string catalog. I even tried removing the localization files, and re-adding them using the "Localize..." button, but that just creates the old .strings files, not the new string catalog. Is this not supported yet for intents definitions? I can't find any documentation about this. It would be a real shame to have part of my app on string catalogs and this one piece on the old Localizable.strings format.
1
0
272
3w
Unable to localize driver name or description
I am trying to localize the CFBundleDisplayName and OSBundleUsageDescription of a driver that is part of an app. I am able to use InfoPlist.strings files to localize the Bundle display name for the app, but when I try to use the same file as part of the driver, the name displayed in settings for the app does not change correctly. In fact, it seems to follow the default language set in the xcode project. If the default language is not included in the suite of InfoPlist.strings files, it seems to take the string from the info.plist file. sometimes it just seems to take the English version regardless of the default language or tablet language. Has anyone had success with this?
4
7
137
3w
iOS 26 - Widget not updated with respect to main app's system preferred language
Hi, My iOS app's home screen widget content was implemented to base on the preferred language of my main app (e.g. my app has the following preferred language options with this order English, Japanese, Traditional Chinese, Korean, Simplify Chinese). Say the main app is currently using English as their preferred language, I can change the preferred language in the iOS Settings -> Apps -> My App -> Preferred Language. My widget's content will respect to the preferred language option that I selected with only exception if I switch back to English language and my Widget's content won't get updated. The Main app content is always update with respect to the selected preferred language. My app and widget is working without any issue in iOS 18. Other things that I had discovered during my testing under iOS 26, the "first" language appeared in my preferred language always being the issue (e.g. if the first language is Japanese , once I change to other languages and than switch back to Japanese, my widget content won't respect to this but the main app content are ok). Any one has a similar issues regarding the preferred language?
1
0
80
4w
AVSpeechSynthesizer read Mandarin as Cantonese(iOS 26 beta 3))
In iOS 26, AVSpeechSynthesizer read Mandarin into Cantonese pronunciation. No matter how you set the language, and change the settings of my phone system, it doesn't work. let utterance = AVSpeechUtterance(string: "你好啊") //let voice = AVSpeechSynthesisVoice(language: "zh-CN") // not work let voice = AVSpeechSynthesisVoice(language: "zh-Hans") // not work too utterance.voice = voice et synth = AVSpeechSynthesizer() synth.speak(utterance)
1
0
199
Aug ’25
Change iOS Keyboard Language without adding to Settings > Keyboards
The first-party Apple Translate app will switch the on-screen keyboard to the selected language, even when the keyboard for that language is NOT added in Settings > General > Keyboards. We'd like to mirror this behavior and switch the keyboard for input based on a user-selected language from a drop-down without the user needing to add that language to Keyboards I'm struggling to find if this behavior is achieved via a public API. Any insights here?
1
0
47
Aug ’25
Localizing prompts that has string interpolated generable objects
I'm working on localizing my prompts to support multiple languages, and in some cases my prompts has String interpolated Generable objects. for example: "Given the following workout routine: \(routine), suggest one additional exercise to complement it." In the Strings dictionary, I'm only able to select String, Int or Double parameters using %@ and %lld. Has anyone found a way to accomplish this?
1
0
327
Jul ’25
Change the Language of my current input keyboard programmatically in iOS and MacOS
We are building a Multi-Lingual Business Application -- where the user is able to enter values and data in multiple languages. One of our main use cases is, if a user is editing or adding to a text value or data that is in a different language. For example, the data they are editing could be in Japanese, and the user's current input language is set to English, then when they enter the editing mode, the input language is automatically set to Japanese by us -- programmatically. They can go back to editing English items, and the input language is changed back to English, and similarly, when they come back to edit the Japanese data or some German data, then the input language is again automatically changed to the respective language by the application -- without causing the user to manually go to the settings and change it. Is there any current way to have this behaviour in MacOS and iOS now? Please suggest what can be done to achieve the same.
4
1
597
Jul ’25
Any difference between primary language English U.S. and U.K.?
Hi. I have chosen a name for my new app, which isn't available in "English U.S.". When uploading it to TestFlight using Xcode, I get. The app name you entered is already being used. If you have trademark rights to this name and would like it released for your use, submit a claim. I changed the primary (and only) language from "English U.S." to "English U.K." and the app name is now accepted by App Store Connect. The app is supposed to be worldwide available and doesn't target any specific geographical region. It's also only available in English (no localizations). Are there any disadvantages using "English U.K." i.s.o. "English U.S."? What are the differences between both when it comes to App Store presentation, ranking, search, ... I don't really see why Apple offers 4 English languages. Every style understands the other one, despite some minor spelling differences.
2
1
98
Jul ’25
Selecting an output language with Foundation Models
When using Foundation Models, is it possible to ask the model to produce output in a specific language, apart from giving an instruction like "Provide answers in ." ? (I tried that and it kind of worked, but it seems fragile.) I haven't noticed an API to do so and have a use-case where the output should be in a user-selectable language that is not the current system language.
3
1
460
Jul ’25
How to Set Different App Store Metadata for India and UAE (Both in English)?
We’re looking to localize our App Store listing with different metadata (app name, description, etc.) for India and the UAE, both in English. In Xcode, we’ve already added .lproj folders for en-IN (English - India) and en-AE (English - UAE), and confirmed that the localized content is present in the bundle. However, when uploading to App Store Connect, we do not see English (India) or English (UAE) as available storefront metadata options. This is a problem because our current English (UK) metadata is UAE-specific (includes VAT, TRN, etc.), but users in India are seeing that same listing, even though it doesn’t apply to them (India uses GST, e-way bill, etc.). Our questions: 1. Are region-specific English variants like en-IN or en-AE supported for App Store metadata localization? 2. If not, is there an alternative way to offer different storefront experiences (e.g., name, description) for India and UAE? 3. Can this be achieved via custom store territories or another mechanism? Our goal is to tailor the App Store listing specifically for users in India and UAE, both in English.
0
0
44
Jul ’25
Xcode 26 Bug: URLs with percent encoding query parameters won't compile
Just repro'd in the latest Xcode 26 Beta 3. Building an iOS app using xcstrings for localization. We have a URL that uses percent encoding for a query param. For example: Upon compiling in the latest Xcode 26 beta this fails with: Unable to create a Swift type from the format specifier “%20S”. This was not the case in prior Xcode versions.
1
0
120
Jul ’25
Xcode 26 String Catalog generate comment grayed out
Why is "generate comment" button grayed out? I'm running macOS Tahoe Beta 2, Xcode 26 Beta 2 Apple intelligence on both system preferences as well as Xcode are enabled Created fresh Xcode project to test it (happens on my older project too) Xcode Preferences -> Editing -> Automatically generate string catalog comments (tried with ON/OFF) Tried to CMD+B to re-index project Not sure what else to try.
2
0
199
Jun ’25
How to use generated symbols from string catalogs in SPM packages
In WWDC25 Video "Explore localization with Xcode" they show how to use generated symbols from string catalogs. This is a great feature and I'd like to use it. However most of my code is split across smaller SPM packages. In the video they say at 19:20: Finally, generated symbols help you avoid boilerplate code in frameworks and packages. I've been able to use the refactoring tool to convert strings from my catalog to use generated symbols. Afterwards the code doesn't compile anymore: Type 'LocalizedStringResource' has no member '' Unfortunately the video only showcases this for frameworks but not for packages. Since they clearly speak about packages I'd like to learn how to use the feature for my packages.
1
0
46
Jun ’25
String catalogs in packages
We have separated much of our UI into different packages to reduce complexity and compile time. When we recently tested using new .xcstrings string catalogs, we hit an unexpected problem. Strings extracted from SwiftUI components like Text or Button are extracted into the Localizable.xcstrings in the same package, but the default behaviour of Text(_ key:tableName:bundle:comment:) is to use Bundle.main. When the default behaviour of the string extraction isn't to extract to the main app target, this introduces a very fragile system where it's easy to add code that looks localised, but ends up failing lookup at runtime. I don't feel comfortable that we will always remember to define the correct module every time we create a Text. Also, other components like Button doesn't have an init that takes a Bundle, so we would also have to remember that Button(_ titleKey:action:) can now only be used in a package if we make sure that the main bundle contains a matching key. Is there a way for us to make sure that strings are always extracted to the same place as they are resolved against by default? Either by having strings in packages extracted to an xcstrings file in the main app or having Text default to resolving against the module bundle by default?
4
4
2.2k
Jun ’25
Xcode Static Analysis Not Warning About Localization Issue - User Facing Strings when Format String is Used
If I do this: NSString *name = @"Jim"; NSMenuItem *menuItem = [[NSMenuItem alloc]init]; // Analyze does show localization warning when format string is used. menuItem.title = [NSString stringWithFormat:@"Hello %@",name]; I expect to get the following warning: User-facing text should use localized string macro But I don't. However if I do this: menuItem.title = @"What"; I do get the warning about localization as expected and as desired when I run Analyze. Is this considered a bug? Thanks!
1
0
62
Jun ’25
Is there a way to avoid generating InfoPlist.xcstrings for framework targets?
Xcode automatically generates an InfoPlist.xcstrings file for all targets, even framework targets. In frameworks, this doesn't include any user-facing content - it only has the bundle name and the copyright string. But neither of these are going to be used by users. Is there a way to tell Xcode that it doesn't need to generate these xcstrings files for content that is not user-facing?
2
0
65
Jun ’25