Whenever there is any change in Localizable.xcstrings, XCode 16 simply crashes. This happens since early betas and continues even through the latest XCode 16.2 beta.
The issue is probably due to some obscure character somewhere in the now monolithic Localization.xcstrings file which now contains all (sometimes rather exotic) localizations - thus making pinpointing the offending character basically impossible. The issue seems to happen when the Commit UI tries to produce the delta in the Localizable.xcstrings source code.
The crash in question is this:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 SourceEditor 0x132c33b04 SourceEditorDataSource.contentRangeForLineRange(_:) + 244
1 IDEDelta 0x362349768 specialized Collection.map<A, B>(_:) + 212
2 IDEDelta 0x362346198 SourceCodeGalleryExhibitEditor.delta_collapseToSuggestedLineRanges(for:) + 796
3 IDEDelta 0x362310e7c ComparisonContext.sessionDidScrapeDiffResults(_:) + 276
4 IDEDelta 0x3623111f8 @objc ComparisonContext.sessionDidScrapeDiffResults(_:) + 52
5 DeltaFoundation 0x1444bd4e8 -[DESession _notifySessionDidScrape] + 212
6 DeltaFoundation 0x1444bcf3c -[DESession _scrapeResults] + 400
I posted a FB about this way back then (FB14906558) and sent numerous reports but the issue is just not getting resolved.
Localization
RSS for tagLocalization is the process of adapting and translating your app to multiple languages.
Posts under Localization tag
104 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I've got quite a problem as I've created a Localizible file with String catalog for my iOS app. For testing it out I've added lots of different languages and they all appeared in App settings. However, I need to remove most of them and they are still visible in the settings.
What I tried so far: I have deleted EVERYTHING that had word localizable, localizations and etc. From Project Info also all the languages were removed and left only English and French.
I also deleted my app, restarted the phone, downloaded the version without localizations from the app store and then install debug version (languages still appeared)
Hi everybody,
My team and I are currently working on an app that requires us to use localizations for the CFBundleDisplayName property in info.plist. However we are running into some issues ourselves, we need to localise the CFBundleDisplayName property for two specific countries:
Netherlands
Belgium
We've tried to use the String catalog and we've added the corresponding languages/regions there:
nl-BE (CFBundleDisplayName = x)
nl-NL (CFBundleDisplayName = y)
However the nl-BE localization does not seem to be used when changing the device language to Dutch (Belgium). It uses the nl-NL (y) value for the CFBundleDisplayName.
Is it possible to use CFBundleDisplayName localizations for specific regions that use the same language? such as Belgium and the Netherlands. If not I fear that we need to build two apps...
How does the App Store handle localized content fallbacks in the store listing, in app products, and game center content?
For example, if a user's language is set to Portuguese (Portugal) pt-PT, and I don't supply a translation for pt-PT but I do for pt-BR (Brazil), will it show the user the pt-BR translation or as a developer, do I need to provide both translations (i.e. all language variations/regions)?
Another example, if I provide translations for en-US and en-GB and the user's language is Australian English (en-AU), will it show en-US or en-GB on the store or in Game Center? I would expect it to use en-GB.
Hi,
One of the great features introduced in WWDC24 is the Translation API. But unfortunately it's currently unavailable on visionOS.
My question is, does Apple have any plan to support it on visionOS as well? If so, what's the ETA for this feature?
I would really like to see it on visionOS, otherwise I'll have to pay Google to use their translation API.
I'm trying to use the iOS 18 translation feature which works fine if I scroll slowly, but run into fatal errors when I scroll quickly.
In my view, I have this state property:
@State private var translationConfiguration: TranslationSession.Configuration?
In the body, I attach a .translationTask closure to the top-level view:
.translationTask(translationConfiguration) { translationSession in
Task { @MainActor in
...
let response = try await translationSession.translate(originalContent) // this line causes the fatal error.
}
}
I also have an onAppear { } closure on the same top-level view, which sets translationConfiguration if it is nil, or calls translationConfiguration?.invalidate() if it's non-nil.
When I scroll quickly, the view presumably appears and disappears quickly, but it seems that the translationTask closure still runs after the view disappears.
I get this fatal error:
Translation/TranslationError+TranslationOnly.swift:54: Fatal error: Attempted to use TranslationSession after the view it was attached to has disappeared, which is not supported. Instead of storing a TranslationSession instance outside of the .translationTask closure, trigger a .translationTask to run again on a visible view and use that TranslationSession instance.
The recommendation from the error message seems incorrect, though. I am not using the TranslationSession instance outside of the translationTask closure. I'm using it only inside of it.
I tried to keep an extra visible boolean property that gets set to true when the onAppear closure is called, and set to false when the onDisappear closure is called, and then I guard on that within the translationTask, but that doesn't fix the issue.
What am I missing?
I updated my app to support additional languages. However, when I checked the app in the App Store, the English language seems to have been removed.
Here's the screenshot in my App Store Connect (Default English)
App Store - Header (No English)
App Store - Information - Languages (No English)
Xcode - Project Info (Default English)
Xcode - String Catalog (Default English)
How can I get it back? Do I have to translate English to English in my String Catalog? or is this an error in the App Review side?
I checked other apps supporting multiple languages and the still have English showing.
For an iOS app, I'm using a String Catalog for localization.
In the Localizable.xcstrings, I have all the Keys set with IDs, and default to English set, and other languages added. All of the English strings has some English text value assigned. The Key and the values are different. The Swift code only makes references to the Keys.
As for the non-English languages, not all of the strings have been translated. Many of the fields are not set, i.e. it's in grey and showing the English text, and I can see the "new" tags for those untranslated strings in the String Catalog.
All of that is good and expected.
However, when I run the app in a non-English language, for the untranslated strings, I'm seeing the string Key instead of the English value. The screens in the app are shows Key IDs all over the place, along with some translated text, but nothing in default English.
Is that how it's suppose to work?
It seems like the "Default Localization (en)" should be shown. That's the whole point of having a fallback default language is it not?
I understand pre-string catalogs, the fall back default is the key, but now I'd expect it to use the default language as backup since that's what's shown in the catalog.
We are using a workspace file and have noticed that when we run fastlane commands that utilize xcodebuild command line arguments to run the export localization command from commandline, and it seems that it uses the xcodeproj package.resolved instead of the workspace package.resolved. This is causing issues as the xcodeproj package resolved will not update at all so is on old version of dependencies that cause xcodebuild commands to fail.
Why is there multiple package.resolved files and why does the xcodeproj not stay updated with what is in the workspace resolved file? Why won't the xcodeproj resolved file update when I'm opening the xcodeproj file and selecting specific dependencies and telling it to update the package.
Hello,
I'd like to ask a very fundamental question about JSONEncoder: how to sort keys in a specific order when encoding a dictionary to JSON text?
I know there is an option called JSONEncoder.OutputFormatting.sortedKeys, but it sorts the keys only in lexicographic order.
I want to sort the keys using a different comparator, such as String.localizedStandardCompare(_:), which achieves the "Finder-like" order.
The reason why I ask this question is because I have a localization tool that works with String Catalog (xcstrings file, which is a JSON), but every time my tool serializes an xcstrings file, it always messes up the keys in lexicographic order (I used JSONEncoder + .sortedKeys). Meanwhile, Xcode 16 always serializes the string keys into the "Finder-like" order. As a result, my tool always generates a huge diff when manipulating the xcstrings even when making only a small modification to it.
So I am wondering how Xcode 16 implements the String Catalog tool to serialize the JSON in "Finder-like" order. It would be great if JSONEncoder could do that too. Or, maybe I can use another serialization method to implement this behavior?
Hello Apple community !
I'm facing an issue regarding xcstrings in a local package in my project.
It's an iOS application with a local package containing multiple targets.
The Localizable.xcstrings is located in the app target and contains keys for the app and targets of the local package (Views in the targets look for keys in the main bundle)
My issue is that auto detection/extraction seems to work only for keys used inside the app bundle. It doesn't look in the package. However, if I add a Localizable.xcstrings inside a package target, it gets populated.
Is this normal behaviour & is there any way to make extraction put the keys in the main bundle xcstrings instead ? I feel like it should be normal behaviour if no xcstrings is found in the package
My fallback would be to set all keys in manual extraction state but it's not ideal ;)
Thanks in advance for the great work
Eric
**My app contains 2 languages and it works fine when I use it, so it's not an app issue.
**
But on appstoreconnect it only shows me one language, why doesn't the second one appear?
appstoreconnect -> myapp -> distributions
This is what I would like to see
Hi,
My iOS app shows more language with region codes than what I've selected in Xcode:
This is what I see in the language selection (simulator and device):
How can I remove all the language with region codes? I want to remove:
English (US)
Suomi (Suomi)
Deutsch (Deutschland)
Kalaallisut (Kalaallit Nunaat)
Norsk bokmål (Norge)
Thank you!
Hello,
I'm currently facing some issues with localization for the Safari extension on iOS:
Issues with Language Tags:
Folder names like pt-BR (Brazilian Portuguese) and pt-PT (European Portuguese) placed in the Resources/_locales/ directory are not displaying the respective languages correctly; instead, the default English is shown.
Similarly, using folder names like zh-CN (Simplified Chinese) and zh-TW (Traditional Chinese) also results in default English display instead of the intended Chinese language.
Conversely, when changing the folder names to pt (Portuguese general) and zh (Chinese general), the languages display correctly.
Could you please provide any recommendations or tips regarding language tag settings and how to ensure they are properly recognized according to RFC 5646?
Thanks for your help!
Best,
I'm creating a new app, following String catalogs,
But, after start creating separate packages per feature, I found that I have to start typing
String(localized: "Test", bundle: .module)
To not loose the functionality of auto sync with the catalog, and work with the module.
Would be really great if as it is on a separated module, work automatically within the file in the module.
Do someone knows if I'm missing something ?
Thanks
Hi there! My app supports one language by default Ukrainian (uk) and does not support multiple languages. In Xcode settings "Development Language" is set to Ukrainian by default also. I have a PKAddPassButton on a ViewController and "Add to Apple Wallet" always appears in Ukrainian (Tested on real device iOS 15/16/17). Apple's "Getting Started with Apple Pay: In-App Provisioning, Verification, Security, and Wallet Extensions” document states that "The Add to Apple Wallet button adapts to the device language and the light and dark appearances, but the issuer app needs to adapt the language of the row selector text." When I change device language to French the “Add to Apple Wallet” button does not change to French. I created a fresh swift app, added PKAddPassButton the "Add to Apple Wallet" button, General -> Language & Region changed the device language to French, etc, but the "Add to Apple Wallet" button is always in English. Has anyone run into the same issue? How to adapt the "Add to Apple Wallet" button to the device system language?
en.lproj/InfoPlist.strings
ja.lproj/InfoPlist.strings
(I resolved this issue but I still consider it a bug in Xcode. Hopefully any other poor soul that encounters it will find this post.)
Summary
When
App default localization is e.g. Japanese
Secondary localization is e.g. English
InfoPlist.xcstrings is added to the target
NSLocationWhenInUseUsageDescription is added in Japanese to Info.plist (within target build settings).
NSLocationWhenInUseUsageDescription is localized to English
CLLocationManager().requestWhenInUseAuthorization() is called
Then
If device language is English:
NSLocationWhenInUseUsageDescription is displayed in English on the location permission system dialog (correct behavior).
If device language is Japanese:
NSLocationWhenInUseUsageDescription is displayed in English on the location permission system dialog (incorrect behavior).
Expected behavior
If device language is Japanese:
NSLocationWhenInUseUsageDescription should be displayed in Japanese on the location permission system dialog.
Root cause
The json representation of InfoPlist.xcstrings is the following after following the above procedure:
{
"sourceLanguage" : "ja",
"strings" : {
"NSLocationWhenInUseUsageDescription" : {
"comment" : "Privacy - Location When In Use Usage Description",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "test"
}
},
"ja" : {
"stringUnit" : {
"state" : "new",
"value" : "テスト"
}
}
}
}
},
"version" : "1.0"
}
After building, Xcode creates the key NSLocationWhenInUseUsageDescription.ja.stringUnit.state with the value new, and the value as テスト (the automatically extracted value from Info.plist).
At runtime, iOS ignores ja.stringUnit.value and falls back to en.stringUnit.value when:
NSLocationWhenInUseUsageDescription.localizations.ja.stringUnit.state == "new"
NSLocationWhenInUseUsageDescription.extractionState == "extracted_with_value"
Additionally, Xcode's "String Catalog" interface for xcstrings files does not show the new state value in the interface and does not allow ja.stringUnit.value to be modified.
Fixes/Workarounds
Option 1
Open InfoPlist.xcstrings in string catalog mode.
Right click the entry in the source language.
Click "Mark as Reviewed".
Option 2
Open InfoPlist.xcstrings in source mode.
Change all {sourceLanguage}.stringUnit.state values from new to translated.
Option 3
Remove NSLocationWhenInUseUsageDescription key from Info.plist or build settings.
Add NSLocationWhenInUseUsageDescription key manually to InfoPlist.xcstrings.
Fill in values for source language and other languages.
Note: {key}.extractionState for this case will be manual instead of extracted_with_value.
Option 4
Use older/deprecated InfoPlist.strings files instead of .xcstrings.
InfoPlist.xcstrings after fix
{
"sourceLanguage" : "ja",
"strings" : {
"NSLocationWhenInUseUsageDescription" : {
"comment" : "Privacy - Location When In Use Usage Description",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "test"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "テスト"
}
}
}
}
},
"version" : "1.0"
}
Reproduceable Environment
Xcode 15.4 / iOS 17.5
Xcode 16 beta 5 / iOS 18
Simulator
Device
Screenshot of bug
"test" should be "テスト".
Hi Guys,
I want to localise my app store product page.
I want to have a default set of images for all product pages and for my primary location (Australia), I want my primary image to be different.
I want to show that it is Australian-made.
by default your primary location becomes your default for all other images and I don't want the same screenshot in all other stores (US, UK,JPN etc)
Any ideas?
Hi everyone! I want to localize my swift application, which uses Storyboard, using String Catalogs. I have watched several tutorial videos about localization, however, it uses SwiftUI.
I have tried localizing my storyboard through .string and migrating it to String Catalogs and it worked. (Example codes are attached below)
But in the tutorials, String Catalogs extraction works when you build the project. But if you are using storyboard, I think it is not possible? or are there any other ways to extract the strings from storyboard using string catalogs directly and not using .strings and migration?
This also makes me wonder if the Vary by Plural will work with the method that I did.
Thank you so much in advance! Have a nice day ahead!
Sample Codes from .strings (storyboard):
/* Class = "UITextField"; placeholder = "Enter Password"; ObjectID = "08D-xr-4ke"; */
"08D-xr-4ke.placeholder" = "Enter Password";
/* Class = "UIButton"; configuration.title = "Login"; ObjectID = "2gQ-cX-5nH"; */
"2gQ-cX-5nH.configuration.title" = "Login";
Migrating it to String Catalogs:
key : 08D-xr-4ke.placeholder
English(en): Enter Password
comment: /* Class = "UIButton"; configuration.title = "Login"; ObjectID = "2gQ-cX-5nH"; */
I just put my app on the store for pre-order. I wanted to localize it to Spanish (don't ask me why 😅), so it should be supporting English (primary language) and Spanish. However, on the App Store, it thinks that my app only supports Spanish. How do I fix this in App Store Connect (or wherever it should be fixed)? Thank you so much for the help!