Internationalization

RSS for tag

Make your app available to an international audience by adapting it to multiple languages, regions, and cultures.

Posts under Internationalization tag

144 Posts

Post

Replies

Boosts

Views

Activity

WeatherKit localization options
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.
4
0
3.5k
Jan ’24
`DateIntervalFormatter` only produces 12 hour strings, not producing 24 hour strings
let formatter = DateIntervalFormatter() formatter.dateStyle = .none formatter.timeStyle = .none formatter.dateTemplate = "EEEjm" Produces, in my locale and on my device with 24 hour time on: "Tue, 6:39 – 7:10 pm" I was expecting: "Tue, 18:39 – 19:10" Other date formatters are showing 24 hour time using the j symbol. For example: let formatter = DateFormatter() formatter.dateStyle = .none formatter.timeStyle = .none formatter.setLocalizedDateFormatFromTemplate("EEEjm") Produces, for the start and end dates: Tue 18:39 Tue 19:10 Further, NSDateIntervalFormatter.h suggests I should be able to use symbols like j. So why can't I create strings in 24 hour time with DateIntervalFormatter? Thanks for your time. iOS 16.7.1 / Xcode 15
1
0
783
Jan ’24
Serbian language fallback
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?
3
0
1.1k
Dec ’23
Seeing "Cannot use inflection engine" in console.
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.
2
0
1.5k
Dec ’23
Dynamic Localization in iOS
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?
0
0
813
Nov ’23
DateComponentFormatter behaviour inconsistency
I noticed the output when running the following on different mac dev machines. Anyone know more detail on this? let formatter = DateComponentsFormatter() formatter.allowedUnits = [.hour, .minute, .second] formatter.unitsStyle = .brief the output changed from 233hr 55min 35secs to 233hrs 55min 35secs on another machine, the output is 233hrs 55min. 35secs. Thanks in advance!
1
0
849
Nov ’23
ITMS-90176: Unrecognized Locale
Our application should support locales for Albanian and Albanian(Kosovo). Xcode creates sq.lproj and sq-XK.lproj folders accordingly Everything works fine in xcode, but if we upload to appstore we always see this warning. I tried specifying other names for sq-XK to match https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html aln, sq-RS, sq-KV, sq-KS, sq-Latn-XQ. The varning was always present. Is there any way to get rid of it? WARNING ITMS-90176: "Unrecognized Locale - The locale used in localization directories at ("Payload/{AppName}.app/base.lproj") are invalid. iTunes supports BCP47 but not the UN M.49 specification. Refer to the Language and Locale Designations guide for more information on naming your language-specific directories."
5
1
1.8k
Nov ’23
Can non-Apple apps use user preferred term of address?
Hello folks! I am looking into how to personalize my app based on iPhone user preferred term of address using TermOfAddress API (1, 2). If I understand correctly, to use the API for personalization purposes the app should know user's selection (masculine, feminine, neuter). What I don't understand is whether there is an API allowing to get user term of address which they set in their iPhone settings for 3P apps. So the flow I am thinking of is: User sets their preferred term of address in device settings My app somehow is able to retrieve it and use TermsOfAddress concept to serve proper message in Spanish ("Bienvenido a mi aplicación!" for masculine vs "Bienvenida a mi aplicación!" for feminine vs "Les doy la bienvenida a mi aplicación" for neutral). Apple support docs say "Your preferred form of address. (Choose feminine, masculine, or neutral. Turn on Share with All Apps so all apps personalize how they address you. Available for some primary languages, for example, Spanish.)". So I assume that there is a way for apps to retrieve this information. But I can't find any API for that. Any thoughts on this? I wonder if "Share with all apps" means "Share with all 1P apps" and 3P apps can not use it (which means I have to ask user for their term of address from my app)? Thanks!
1
0
759
Oct ’23
NumberFormatter unable to parse string output that it created
I'm currently adding support for different locales in my app, and one of the things I need to do is let folks input a valid decimal number. In order to do this I'm using a NumberFormatter with some specific settings: numberFormatter.locale = .current numberFormatter.maximumFractionDigits = 2 numberFormatter.minimumFractionDigits = 2 numberFormatter.numberStyle = .decimal numberFormatter.roundingMode = .halfEven numberFormatter.usesGroupingSeparator = true When the locale is set to en-GB or en-US, everything works fine. I'm successfully able to output values as strings, and then use the same number formatter to parse the string back into an NSNumber. However, if the locale is for a region where spaces are used as a grouping separator, everything breaks. The number formatter will happily output a value like 1 234.56 via string(from:), but it will fail to parse that exact string as a number using number(from:). After digging a bit deeper I discovered that, if I create a locale that uses spaces as the grouping separator and check: numberFormatter.groupingSeparator The output will be a 0x202f character (NARROW NO-BREAK SPACE). If I use that same number formatter to output a string value, the space it inserts in 1 000,00 is actually 0xa0. I think this is why the number formatter's output can't be parsed as valid input, but I'm not sure how to work around this situation. I ideally need to be able to parse "prettified" values that users have entered in their own locale, so I can't just set the number formatter to always use , as the grouping separator for example. Any advice would be much appreciated!
1
0
1.1k
Oct ’23
Make my app findable on search results
Hi all, My app is available in English and Arabic. However, when searching for the app in iOS App Store, by typing the app name in Arabic, it does not show up in the suggested apps. This occurs in English but also Arabic phone/app configuration. On the other hand, on Android I don't have this issue. Do you know what to do to fix this? We have already added the app name in the AR app store keywords / description, but it did not help as it's still not showing up. Thank you
3
0
817
Oct ’23
Key equivalent matching for non-Roman layouts
What's the right way to implement key equivalent matching that handles non-Roman/Latin layouts? E.g. pressing Cmd+Option+C in a Greek layout produces an NSEvent with chars="ç" unmodchars="ψ", neither of which is going to match a key equivalent of Cmd+Option+C by simile comparison, yet performKeyEquivalent on a button with that exact key equivalent returns YES and activates the button. How would someone replicate that? [NSEvent charactersByApplyingModifiers:] also reports "ç", and so does UCKeyTranslate. Yet the Keyboard Viewer shows a modifier layer with "c", not the "ç" that the event reports:
0
0
898
Oct ’23
Punctuation missing from system font when Chinese language is selected
Dear experts, I get glyphs from the system font using CTFontGetGlyphsForCharacters, something like this: UIFont* uifont = [UIFont monospacedDigitSystemFontOfSize: s weight: w]; CTFontRef font = (__bridge CTFontRef)uifont; CTFontGetGlyphsForCharacters(font, ....); The characters that I ask for are basically latin-1 plus a few others. The app is not localised for Chinese. When I change the phone's default language to Chinese, this code gets glyphs for most characters OK but it fails for a few punctuation symbols: 91 = [ 93 = ] 183 = middle dot 8220 = left double curly quote 8221 = right double curly quote Can anyone guess what's going on here? What's special about those characters? Thanks, Phil.
0
0
881
Sep ’23
Separate App versions per region
Due to our app having different government clearances in each geographical region, we are required to have a different version in each region. While the apps are all fundamentally the same, is there any reason we can't have: OurApp US - available in US OurApp UK - available in UK only OurApp EU - available in EU only While I understand how to implement this, there is concern that the subsequent submissions might be flagged incorrectly by the 4.3 Spam rule. Users would never see more than one version of our app in their region's App Store. Does anyone have any knowledge or experience here? Is this kind of release strategy acceptable?
0
4
966
Sep ’23
How to ignore the safe area when using keyboardLayoutGuide
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) ])
3
1
4.2k
Aug ’23
Date and time getting fail to convert in 24 hour, after change format in 12 hour from device setting
I have been working on a Calendar App. i am getting date format 2023-08-25T7:07:00 pm which is not parsing in any date format. Required Output: 2023-08-25T19:07:00 Getting fail with all date formatter Here is the my code snippet let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd'T'hh:mm:ss a" dateFormatter.locale = Locale(identifier: "en_US_POSIX") dateFormatter.timeZone = TimeZone.current if let date = dateFormatter.date(from: dateString) { let formattedDateString = dateFormatter.string(from: date) print(formattedDateString) } else { print("Invalid date format") } Help me on this.
2
0
708
Aug ’23
Incorrect behavior in Date.FormatStyle
I just wasted quite a lot of time on this .. so in case somebody else checks in here, beware that the following: formatted(dateTime.hour(.defaultDigits(amPM: .omitted))) does, indeed omit AM/PM, but it doesn't change to using a 24 hour clock. Instead, hours cycle through 1...12 twice a day.
Replies
5
Boosts
0
Views
1.1k
Activity
Jan ’24
WeatherKit localization options
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.
Replies
4
Boosts
0
Views
3.5k
Activity
Jan ’24
Getting 24 hour time from Date
Does anyone have the format string to use to just get the 24 hour time (no am/pm) indicator from Date? I can't seem to get 24 hour time with: let now = Date() now.formatted(date:.omitted,time:.complete) // Or any of the time options.
Replies
5
Boosts
0
Views
1.1k
Activity
Jan ’24
`DateIntervalFormatter` only produces 12 hour strings, not producing 24 hour strings
let formatter = DateIntervalFormatter() formatter.dateStyle = .none formatter.timeStyle = .none formatter.dateTemplate = "EEEjm" Produces, in my locale and on my device with 24 hour time on: "Tue, 6:39 – 7:10 pm" I was expecting: "Tue, 18:39 – 19:10" Other date formatters are showing 24 hour time using the j symbol. For example: let formatter = DateFormatter() formatter.dateStyle = .none formatter.timeStyle = .none formatter.setLocalizedDateFormatFromTemplate("EEEjm") Produces, for the start and end dates: Tue 18:39 Tue 19:10 Further, NSDateIntervalFormatter.h suggests I should be able to use symbols like j. So why can't I create strings in 24 hour time with DateIntervalFormatter? Thanks for your time. iOS 16.7.1 / Xcode 15
Replies
1
Boosts
0
Views
783
Activity
Jan ’24
Serbian language fallback
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?
Replies
3
Boosts
0
Views
1.1k
Activity
Dec ’23
Seeing "Cannot use inflection engine" in console.
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.
Replies
2
Boosts
0
Views
1.5k
Activity
Dec ’23
Dynamic Localization in iOS
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?
Replies
0
Boosts
0
Views
813
Activity
Nov ’23
DateComponentFormatter behaviour inconsistency
I noticed the output when running the following on different mac dev machines. Anyone know more detail on this? let formatter = DateComponentsFormatter() formatter.allowedUnits = [.hour, .minute, .second] formatter.unitsStyle = .brief the output changed from 233hr 55min 35secs to 233hrs 55min 35secs on another machine, the output is 233hrs 55min. 35secs. Thanks in advance!
Replies
1
Boosts
0
Views
849
Activity
Nov ’23
ITMS-90176: Unrecognized Locale
Our application should support locales for Albanian and Albanian(Kosovo). Xcode creates sq.lproj and sq-XK.lproj folders accordingly Everything works fine in xcode, but if we upload to appstore we always see this warning. I tried specifying other names for sq-XK to match https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html aln, sq-RS, sq-KV, sq-KS, sq-Latn-XQ. The varning was always present. Is there any way to get rid of it? WARNING ITMS-90176: "Unrecognized Locale - The locale used in localization directories at ("Payload/{AppName}.app/base.lproj") are invalid. iTunes supports BCP47 but not the UN M.49 specification. Refer to the Language and Locale Designations guide for more information on naming your language-specific directories."
Replies
5
Boosts
1
Views
1.8k
Activity
Nov ’23
Can non-Apple apps use user preferred term of address?
Hello folks! I am looking into how to personalize my app based on iPhone user preferred term of address using TermOfAddress API (1, 2). If I understand correctly, to use the API for personalization purposes the app should know user's selection (masculine, feminine, neuter). What I don't understand is whether there is an API allowing to get user term of address which they set in their iPhone settings for 3P apps. So the flow I am thinking of is: User sets their preferred term of address in device settings My app somehow is able to retrieve it and use TermsOfAddress concept to serve proper message in Spanish ("Bienvenido a mi aplicación!" for masculine vs "Bienvenida a mi aplicación!" for feminine vs "Les doy la bienvenida a mi aplicación" for neutral). Apple support docs say "Your preferred form of address. (Choose feminine, masculine, or neutral. Turn on Share with All Apps so all apps personalize how they address you. Available for some primary languages, for example, Spanish.)". So I assume that there is a way for apps to retrieve this information. But I can't find any API for that. Any thoughts on this? I wonder if "Share with all apps" means "Share with all 1P apps" and 3P apps can not use it (which means I have to ask user for their term of address from my app)? Thanks!
Replies
1
Boosts
0
Views
759
Activity
Oct ’23
After setting the 12-hour clock, a different DateFormatter is provided.
Turn off 24-hour clock in settings DateFormatter When using HH format without setting Locale, it is provided in AA H format. Please explain why it works like this
Replies
1
Boosts
0
Views
785
Activity
Oct ’23
NumberFormatter unable to parse string output that it created
I'm currently adding support for different locales in my app, and one of the things I need to do is let folks input a valid decimal number. In order to do this I'm using a NumberFormatter with some specific settings: numberFormatter.locale = .current numberFormatter.maximumFractionDigits = 2 numberFormatter.minimumFractionDigits = 2 numberFormatter.numberStyle = .decimal numberFormatter.roundingMode = .halfEven numberFormatter.usesGroupingSeparator = true When the locale is set to en-GB or en-US, everything works fine. I'm successfully able to output values as strings, and then use the same number formatter to parse the string back into an NSNumber. However, if the locale is for a region where spaces are used as a grouping separator, everything breaks. The number formatter will happily output a value like 1 234.56 via string(from:), but it will fail to parse that exact string as a number using number(from:). After digging a bit deeper I discovered that, if I create a locale that uses spaces as the grouping separator and check: numberFormatter.groupingSeparator The output will be a 0x202f character (NARROW NO-BREAK SPACE). If I use that same number formatter to output a string value, the space it inserts in 1 000,00 is actually 0xa0. I think this is why the number formatter's output can't be parsed as valid input, but I'm not sure how to work around this situation. I ideally need to be able to parse "prettified" values that users have entered in their own locale, so I can't just set the number formatter to always use , as the grouping separator for example. Any advice would be much appreciated!
Replies
1
Boosts
0
Views
1.1k
Activity
Oct ’23
Make my app findable on search results
Hi all, My app is available in English and Arabic. However, when searching for the app in iOS App Store, by typing the app name in Arabic, it does not show up in the suggested apps. This occurs in English but also Arabic phone/app configuration. On the other hand, on Android I don't have this issue. Do you know what to do to fix this? We have already added the app name in the AR app store keywords / description, but it did not help as it's still not showing up. Thank you
Replies
3
Boosts
0
Views
817
Activity
Oct ’23
Key equivalent matching for non-Roman layouts
What's the right way to implement key equivalent matching that handles non-Roman/Latin layouts? E.g. pressing Cmd+Option+C in a Greek layout produces an NSEvent with chars="ç" unmodchars="ψ", neither of which is going to match a key equivalent of Cmd+Option+C by simile comparison, yet performKeyEquivalent on a button with that exact key equivalent returns YES and activates the button. How would someone replicate that? [NSEvent charactersByApplyingModifiers:] also reports "ç", and so does UCKeyTranslate. Yet the Keyboard Viewer shows a modifier layer with "c", not the "ç" that the event reports:
Replies
0
Boosts
0
Views
898
Activity
Oct ’23
What's the correct writing in RightToLeft languages
This simple text: Text("10'20\"") when the localisation is a RightToLeft, like Arabic on iMac show "20'10 on iOS show 10'20" Which is the correct one? Why the are different?
Replies
4
Boosts
0
Views
1k
Activity
Sep ’23
Punctuation missing from system font when Chinese language is selected
Dear experts, I get glyphs from the system font using CTFontGetGlyphsForCharacters, something like this: UIFont* uifont = [UIFont monospacedDigitSystemFontOfSize: s weight: w]; CTFontRef font = (__bridge CTFontRef)uifont; CTFontGetGlyphsForCharacters(font, ....); The characters that I ask for are basically latin-1 plus a few others. The app is not localised for Chinese. When I change the phone's default language to Chinese, this code gets glyphs for most characters OK but it fails for a few punctuation symbols: 91 = [ 93 = ] 183 = middle dot 8220 = left double curly quote 8221 = right double curly quote Can anyone guess what's going on here? What's special about those characters? Thanks, Phil.
Replies
0
Boosts
0
Views
881
Activity
Sep ’23
Separate App versions per region
Due to our app having different government clearances in each geographical region, we are required to have a different version in each region. While the apps are all fundamentally the same, is there any reason we can't have: OurApp US - available in US OurApp UK - available in UK only OurApp EU - available in EU only While I understand how to implement this, there is concern that the subsequent submissions might be flagged incorrectly by the 4.3 Spam rule. Users would never see more than one version of our app in their region's App Store. Does anyone have any knowledge or experience here? Is this kind of release strategy acceptable?
Replies
0
Boosts
4
Views
966
Activity
Sep ’23
Upload 2 version to to 2 different region
Hi I have an app in the store that distributed to 2 region(IL and AU) I want to push another app only to one region (IL) But, I want the old version stay in AU region How can I do it?
Replies
1
Boosts
0
Views
733
Activity
Sep ’23
How to ignore the safe area when using keyboardLayoutGuide
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) ])
Replies
3
Boosts
1
Views
4.2k
Activity
Aug ’23
Date and time getting fail to convert in 24 hour, after change format in 12 hour from device setting
I have been working on a Calendar App. i am getting date format 2023-08-25T7:07:00 pm which is not parsing in any date format. Required Output: 2023-08-25T19:07:00 Getting fail with all date formatter Here is the my code snippet let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd'T'hh:mm:ss a" dateFormatter.locale = Locale(identifier: "en_US_POSIX") dateFormatter.timeZone = TimeZone.current if let date = dateFormatter.date(from: dateString) { let formattedDateString = dateFormatter.string(from: date) print(formattedDateString) } else { print("Invalid date format") } Help me on this.
Replies
2
Boosts
0
Views
708
Activity
Aug ’23