4

I want to change language english keyboard to arabic so when i choose arabic language from container app . Alignment as well as cursor position should change in custom keyboard.

<key>NSExtension</key>
<dict>
    <key>NSExtensionAttributes</key>
    <dict>
        <key>IsASCIICapable</key>
        <false/>
        <key>PrefersRightToLeft</key>
        <false/>
        <key>PrimaryLanguage</key>
        <string>mul</string>
        <key>RequestsOpenAccess</key>
        <false/>
    </dict>

If I change in primary language in info.plist to “ar” then its working fine but i want to change at run time so both languages will work.

Or Is there any way to change cursor position in uiinputviewcontroller in keyboard class.

I am also trying to change primary language key by localized string for both languages but its not pick the arabic language localized string file.

Arabic keyboard display textalignment as left to right so this one is the issue.:https://i.stack.imgur.com/RtvDQ.png

Any Suggestion for this. Thanks.

1 Answers1

5

There is a property " primaryLanguage " of UIInputViewController which you can set runtime. e.g. Suppose in your keyboard extension project UIInputViewController subclass is KeyboardViewController then inside it set self.primaryLanguage = @"ar"

Ranvijay
  • 51
  • 1
  • 2