Localization

RSS for tag

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

Localization Documentation

Posts under Localization tag

135 Posts
Sort by:
Post not yet marked as solved
2 Replies
465 Views
Hello. I have an app in the app store that I have localized into several languages. But the list of languages that the app supports in the App Store lacks English, which is the main language (and the language I developed the app in). I'm localizing the text by using String with a "localized" key and a defaultValue (in English). I also created a localization string catalog where I added added the values for each key on each language. On Xcode (15.0.1), in the app file, info, localization section I see that all languages are there with green checkmarks, except English which is at the top and is the default language. However, when I build, archive and send the bundle to AppStoreConnect, the Localizations in the Store Information section for the bundle does not include English, and so on the AppStore it looks like the app supports all of the additional languages but it does not list English. I can't figure out exactly what I'm missing. Can anyone help?
Posted
by marcbits.
Last updated
.
Post not yet marked as solved
3 Replies
453 Views
I'm trying to display an Int in Hebrew. so for example 123 should display אבג 1 = א 2 = ב 3 = ג I have tried specifying the locale based on a the answer to a different post of mine where the solution was to specify the numbering system in the locale Locale(identifier: "he-IL@numbers=hebr") print(123.formatted(.number.locale(Locale(identifier: "en@numbers=hebr")))) // Output: 123 When setting the same locale for dates it formats properly with Hebrew numbers. However if I do Arabic instead of Hebrew the numbers display properly in arabic the result for this is `` print(123.formatted(.number.locale(Locale(identifier: "en@numbers=Arab")))) // Output: ١٢٣ Below is the code I've tried running in a playground: This is the code I ran in the playground
Posted
by Timapp.
Last updated
.
Post not yet marked as solved
0 Replies
620 Views
Hi everyone, I'm currently working on a React Native app and need assistance with localization. Specifically, I've added an InfoPlist.strings file for NSUserTrackingUsageDescription and created language-specific files for each supported language. However, when I try to build the app in Xcode (version 15.0.1), I encounter the following error: error: unable to open dependencies file (/Users/myname/Library/Developer/Xcode/DerivedData/myproject-bxfjslkrewxnfcgmeelilvixy/Build/Intermediates.noindex/myproject.build/Debug-iphonesimulator/myproject.build/DerivedSources/Users/myname/projects/project-folder/ios/en.lproj/InfoPlist.strings.d) (in target 'myproject' from project 'myproject') Any insights or solutions would be greatly appreciated. Thank you!
Posted
by darion010.
Last updated
.
Post not yet marked as solved
2 Replies
317 Views
Hi, I am facing the following problem: I have a framework that has localisation for a few languages. When the framework is used in an application that has only support for English the frameworks's content is shown in English as well, even tho it has support for the device language. Is this behaviour expected and is there a clean work around this. I couldn't find any official documentation about this.
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.2k Views
Hey everyone, I have translated my app using the newest String Catalog feature but im wondering how can I translate the strings from the Target -> Info tab. I have read the string catalog documentation and searched on the internet but I can't find a recent post talking about it. I have found methods related to the info.plist file but afaik that would be legacy documentation as I can't even find a info.plist file in my project anymore. Also tried to look for posts talking about it here, but maybe I'm not using the right words as I couldn't find anything. I only found this article that mentions translating the strings from info but still couldn't see how to do it: https://developer.apple.com/documentation/bundleresources/information_property_list/managing_your_app_s_information_property_list#3375316 So if someone could help me out, it would be very appreciated, thanks. EDIT: I just followed the "creating a infoplist.strings" way and it worked, but im still wondering if there is a newer way to do it. I tried to just add a manual string in the string catalog using "NSContactsUsageDescription" as key but it didn't work
Posted
by mrpinguv.
Last updated
.
Post marked as solved
6 Replies
2.8k Views
Hello, do the String Catalogs (new in Xcode 15) support Swift Packages? I've tried adding a new Localizable.xcstrings (string catalog) file to my package's resources folder. Great! I then see this screen: All good so far. I then try to go and build my Swift Package... and nothing changes. The string catalog is never populated and I'm left with the same screen as above. So, do string catalogs not support packages at this time or am I doing something wrong? I was really hoping String Catalogs would work and save the day since Export Localizations also does not work for Swift packages that don't support macOS. 😔
Posted
by kernelpop.
Last updated
.
Post not yet marked as solved
1 Replies
432 Views
Hello, I migrated a project to use String Catalogs (Localizable.xcstrings) instead of Localized.strings and Localized.stringsdict files. So far so good, but since I use a lot localized strings in my project, there are quite some localizations used more than once in different contexts and thus with different comments. For example: Source file 1: String(localized: "Something", comment: "Button title for context1") Source file 2: String(localized: "Something", comment: "Column title for context2") This results to a Localized.xcstrings file with this content: { "sourceLanguage" : "en", "strings" : { "Something" : { "comment" : "Column title for context2\nButton title for context1" } }, "version" : "1.0" } The main problem with this is, that the order of the concatenated comment changes randomly during each build. After the next Xcode build (without any code changes), the same Localized.xcstrings file might look like this: { "sourceLanguage" : "en", "strings" : { "Something" : { "comment" : "Button title for context1\nColumn title for context2" } }, "version" : "1.0" } This leads to false positives when trying to commit changes to a git repository, which is quite annoying. Am I the only one, having issues with comments in String Catalogs and git?
Posted
by ERenschHG.
Last updated
.
Post not yet marked as solved
0 Replies
440 Views
We want to implement Serbian (latin) language in our app. The idea is pretty simple: if user device's preferred language is Serbian (no matter, latin or cyrillic) – we use Serbian latin, which we have in our app. The problem is that it looks like this idea is unimplementable. If we use sr_Latn as code for Serbian latin in our Info.plist, and device's preferred language is just Serbian (which is Cyrillic in iOS) – the fallback in app will be English (default language), not Serbian latin. Reverse is the same: if we implement Serbian latin as sr (just Serbian), then user select Serbian latin (sr_Latn) as device's preferred language – then app language will be English, not Serbian. In the source code published on one of the forum's answer I see that it is expected fallback (unfortunately undocumented). This code is old one, but looks like behavior still persist. Is there any way to implement one Serbian for all cases?
Posted Last updated
.
Post marked as solved
2 Replies
635 Views
I am seeing the following log in the console in Xcode Version 15.0.1 (15A507): Cannot use inflection engine (Checking that the token is the correct type): I am able to reproduce the issue using Apple's own sample code, "Building a Localized Food-Ordering App" associated with WWDC21 Session 10109: What's New In Foundation, simply by building and running the sample code. That log message immediately appears a few times in the console when running that sample project. I'm assuming given it is happening in Apple's own sample project, that this is merely console noise and basically something out of my control.
Posted
by JohnC2.
Last updated
.
Post not yet marked as solved
0 Replies
356 Views
Hello. We are currently creating our dmg with hdiutil and I was wondering if it would be possible to have localized resources in it. Right now, we have a single background image for every locale. Would it be possible to have different background image based on user locale, also with default background image as a backup in case we don't have users locale? The use case for this is the Quebec's Bill 96 Law 14, stating that products sold in Quebec have to be localised in Canadian french. Thank you.
Posted
by capso.
Last updated
.
Post marked as solved
1 Replies
469 Views
I am currently facing a problem where I want to localize the application's CFBundleDisplayName in Canadian English (amongst other languages and regions). It works well for all other use cases, including Canadian French. However for Canadian English, the app's name is just displayed in the main English localization (en). To find out what is wrong, I set up a totally empty project and only localized the name - it doesn't work. I changed the type of localization from Strings file (legacy) to String catalog, same error. I summarized everything in this screenshot: I've spent so much time already and still can't figure out what is happening. Can someone maybe quickly create a new project with the two localizations like in my screenshot and report if the same problem exists for English (Canada)? TLDR: Localization of CFBundleDisplayName works for fr-CA but not for en-CA, problem exists even in minimal reproducible example (empty project with CFBundleDisplayName localization)
Posted
by fodjan.
Last updated
.
Post marked as solved
2 Replies
386 Views
Localising my app I found the entire process quite un-swift like (i.e. unsafe and unintuitive) and was not the only one, even the great Paul Hudson also thought it a strange implementation. Following a tutorial by Andrii Halabuda (https://www.youtube.com/watch?v=_PBA20ZVk1A) relying on an Enum to reduce errors, I found that the strings needed in the "Localizable.strings" strings file could not be avoided. I have not tried localisation in SwiftUI, I see that it is different, is it easier i.e. can Plists and such be avoided ? Is there any word on deeper integration that is just more like a normal method ?
Posted
by trined.
Last updated
.
Post not yet marked as solved
2 Replies
818 Views
The Problem: The App Store listing of my app does not show all languages the app is localised in: The Question: How to fix this? A potential reason I could imagine might be, that the App Store looks for the files localised, and Xcode shows 0 localised files in English for my app, because English is my development language and all Strings are in English like that: Text("Reload", comment: "Menu action to reload feed") I really don't want to translate every English word, to English like "Reload" = "Reload". What am I getting wrong here? How can I have the App Store show both supported languages? The current implementation: My app supports two languages and I am using the new String catalog for localising. Both languages work while testing on device and are available from the App Settings in the System settings app to switch between:
Posted
by scl-dev.
Last updated
.
Post not yet marked as solved
0 Replies
383 Views
I'm trying to run UITests just once. However, Xcode by default seems to run every permutation of light/dark color theme and device orientation and localizations. This means all UITests run 8 times (with 1 additional localization besides English). With tests that can take a couple minutes, the time to run all these adds up. Nothing in my UITest depends on the color theme, so I'd like to turn those permutations off always. The orientation and localization variations I might want sometimes but would generally also like to turn off. Questions: Can I disable any/all of these permutations? How can I get the locale string for the current run? I've tried using Locale(identifier: Locale.preferredLanguages.first!) but this just gets the device language, not the language being used on that run of the UI Test. Minimal reproducible example: Make a new SwiftUI app project in Xcode 15. Add a UI Testing Bundle target Add a localization in the general app settings, then add a string catalog called Localizable and at least one string's translation in that string catalog. Run a UITest Observe that it runs 8 times. Thanks for the help!
Posted
by grachus.
Last updated
.
Post not yet marked as solved
2 Replies
1k Views
I'm trying to remove a few languages which is present as the localized language in my app (under language section) in iTunes connect but when I try to remove it, it allows me to remove but when I try to save these changes Apple is prompting me an error message "You have one or more errors on this page. • An error has occurred. Try again later." Can anyone, please let me know how can I remove a localized language?
Posted Last updated
.
Post not yet marked as solved
1 Replies
409 Views
Hey there! 👋🏻 I'm currently localizing my app and came across the interesting fact that in China (I'm not aware of other countries) the color red is associated with something positive, whereas in Germany (where I come from) the color green evokes a positive association. I then tried out whether this is taken into account in Apple's native apps. For example, in the Stocks app, a price gain with German localization is shown in green, whereas a price gain with Chinese localization is shown in red. Now I'm wondering whether there is a static property of the Color or UIColor class where I can retrieve a positive or negative color depending on the localization. Does anyone have experience with this? Thanks in advance! 😊
Posted
by Murd2017.
Last updated
.
Post not yet marked as solved
2 Replies
458 Views
I have currently migrated to String catalogs. I have a prefix operator function like below to set a localized string and its working fine. prefix operator && prefix func &&(key: String) -> String { NSLocalizedString(key, comment: "") } Usage: let sampleText = &&"alpha.beta.gamma" label.setText(sampleText) But with XCode 15, strings from the code are not added automatically to the catalog file. But if I declare like below in the code, its working as expected. let text = NSLocalizedString("Hello world", comment: "") label.setText(sampleText) Thought and insights will be much appreciated.
Posted Last updated
.
Post marked as solved
1 Replies
358 Views
Just found something weird with the String(localized:) method. Let's say that I have a "%lld apples" sentence inside a string catalog. If I call String(localized:"\(1000) apples") when on the device settings the number format is "1'234'567.89" and the device language is English, then the following string is returned: 1\'000 apples Any idea why the ' character has a backslash? It's a bug or I miss something? Thank you
Posted
by DaleOne.
Last updated
.
Post not yet marked as solved
0 Replies
414 Views
I have the following requirement for my project: The app localization is currently based on static string JSON files. However, I would like to dynamically update strings upon an API call. Is it possible to update the resource files mentioned above after receiving a response from the API? If not, can I create a custom bundle to store new translations? Additionally, where should I create the custom bundle, specifying the path or location?
Posted
by AJNEV.
Last updated
.