IOS: VoiceOver changes to English in WebView - ios

I'm adding VoiceOver support to an app which at the moment only supports Norwegian. For most of the app VoiceOver correctly reads the text as Norwegian.
However, one page contains a webview which shows the terms and conditions (downloaded from a URL). For this page VoiceOver switches to English voice, even though this text is still in Norwegian.
I've tried to set accessibilityLanguage to "nb-NO" for both the webview and the containing viewcontroller but the text is still read as English. Do anyone know how I can make the webview be read in Norwegian?

Consider adopting the lang HTML attribute. This will trigger VoiceOver to generate speech in the appropriate language. Hat tip to Adrian Roselli for the suggestion.

Trying adding HTML lang="" attribute in your page. you can refer below url http://www.iana.org/assignments/language-subtag-registry for more specific value for lang attribute.
Hope this will help

Related

VoiceOver on iOS reads our widget using english voice

We have newly created a Widget using WidgetKit for our app. The widget is localized in Norwegian and English, and localization works for the texts in the widget, the correct text is used based on what language set for the iPhone.
But when I turn on VoiceOver, the voice pronounces the words in English, even if the phone is set to Norwegian, and Norwegian texts is shown in the widget.
I find it wierd that the localization works, but that VoiceOver doesnt understand to read it in Norwegian. I tested other widgets, and there VoiceOver pronounces the words in Norwegian. This also works fine in our main app.
Have anybody experienced this before? Anybody have a clue to what we need to change in the widget to get it working properly?
I found the answer. I just needed to add a InfoPlist.strings file in the widget and localize it (in Norwegian and English in our case). We have no strings in Info.plist that needs translation, so the InfoPlist.strings file have no content. But I guess iOS needs it to be in place to understand what languages to support for VoiceOver.

iOS - Internationalisation and Localization

Is it possible to change App language on Button tap ? I'm developing an App which should support multi languages and inside the App, there is option to choose the language (in the form of button). By default, App placeholder text will be in English, once the user choose some other language, placeholder text should change as per the language selected. I have gone through few examples in Internet, i couldn't find anything close to my requirement. I have seen example from appcoda and ray, but switching the language within the app is not provided. can somebody tell me how to achieve this ?
Thanks,
Pradeep

IOS: Text Selection in WKWebView (WKSelectionGranularityCharacter)

I've got an app that uses a web view where text can be selected. It's long been an annoyance that you can't select text across a block boundary in UIWebView. WKWebView seems to fix this with a property on its configuration: selectionGranularity. One of the possible values is WKSelectionGranularityCharacter:
Selection endpoints can be placed at any character boundary.
Sounds great! Exactly what I need. Except that when I set that in my web view, I often can no longer select text at all. What is going on? Is there something else I need to set? Has anyone figured this out?
Update: I've figured out the following bugs:
When there is more than one WKWebView in an app with selectionGranularity set to WKSelectionGranularityCharacter, only the most recent one to load can select text. I've filed this as bug 18441138.
If there is a click handler attached to an element inside the body in the HTML content of a WKWebView whose selectionGranularity is set to WKSelectionGranularityCharacter, text selection doesn't work inside that element. I've filed this as bug 18440833.
Text selection fails in the WKWebView after you've entered edit mode on a UITextView somewhere else in the app until the WKWebView reloads. I've filed this as bug 18468405.
Has anyone worked around any of these?
These and other issues are all fixed as of iOS 13.
There are several known bugs that are still not fixed.
You can execute JavaScript to get selected text as a workaround.
window.getSelection().toString()
Docs

iTextSharp - Pre filled Chinese characters in PDF do not come visible until textfield is focused

I am creating PDF with pre filled values in Chinese but when opening the PDF all the textfields containing Chinese text are empty. When focusing a textfield the Chinese text comes visible but is hided again when unfocusing the field. What could be the issue?
Please share some more info, as there could be more than one reason why the appearances aren't generated by iText.
A. The first reason is explained in the StackOverflow question "AcroForm values missing after flattening". In this case, the PDF contains a parameter that instructs iText not to generate appearances, which would explain why you don't see any value up until you click the field, in which case the viewer will create them.
B. The second reason is explained in section 8.3.3 (entitled "Text fields and fonts") of my book. In this case, the parameter in the PDF doesn't prevent the creation of field appearances, but iText fails to do so because you're not providing a font that knows how to display the Chinese characters.
See for instance figure 8.3 and 8.4 of the book.
In figure 8.3, you see that Chinese text isn't displayed in the upper window. By fixing the form (using two different strategies), the Chinese text appears in the lower two windows. Note that the Chinese text won't appear in all viewers in the case of the middle window.
In figure 8.4, you see that Korean text isn't displayed in the upper window, nor in the third window. In all other windows, different strategies were used to fix this problem:
It would lead us too far to discuss all the different strategies in an answer on SO. Instead, please take a look at the TextFontFields example (for the C# version, please take a look at the ported examples). My guess is that you'll benefit most from the AddSubstitutionFont() method, provided that you use a font of which a subset will be embedded in the document (in the example arialuni.ttf is used).
In case of A., the phenomenon also concerns other languages. In case of B., the parameter is correct, but you're not providing a font that can be used to generate the appearance.

Show keyboard according to font selection ios

I want to create a Alphabet (Character) tracing and learning app.Which will be multilingual app.The font for different language will be attached in app resource folder. First user select language and fond. According to language selection the keyboard will be shown.Then user enter a character and trace. Is it possible to show keyboard according to language selection.Or I have to create custom keyboard.Please suggest me.
You have no control over which keyboard gets shown, unless you create a custom one, unfortunately. If you had control, you might request to show a keyboard that the user has not enabled in their settings and this would cause a problem. The only keyboards you can request to open are the ones listed in UIKeyboardType

Resources