I have a macOS application with a minimum version of macOS 12.0. I need to be able to get the current keyboard region designator.
Example: The user selects a input source of English Canadian. What I want as a result of this fact is en-CA locale identifier.
I get the current keyboard language with the following code
func keyboardLanguage() -> String?{
let keyboard = TISCopyCurrentKeyboardInputSource().takeRetainedValue()
let languagesPtr = TISGetInputSourceProperty(keyboard, kTISPropertyInputSourceLanguages)!
let languages = Unmanaged<AnyObject>.fromOpaque(languagesPtr).takeUnretainedValue() as? [String]
return languages?.first
}
This returns the language as en, but I don't see how I can get the region from Text Input Sources. I can get the input source id
let keyboard = TISCopyCurrentKeyboardInputSource().takeRetainedValue()
let idPtr = TISGetInputSourceProperty(keyboard, kTISPropertyInputSourceID)!
let id = Unmanaged<AnyObject>.fromOpaque(idPtr).takeUnretainedValue() as? String
print(String(describing: id))
This prints com.apple.keylayout.Canadian which points to the Canadian region but is not a region designator. I can possible parse this id and map it to a region designator but first I'm not sure if I will capture all of the regions and secondly what happens if the format of the id changes? If someone can point to the correct API to use it will be much appreciated.
Internationalization
RSS for tagMake your app available to an international audience by adapting it to multiple languages, regions, and cultures.
Posts under Internationalization tag
27 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
My app is only available in some regions.
During one of the review versions, the reviewer asked to remove accessibility from one of the countries or provide documents that allow to conduct activities in this country.
At that time, there was no such document and I removed the availability in this country.
Now - I have a document that confirms that I can conduct activities in this country. Availability is a separate section and is not related to versioning.
How and where do I request app availability in a specific country?
I am developing a web application that works on webview.
From iOS 13, users could set a specific language for each individual app, and every webview-based application knew the application language through navigator.language.
However, in iOS 17.4, this API returns the system language instead of the individual app's language in web applications.
Is this an official change in iOS 17.4 or a bug?
I have encountered inconsistent paste behaviors in UITextView depending on whether the text is in English or Korean.
When pasting at the beginning of a text with an English sentence in UITextView, a space is added after the pasted text. In the middle, spaces are added before and after the pasted text. However, when pasting at the end, only a space is added before the pasted text.
On the other hand, when there is a Korean sentence in UITextView, pasting at the beginning results in the inclusion of "\n" at the beginning of the pasted text, while in other cases, no additional text is added upon pasting.
I'm curious to know if this behavior is intentional. I would appreciate understanding the rationale behind appending "\n" in Korean text and the absence of additional text in other cases.
Application:
HTML,Javascript,Angular web Application
Issue:
In Iphone/Ipad while trying to enter English characters using Japanese keyboard in the input field
the japanese keyboard freezes and stops working after entering the first character.
Root Cause:
Two validations given in the onInput call back method causes the issue.
when the validation are removed keyboard is working fine
1.for converting lowercase letters to uppercase
2.Some Character are not allowed so they are replaced after input
My App development language is only Arabic. I am using textField to Login User, whenever user long pressed, ToolTip showed up. Problem is with tool tip text it is flipped. My device language is English
I have built an iOS keyboard extension, before it is installed the system prefered language is "English" like so:
After installing the keyboard extension the system language is set to "Corsican", like so:
Corsican is being set because the bundle identifiers start with co. which maps to the ISO 639-1 language code for Corsican co. I've verified that my PrimaryLanguage is en-US, see below a section of Info.Plist. I've verified the bundle ID is the root cause by changing the bundle ID to something not starting with co and this behaviour disappears.
...
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>IsASCIICapable</key>
<false/>
<key>PrefersRightToLeft</key>
<false/>
<key>PrimaryLanguage</key>
<string>en-US</string>
<key>RequestsOpenAccess</key>
<false/>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.keyboard-service</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).KeyboardViewController</string>
</dict>
...
This seems like a bug in iOS. Any suggestions what to try?