Traduzir-paginas-web icon indicating copy to clipboard operation
Traduzir-paginas-web copied to clipboard

"Never translate...." does not work

Open seniordevel opened this issue 1 year ago • 6 comments

"Never translate this languages" always fails.

I added German to the List.

Expected behavior: TWP bottom bar (original - translated) is not shown at most german language pages.

Actual behavior: TWP bottom bar is always shown. It hides a lot of screen space for no reason.

As I am addon developer myself, I know this issue would be easy to fix.

  1. You could use Google's "detect language api" by sending a few words of the page text to Google.

  2. At least you could use the country code of a site's Url. This is less exact and would be wrong for sites hosted in other countries.

  3. You could implement list's of the 10 most common words for all languages. This works fine too, I tried it with another addon, but in your case probably too much effort.

However, leaving it as it is, clearly buggy, your addon is nothing but annoying for me.

Thanks for your time!

seniordevel avatar May 16 '23 19:05 seniordevel

I believe you are using TWP on Firefox Mobile.

Follow these steps:

  1. Open the extension's configuration page
  2. Click on the Others tab
  3. Change the Show the mobile popup setting value to When I touch three fingers on the screen

This way it will be less annoying.

FilipePS avatar May 16 '23 19:05 FilipePS

Thank you for "first aid" !

Your suggestion works for my mobile and I am --almost-- satisfied with your solution.

But please leave it open as a bug since it is not too hard to fix it using Google detection api by picking a few randomized words.

Possibly you remember my older addon "Babelfish Translation" which is no longer available.

Thank you !!

seniordevel avatar May 16 '23 20:05 seniordevel

Although Firefox Mobile (nor any Opera) supports chrome.tabs.detectLanguage, apparently they support chrome.i18n.detectLanguage, so for those browsers I can use this alternative function.

And sending texts to Google's servers every time you open a website, even if the user has no goal of translating something, is something I would never implement.

And I didn't know the extension Babelfish Translation. I only had daily internet access after 2014, and became interested in browser extensions in 2020.

FilipePS avatar May 16 '23 20:05 FilipePS

they support chrome.i18n.detectLanguage, so for those browsers I can use this alternative function.

This would be fine, but this api still demands sending of some words to Google - on every page load.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n/detectLanguage

But you wrote:

And sending texts to Google's servers every time you open a website, even if the user has no goal of translating something, is something I would never implement.

So why not use country codes, e.g. *.de, *.es, *.fr or *.com for supposingly US-english?

Note: I personally use Iceraven browser on my mobile:

https://github.com/fork-maintainers/iceraven-browser/issues

seniordevel avatar May 16 '23 20:05 seniordevel

The detectLanguage function uses Compact Language Detector which works offline for text language detection.

FilipePS avatar May 16 '23 20:05 FilipePS

The detectLanguage function uses Compact Language Detector which works offline for text language detection.

Really nice !

Then this would be the way to go, in my opinion.

Good night, and best wishes.

seniordevel avatar May 16 '23 20:05 seniordevel

I just made a commit with a new popup mobile interface for Android. In the next version of the extension, the Always translate from [...] option will be available on Android. https://github.com/FilipePS/Traduzir-paginas-web/commit/9e41df4c724db6a4b6a71469e54523082f00600b

And I recommend using the TWP - Translate For Mobile extension on Android. There are installation instructions in the readme file. https://github.com/FilipePS/Traduzir-paginas-web/blob/master/readme.md

FilipePS avatar Feb 18 '24 23:02 FilipePS