guysoft / FullPageOS

A raspberrypi distro to display a full page browser on boot
GNU General Public License v3.0
3.79k stars 229 forks source link

When webpage is not in english chromium offers translation #7

Closed jorgeiglesiasca closed 4 years ago

jorgeiglesiasca commented 8 years ago

If you open a non english web chromium opens a dialog covering the top part of the screen with options to translate. Will be great to cancel that option by default as you dont have keyboard or mouse on screen.

tailorvj commented 8 years ago

I would try adding --disable-translate when running chromium from the command line

petrleocompel commented 6 years ago

Also happened. Chrome detected my country and offered "CZ-cs" content translate to "EN". Still not fixed.

guysoft commented 6 years ago

Looks like --disable-translate was removed from chromium. So we can't disable it via commandline

However here are instructions how to disable it from chromium.

petrleocompel commented 6 years ago

OK, but if you startup chromium in incognito mode it does not show up. So i would recommend to add --incognito. Because i really dont have input on my screens.

guysoft commented 6 years ago

I can't put --incognito as a default option to all users. You are welcome to put --incognito in your own installation.

petrleocompel commented 6 years ago

I understand. Then would be nice to have some override to scripts from boot partition. Because do this on every installation is a lot of work. Or I missed something?

guysoft commented 6 years ago

It might make sense to add a /boot/chromium.txt which would hold the chromium command execution settings. PRs are welcome

petrleocompel commented 6 years ago

So ok /boot/chromium.txt should hold command execution settings. (I'll make pull request later next week)

But maybe it will be much helpfull to add some first-time init script. Because today i discovered problem with different timezone on system. It would be great have /boot/(install|setup).sh which will be executed to configure system. Or maybe I'm just missing timezone configuration.

guysoft commented 6 years ago

The timezone is a separate issue. We could create a timezone module for CustomPiOS

On Thu, Nov 30, 2017 at 12:04 AM, Petr Leo Compel notifications@github.com wrote:

So ok /boot/chromium.txt should hold command execution settings. (I'll make pull request later next week)

But maybe it will be much helpfull to add some first-time init script. Because today i discovered problem with different timezone on system. It would be great have /boot/(install|setup).sh which will be executed to configure system. Or maybe I'm just missing timezone configuration.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/guysoft/FullPageOS/issues/7#issuecomment-348012168, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT4Jt7KPZCFMo-47rOuD2Du11YpI8Goks5s7dT-gaJpZM4GUxfr .

marians commented 6 years ago

Has anyone had success in suppressing the translate tool? I am running into this problem, too.

I've been looking for info on how to configure chromium so that it wouldn't show a translation tool. I found the language settings in this answer: https://unix.stackexchange.com/a/6223

Unfortunately I am lacking knowledge on how to apply that setting so that it actually sticks. Adding that "intl" key in /home/pi/.config/chromium/Default/Preferences had no effect for me. It was gone/overwritten after killing chromium. Would be glad for a hint here.

In addition I found https://cs.chromium.org/chromium/src/components/translate/core/browser/translate_prefs.cc which lists preferences keys that affect translation. Here translate_blocked_languages looks especially promising. But, same problem as above, I don't know how to inject that setting.

Another answer on the stackexchange page mentioned above suggests to install the chromium-browser-l10n package to localize chromium. However I couldn't test that, as the package couldn't be found by apt-get.

petrleocompel commented 6 years ago

Put —incognito to chromium parameters.

guysoft commented 6 years ago

Thanks for the input guys! If you could tell me what needs to go where, I can add it to the build. The —incognito solution is good for users, but I can't ship like that because then logins would not be stored.

petrleocompel commented 6 years ago

I suggest it only as run option for running instance not to modify image.

I have customized script which I use to configure my instances. Easier than editing image.

guysoft commented 6 years ago

I can edit the image. Thats the point of this repo :)

petrleocompel commented 6 years ago

You didn’t understand me. ☺️ I know you can. I know I don’t want to put there an --incognito option as default. But I’m trying to help that guy with translate popup. How to fix it on his running instance.

I promised pull request for chromium options, but of course company in which I work didn’t give time to make it. We have only 12 running instances and I configured it only once so nobody touched that for a while.

Once I will make another installation I will make pull request.

guysoft commented 6 years ago

Ok, understood now :)

marians commented 6 years ago

This is what seems to have solved the problem for me for now, for German web content:

Still looking for a way to pre-configure this, ideally based on FULLPAGEOS_OVERRIDE_LOCALE.

marians commented 6 years ago

I need some help with the change to apply the locale setting and make the Chromium translate tool disappear.

Here are my changes: https://github.com/netzbegruenung/FullPageOS/pull/1

As you can see here I am trying to modify /home/pi/.profile, but it doesn't work. In the final image, the file is untouched. Any idea what I would need to change?

guysoft commented 6 years ago

Hey, just saw this now because you pull requested to your own repo and no to this repo.

  1. can you provie a build.log?
  2. You can try adding your changes to end_chroot_script and not start_chroot_script the might be overwritten, but I am guessing without seeing the build.log.
marians commented 6 years ago

@guysoft I am preparing the PR to the devel branch in our own forked repo first.

Thanks for the hint regarding end_chroot_script!

Where does build.log end up? Or are you talking about the terminal output?

guysoft commented 6 years ago

build.log is by default output in the path where you run the build command. If you are using vagrant thats the path of the src folder of your distro. is set at src/build (in CustomPiOS) [ -n "$LOG" ] || LOG="build.log"

christophe77 commented 5 years ago

The easyest solution is to add a meta to your html page : <meta name="google" content="notranslate">

jppicture commented 4 years ago

in /home/pi/script/start_chromium_browser data put this parameter to startup "--disable-features=TranslateUI" and the message is away

Kevinsky86 commented 2 years ago

in /home/pi/script/start_chromium_browser data put this parameter to startup "--disable-features=TranslateUI" and the message is away

This Git thread is Google's top search result when you look for this, so for the purpose general interest i'm posting a reply in this topic. This variable has been renamed from TranslateUI to just Translate.

If /home/pi/script/start_chromium_browser data is adjusted accordingly and FullpageOS is subsequently restarted the translate bubble goes away.