Localization

RSS for tag

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

Localization Documentation

Posts under Localization tag

137 Posts
Sort by:
Post not yet marked as solved
9 Replies
6.4k Views
I have multiple targets in my app: targetA and targetB. Whenever i "Export For Localization", the .xliff generated will cointain translations for:1) Main.storyboard2) targetA/InfoPlist.strings3) targetB/InfoPlist.strings4) targetA/Localizable.strings5) targetB/Localizable.stringsI want to avoid multiple Localizable.strings, and multiple InfoPlist.strings. We do not need one localization per target.Any way i can force the "Export For Localization", to create a .xliff that only contains one Localizable.strings and one InfoPlist.strings?
Posted
by
Post marked as solved
3 Replies
7.6k Views
In the most recent submission of my React Native iOS app to Appstore Connect, I recieved the following notification via email from Appstore Connect:Dear Developer,We identified one or more issues with a recent delivery for your app, "eSELFSERVE". Your delivery was successful, but you may wish to correct the following issues in your next delivery:Invalid value for purpose string - The value 'NSLocationAlwaysUsageDescription' for Info.plist NSLocationAlwaysUsageDescription is not allowed. Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSLocationAlwaysUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data.After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to App Store Connect.Best regards,The App Store TeamThey seem like contradictory errors and I am not sure how to solve them. Here is a fragment from my MyProject/Info.plist:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> ... <key>NSLocationUsageDescription</key> <string>NSLocationUsageDescription</string> <key>NSLocationAlwaysUsageDescription</key> <string>NSLocationAlwaysUsageDescription</string> <key>NSLocationWhenInUseUsageDescription</key> <string>NSLocationWhenInUseUsageDescription</string> ... </dict> </plist>Here is a fragment from en.lproj/InfoPlist.strings:... NSLocationUsageDescription = "This app records your location when clocking in and out. Clocking in through this app may be rejected if location information is not provided."; NSLocationWhenInUseUsageDescription = "This app records your location when clocking in and out. Clocking in through this app may be rejected if location information is not provided."; NSLocationAlwaysUsageDescription = "This app records your location from time to time to expedite clocking in and out. Clocking in through this app may be rejected if location information is not provided."; ...Here is a fragment es.lproj/InfoPlist.stings:... NSLocationUsageDescription = "Esta aplicación registra su ubicación cuando entra y sale. Entrando usando esta aplicación puede ser rechazado si no se proporciona información de ubicación."; NSLocationWhenInUseUsageDescription = "Esta aplicación registra su ubicación cuando entra y sale. Entrando usando esta aplicación puede ser rechazado si no se proporciona información de ubicación."; NSLocationAlwaysUsageDescription = "Esta aplicación registra su ubicación de vez en cuando para agilizar el registro de entrada y salida. Entrando usando esta aplicación puede ser rechazado si no se proporciona información de ubicación."; ...I am also using the geolocation module of React Native 0.59.1.
Posted
by
Post not yet marked as solved
5 Replies
4.5k Views
The new (2020) App Store Connect seems to have a bug which prevents changing the primary language of an app. I am familiar with the process, as I have changed the primary language of apps just prior to the 2020 App Store Connect update. To change the primary language, you must first manually add screenshots for the language that you want to be primary, and they must be approved for the App Store, you can normally then change the primary language for the app in the next update afterwards. While I now have the drop-down menu for the primary language, (in the past this indicates that the screenshot requirements are met) selecting the new language now produces an error: You must first provide all the required screenshots for each version in this language I am 100% certain that all screenshots are provided for the language on all platforms. I have been through this process for other apps shortly before the update. In my case, all required screenshots for iPhone, iPad and Apple Watch. None of the screenshots are being derived from another localization’s screenshots. However, I notice that the media manager in the new 2020 App Store Connect, doesn't allow you to un-check or disable deriving screenshots for platforms that you're not submitting screenshots for. In my case, my app is not an iMessage app, but the media manager is deriving iMessage screenshots (none) from the old primary language. I guess this is causing the bug, because my (0) iMessage screenshots are still being derived from the old primary language. I have just submitted a new update with dummy iMessage screenshots for each localization, however I suspect it will be rejected because it's not an iMessage app. Has anybody else managed to get around this issue, or is someone from support able to help? I contacted Apple Developer Support with a detailed explanation, but they simply replied with the normal instructions for changing the language, which does not address the actual issue I described.
Posted
by
Post marked as solved
2 Replies
2.1k Views
I am writing a keyboard-extension, there are several buttons and these buttons have a text, therefor I am using localized strings. So the extension is always in the "correct" language. When opening the keyboard-extension with the "world"-button (pressing it long, so that the menu is shown) there is always a line below the name of the app showing "English". As far as I know this is the primary language, there is also one entry for "PrimaryLanguage" in the info.plist (NSExtension/NSExtensionAttributes, set to "en-US"). I tried to remove this entry, but after this the app does not start anymore. Is there a different way to remove this entry or is it possible to change it to the language of the localization?
Posted
by
Post not yet marked as solved
4 Replies
1.3k Views
I recently added a new language to my app and I have an issue regarding the localization. Configuration: I have the developmentRegion in "fr" and setup 2 localizations: "French: Development language" and "Danish" The goal is to have the application in Danish language if the preferred language is Danish and French otherwise. Issue: If French or Danish appear in my preferred languages, I have no problem. But if neither French nor Danish was set as preferred language (like only English), I have the app translation in French as expected but all strings regarding app permission like "NSLocationWhenInUseUsageDescription" in system modal alert are in Danish. Is like the localizable.strings file used is in the "fr.lproj" and the InfoPlist.strings is the "da.lproj" debug I verify I have all the strings files at the right repository. I have: fr.lproj -- Localizable.strings -- InfoPlist.strings da.lproj -- Localizable.strings -- InfoPlist.strings I verify the file architecture in the .app file: find ***.app -name "*.strings" ***.app/fr.lproj/InfoPlist.strings ***.app/da.lproj/InfoPlist.strings ***.app/fr.lproj/Localizable.strings ***.app/da.lproj/Localizable.strings Finally I print the Bundle.main.localizedInfoDictionary and I have values of the French file but the application show the Danish ones Thanks for the help.
Posted
by
Post not yet marked as solved
2 Replies
2.4k Views
In regular projects, there is an "Export Localizations" option in the Product menu, but for Swift Packages, this is not available. Adding local Swift Packages as dependencies of a regular project and using Export Localizations on the regular project doesn't include the Localizable strings from the Packages' sources either. The command-line version (xcodebuild -exportLocalizations) has the same restrictions. Is there a way to export NSLocalizedString occurrences to an xliff for Swift Packages? Or are we supposed to do things manually for now?
Posted
by
Post not yet marked as solved
3 Replies
1.8k Views
Hi, I thought that with Exporting String with localization in all files but it didn't. It export all SwiftUI Text and Button Strings but thats it. I had a file where I have. String(localized: “Hello, world!”, comment: “Hello”) It is in project and it is passed to the view later. Tired in Beta 5 and RC Thanks
Posted
by
Post not yet marked as solved
2 Replies
968 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?
Post marked as solved
6 Replies
2.9k Views
I tried to build LocalizedKeyString using String's new Initializer. String(localized: "hello",locale: locale) When I change the language setting of the device, everything works as expected. However, when I try to get the string in a specific language using the specified Locale, I can only ever get the string in .current. String(localized: "hello",locale: Locale(identifier: "zh-cn"))     func getString(locale:Locale) -> String{          String(localized: "hello",locale: locale)     } If you change the display language of the project (or the language setting of the device), the text in Text is always displayed correctly. Text(getString(locale:.current)) However, the code in onAppear print(getString(locale:Locale(identifier: "zh-cn"))) It only displays the same content as Text, but not the specified Chinese. Is it my fault that the new Initializer The understanding is not correct, or the bug of String init(localized keyAndValue: String.LocalizationValue, table: String? = nil, bundle: Bundle? = nil, locale: Locale = .current, comment: StaticString? = nil) FB number: FB9675845
Posted
by
Post not yet marked as solved
5 Replies
1.6k Views
I have two call directory extensions, each with InfoPlist.strings in en.lproj and nb.lproj directories. In these files I've defined CFBundleDisplayName for both locales. These names are displayed under Settings -> Phone -> Call Blocking & Identification. On iOS 12.2 the names are displayed correctly in both Norwegian and English. Testing on iOS 15.3 the English names are displayed even when device language is set to Norwegian. Worth noting: When updating the English versions of CFBundleDisplayName this is immediately reflected in Call Blocking & Identification page with Norwegian device language. As this feature requires a real device, I'm unable to test on iOS 13 and 14.
Posted
by
Post not yet marked as solved
1 Replies
1.3k Views
iOS16 lists supporting pinyin for Shanghainese and Sichuanese pharase. Aswell as now supporting a phonetic input method for Cantonese. Does anyone know how this function works, I have had no success in using Shanghai romanization or Sichuanese pinyin: Keyboard still produces only Standard Written Chinese (Mandarin) output. Further enhabling this under -Settings/General/Keyboard/Pinyin/Regional Dialect shows "Support for typing words with the selected dialect will download when connected to Wi-Fi" despite having been so. Any one know anything about this?
Posted
by
Post marked as solved
3 Replies
2k Views
I have a full screen list and want to use the new keyboardLayoutGuide constraint, but by default it uses the safe area inset. How can I disable this so my list goes all the way to the bottom of the screen when the keyboard is not shown? NSLayoutConstraint.activate([ collectionView.topAnchor.constraint(equalTo: view.topAnchor), collectionView.bottomAnchor.constraint(equalTo: view.keyboardLayoutGuide.topAnchor), collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor), collectionView.trailingAnchor.constraint(equalTo:  view.trailingAnchor) ])
Posted
by
Post not yet marked as solved
4 Replies
2.4k Views
I am working on an app that pulls data from weatherKit, including the conditionCode property, the content of which is displayed to the user. I wish to localize the data pulled from weatherKit but when pulling data from: weatherkit.apple.com/api/v1/weather/de/{latitude}/{longitude} The conditionCode and other strings is in english. Same is true if the language parameter is set to es, ja or something else. Am I doing something wrong or is localization yet to be supported in weatherKit? I can't find any documentation on this.
Posted
by
Post not yet marked as solved
2 Replies
1.1k Views
Before iOS 16.1 my app was woking good, if the user set the app language to other language than his device language, my app, widget + extensions all use this language... After iOS 16.1 if user set the app language to other language than his device language, my app works with this language but the widget + extensions works with the device language, not my app language... For Example:     @Environment(\.locale.languageCode) private var userLocal before iOS 16.1 userLocal would be the app local, after iOS 16.1 it return the device local Any idea why Apple did that? is this a bug? How to set the widget language to match my app language now? even set .environment(\.locale, dose not work when use Strings(table: because it's still get the bundle that match device language.
Posted
by
Post not yet marked as solved
6 Replies
2.1k Views
I have added additional localizations into my iOS app. iOS is not available in those languages. So I did as it is suggested that you redirect customers to app settings view UIApplication.openSettingsURLString and there they can select another app language. Unfortunately they do not see language selection if they do not have set at least 2 Preferred languages in General -> Languages & Region. Also it does not matter what languages they have there. If my app does not support those then it still shows all localizations available. Is there somehow to force it? So it would be visible always? Since most people in my country have iPhones only in English but would like to use Apps in their native language.. Since they do not have 2 preferred languages they cant see the selection :(
Posted
by
Post not yet marked as solved
3 Replies
908 Views
Based on these Swift docs and this forum thread, keyboard shortcuts / key equivalents are expected to be declared based on a US English layout. As an application developer, you may then rely on the auto localization provided by allowsAutomaticKeyEquivalentLocalization, (for menus) or localize your key equivalents manually (menus and other controls with key equivalents). But how does AppKit handle non localized key equivalents when faced with a non-US English keyboard layout? In particular, with a Hebrew layout active, the C key unmodified produces "ב", but when modified with ⌘ produces "c". Does AppKit compare the key equivalent ⌘c to the modified or un-modified char of the event, or both? Or is there more to this logic? E.g. does it also try to match the incoming event against a US-English layout, even if not active at the moment? The use-case here is implementing performKeyEquivalent for a custom control, where the documentation says: You should extract the characters for a key equivalent using the NSEvent method charactersIgnoringModifiers. So would simply comparing the event modifiers to the key equvialent modifers, and the event charactersIgnoringModifiers to the key equivalent give similar behavior to AppKit's own logic, e.g. in [NSEvent _matchesKeyEquivalent:modifierMask:]? Based on the observed behavior when pressing ⌘c with a Hebrew layout active, it does trigger an NSButton with a key equivalent of ⌘c, which doesn't seem to match the documented behavior of using the unmodified chars ("ב") as basis.
Posted
by
Post not yet marked as solved
1 Replies
705 Views
As a classical Arabic, student, learning the Arabic lanaguage, using the English keyboard is a big part of our journey. I hope Apple, can add a keyboard that is English(Arabic), because using the English alphabet is a big part of us students, learning the foreign language for pronunciation and writting/reading skills. Thankyou for considering!
Posted
by
Post not yet marked as solved
1 Replies
587 Views
Much of the WWDC content (understandably so) covers how to use localized strings in code but a piece of the puzzle that's missing for me is the exported and imported .xcloc files. How do translators use and modify an exported xcloc file to provide translations? Is there a popular 3rd party software for this step?
Posted
by