apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.16k stars 990 forks source link

Change language app from device settings #1234

Closed adriansaenz closed 2 years ago

adriansaenz commented 2 years ago

Hi! I'm doing an application using ionic framework and i'm looking for a way to change the app language from device app settings but i don't see any plugin to do it. I'm using the ngx-translate library to manage all translations inside the app but i don't see any connection with device setting. Is there any plugin to get if user change the app language from device setting?

breautek commented 2 years ago

The webview way of doing this is via languagechange event on the Window object.

But I have no idea if system webviews invokes this correctly. Probably worth testing though.

adriansaenz commented 2 years ago

I was able to test it adding that language change event and it seems that is working. I did not test it deeply but for the moment seems to work.

jcesarmobile commented 2 years ago

Closing since languagechange event seems to work