Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android webview doesnot work if change locale to Arabic. #25

Closed
AhmadHegazy opened this issue Jan 11, 2018 · 4 comments
Closed

Android webview doesnot work if change locale to Arabic. #25

AhmadHegazy opened this issue Jan 11, 2018 · 4 comments

Comments

@AhmadHegazy
Copy link

while the language is English the webview works perfectly. but if I change the language to Arabic the web view does not work.

@AhmadHegazy AhmadHegazy changed the title webview doesnot work if change locale to Arabic. Android webview doesnot work if change locale to Arabic. Jan 11, 2018
@wendux
Copy link
Owner

wendux commented Jan 12, 2018

Where is the error ?

@AhmadHegazy
Copy link
Author

i did not get any error and that is the problem. i will send you a demo of my code.

@Asma-Yasin
Copy link

This behavior appears to be happening with any language that uses non-English digits. I downloaded your sample and got the same behavior. After some digging, I found out that the script you're generating has callID, so I only changed %d to %s and it's working now.

The line I changed is in DWebView class inside callHandler method:
script = String.format("%s.returnValue(%s,%s)",BRIDGE_NAME,callID, script);

@AhmadHegazy
Copy link
Author

Yes, Thanks, Asmaa the problem exactly here. for the NON-English languages the numbers changes.
so in callHandler function we just to add English locale to the String.format(Locale.English, ...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants