2

I have implemented internationalization using i18n. I know i can't change language at runtime using chrome.i18n. Is there any way I can change Chrome language programmatically using JS? Any lib or custom code.

2
  • I certainly hope you're not able to. Otherwise any extension might decide to change my browser's language to something I don't speak and changing back would be very hard or impossible. Especially if the extension changes is back. Commented Aug 26, 2019 at 13:46
  • You can write a separate utility that changes the user profile preferences file and restarts the browser. Such utility can be written in any language and is to be installed separately so then your extension can launch it via nativeMessaging. Practically though, extensions that want to provide independent language setting have to use an independent localization library, there are lots. Commented Aug 26, 2019 at 13:59

1 Answer 1

1

No, there's not. Browser's language cannot be changed by an extension.

If you need to do this for testing purposes, I would suggest you to just start another instance of the browser passing the correct language from command line, for example:

LANGUAGE=it google-chrome
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.