Localization

RSS for tag

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

Posts under Localization tag

99 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Reusing string catalog translations in swift packages
Setup I have 2 swift packages and I try to use stirng catalog to manage your localizations I would like to use some specific keys in these packages and some common ones (e.g. "ok_button_tittle") Problem statement I really don't like the idea of creating separate (but the same) translations in these packages I have tried using something like String( localized: "ok_button_title", table: "Localizable", bundle: .main, comment: "Ok button title" ) This does use translations from the main bundle, however this does not automatically create the keys in string catalog Question Is there any possibility to reuse the translations from the main bundle? Maybe there is a hack to make the keys appear automatically in the correct bundle? Or is it a bug?
0
0
92
1w
Accessibility Localization Questions
For practice, I have implemented accessibility labels and announcement in a very simple test app (All SwiftUI, all iOS 18). The app is not localized, default language is English. When running this on a German phone, odd things happen in the localization. My accessibility labels are read with an accent, but when they contain a url, the "dots" are read as the German "Punkt" (with an English Accent). When I am providing the same text as accessibility announcement, the same text (which is in English), is read with a German voice. I am also providing a Button with an "arrow.clockwise" image, and VoiceOver reads this, in an English Voice with "Refresh, Button". This is great and was to be expected. However, when the button is disabled, VoiceOver reads "Refresh, grau dargestellt, Button", all in an English Voice. Is this an error? Am I doing it wrong? The video at the link should show the issue https://share.icloud.com/photos/0757FJW2Q3fsA_cdhMX6ls46Q
2
0
499
3w
No localisation when I publish in TestFlight
Hello, I need an help. It's my first application and publishing. I developed my application in 2 languages, English by default and French. In the simulator or on 1 device via Xcode, everything works. In Xcode everything seems good. 2 languages in project info and my App Target in Target membership 2 languages in Localizable.xcstrings and green Localizable.xcstrings added in Target / Build Phase / Copy Bundle Resources I also tried to add in my app.plist CFBundleLocalizations en fr In App Store Connected both languages declared, also in Testflight. But...nothing, when I install the application thought TestFlight, no language. The application showing the label coded in swift. I found only one relevant post but not working for me. What am I missing. Thanks in advance for any help.
0
0
177
Nov ’24
Bundle.main.preferredLocalizations vs. Locale.preferredLanguages vs. "AppleLanguages"
On iOS Bundle.main.preferredLocalizations returns the list of languages the application bundle supports in user-preferred order with the first element being the language the application is running in. Additionally Locale.preferredLanguages returns the list of languages in the order they are presented in Preferences.app > General > Language & Region > Preferred Languages with the first element being the user's "primary language" (i.e. the language the system is running in). However this only seems to be true unless the user has chosen a per-app language which is different from the primary language in which case Locale.preferredLanguages.first is equal to Bundle.main.preferredLocalizations.first - regardless of the latter's position in the Preferred Languages list. Furthermore this seems to change depending on the value of the "AppleLanguages" key in the User Defaults' global domain (see c.f. https://stackoverflow.com/a/42648166). Is this behaviour documented anywhere? Addendum: I know that according to https://forums.developer.apple.com/forums/thread/718512?answerId=733680022#733680022 AppleLanguages is an implementation detail, not something that’s considered API. Locale.preferredLanguages is API, though.
0
0
182
4w
How to Set Azerbaijani as Default Language for My App?
Hi everyone, I’m facing an issue with setting Azerbaijani as the default language for my app. The app is designed specifically for the Azerbaijani market, where the primary language is Azerbaijani, although Russian is also widely spoken. During the submission process, I couldn’t find an option to set Azerbaijani as the default language. To move forward, I selected Russian, assuming I could change it later. However, I’ve hit a roadblock—I can’t figure out how to make Azerbaijani the default language now. Has anyone else encountered this problem? Is there a workaround or solution to enable Azerbaijani as the default language? I’d greatly appreciate any advice or guidance from the community. Thanks in advance!
1
0
188
3w
Parametrized Shortcuts do not show up in Shortcuts app and search with localisation.
Hi! When my device is set to English, both search and the Shortcuts up automatically show multiple shortcuts parametrised for each value of the AppEnum - which is what I expected. When my device is set to German, I get only the basic AppShortcut without the (optional) parameter. I am using an AppEnum (see below) for the parametrised phrases and localise the phrases into German with an AppShortcuts String Catalog added to my project. Everything else seems to work, I can use my AppShortcut in the Shortcuts app and invoke it via Siri in both English and German. The Shortcuts app displays the values correctly using the localized strings. Any ideas? import AppIntents class ApolloShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: GetIntent(), phrases: [ "Get data from \(.applicationName)", "Get data from \(.applicationName) for \(\.$day)", "Get data from \(.applicationName) for the \(\.$day)" ], shortTitle: "Get Data", systemImageName: "wand.and.sparkles") } } enum ForecastDays: String, AppEnum { static var typeDisplayRepresentation: TypeDisplayRepresentation = "Day" static var caseDisplayRepresentations: [Self : DisplayRepresentation] = [ .today: DisplayRepresentation(title: LocalizedStringResource("today", table: "Days")), .tomorrow: DisplayRepresentation(title: LocalizedStringResource("tomorrow", table: "Days")), .dayAfterTomorrow: DisplayRepresentation(title: LocalizedStringResource("dayAfterTomorrow", table: "Days")) ] case today case tomorrow case dayAfterTomorrow var displayName: String { String(localized: .init(rawValue), table: "Days") } }
1
0
198
Nov ’24
Testing Right-to-Left localization in a macOS app
I’m currently trying to localize one of my Mac apps for Right-to-Left languages. In Xcode, to test this, I set the language to ‘Arabic’ in the scheme, which then displays the language and mirrors the layout accordingly. I have two questions about this: macOS titlebar buttons: In the title bar at the top, shouldn’t the Close and Minimize buttons also be on the right side (mirrored)? How can I test this? Numerals: My UI still displays Latin numerals (123). I know this is correct in some Arabic-speaking regions, but I’d also like to test cases where Arabic-Indic numerals (١٢٣) are used. Is there a way to configure the scheme to test this?
2
0
229
Nov ’24
How to localize permission description string?
What's the problem? My app requests location access and for that I need to provide a description for the user to read so that it is clear why we need this permission. I'm using the latest solution suggested by XCode for my app localization which is using Localizable.xcstrings file. But for the permission description, I'm adding the text to Targets -> Info -> Custom iOS Target Properties -> "Privacy - Location Always and When In Use Usage Description". I understand that the default language is English in this list so I provided it, but now I want this description to be translated to other languages so that my users can read it in their preferred language. What I have tried so far? I tried adding translation to the keys "INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription" and "NSLocationAlwaysAndWhenInUseUsageDescription" in my "Localizable.xcstrings" but it is always showing the description in English
2
0
234
Nov ’24
Label cannot export localized string key
Hello all. This is my code snippet. RecordListView() .tabItem { Label("Record List", systemImage: "list.clipboard") } .tag(Tab.RecordList) When I export localizations, there is no Record List in the .xcloc file. Then I use LocalizedStringKey for Label and export localizations file, the code is as follows: let RecordsString:LocalizedStringKey = "Tab.Records" RecordListView() .tabItem { Label(RecordsString, systemImage: "list.clipboard") } .tag(Tab.RecordList) There is still no Tab.Records.
2
0
383
Nov ’24
VoiceOver: Detect Languages
My app does not automatically switch languages (voices) in VoiceOver when I have VoiceOver on and the screen includes both English and Spanish content. Instead of switching between the correctly accented voice, whatever my manual Voices rotor setting is, that's what the content is announced as. I can manually switch the Voice in the rotor to make words sound inteligible but my main concern is that language changes are not auto-detected even though that feature in my Settings is on. VO does detect language changes in other apps, so I think there must be either misplaced or missing accessibiiltyLanguage strings somewhere in my app. Or is it more than that for localization considerations? I reached out to the Apple Accessibilty team and was directed to open a ticket here, as my question is about the underlying code. I am a novice developer and primarily accessibility SME; i expect that wnen "detect languages" is on in the user settings for VoiceOver, that the voice for the screen reader speech output will automatically switch to the correct language / accent. I recognize there is a problem but am not sure where the breakdown is. I would like guidance how to fix it to relay to my teams. https://developer.apple.com/documentation/objectivec/nsobject/1615192-accessibilitylanguage
1
0
367
Nov ’24
没法删除语言
只能在string catalog里面添加语言,不能删除语言??这是什么设计? 在Project里面删除语言,并不能删除Localizable中的语言。但是如果这个语言没有任何国际化,是可以的。 也就是说,删不了曾经做过国际化的语言。 我应用还没发布,还在开发呢,为什么不让我删除语言??????????????????????????、
1
0
158
Nov ’24
How to remove language in string catalog?
I have a Localizable file under Assets. I can add a language by click the + button. But I can't remove it then??!! Remove a localization in project -> info does not work. If the localization contains some translation, it still remains in the catalog (works if not translated at all). As a result, your app will not show the default localization at all.
0
0
162
Nov ’24
Calendar integers in english and alphabets in arabic
we are migrating our app to support Arabic language support but the requirement is we want the calendar/date object to display as missed. That is all the numbers in english digits and rest all the words like days, months should be in Arabic. I tried few options but at the end its resulting everything is in Arabic or in English but not the mixed as expected. Attaching the expected behavior.
2
0
297
Nov ’24
XCode 16 crash on commit - SourceEditorDataSource.contentRangeForLineRange(_:) + 244
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.
1
0
357
Oct ’24
Cannot remove languages from Swift string catalog
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)
0
0
253
Oct ’24
Localizing CFBundleDisplayName based on specific region
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...
1
0
339
1w
App Store localization fallbacks
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.
1
0
424
Oct ’24