We are running several rpi managed from BalenaCloud.
We need to enforce preferred language for content of the web-page.
How can we enforce “accepted-language” in browser through variables?
We are running several rpi managed from BalenaCloud.
We need to enforce preferred language for content of the web-page.
How can we enforce “accepted-language” in browser through variables?
Hi, can you detail it a bit?
Are you using some container/block like GitHub - balenablocks/electron: Provides handy functionality for running electron apps in kiosk mode; wifi config, file picker, on-screen keyboard and removable drive management. ?
Do you want to make something like a kiosk?
Is the rpi the server or the client or both?
It is running as balenablocks/browser
Hello, it looks like in order to set the “accepted-language” header that the Chromium browser in the browser block sends to sites, you need to add languages to the browser’s “preferred languages” settings. I don’t see any way to do that through a variable as it’s not exposed anywhere I can find. I haven’t tested these, but alternate ways to do this include setting the language at startup (you’d probably have to override the block to do that: GitHub - balenablocks/browser: A drop-in web browser block) and then something like this: Start Google Chrome with a specific locale (using a command line argument) - Stack Overflow - or by changing the preference file (possibly stored at ~/.config/chromium/Default/Preferences
or a similar location) but again you’d have to overload the block to do this and then launch the browser.
Thanks,
For a normal installation of Chrome this can be change in the settings without any installation or download of language-ressources.
Yes, absolutely @yngve0 you can set the language that way too, but to survive reboots and container restarts, you would need to use another method. Another option in addition to those previously mentioned is to look at the browser block environment variables: GitHub - balenablocks/browser: A drop-in web browser block and use PERSISTENT
(along with the shared volume as indicated) and experiment with the FLAGS
variable which includes the --accept lang
switch, see details here: List of Chromium Command Line Switches « Peter Beverloo
Thanks;
Are there any documentation on how to use persistant? I though was possible to add the accept-lang to as startup-switch everytime the brower starts.
In addition to the link above for how to use PERSISTENT
(GitHub - balenablocks/browser: A drop-in web browser block ) you can also see the documentation for using environment variables here: Variables - Balena Documentation
You are correct that you could modify the block to use the startup switch for accept lang. The suggestion for using FLAGS
is similar to that without having to modify the block.