Code Monkey home page Code Monkey logo

translate-tools / linguist Goto Github PK

View Code? Open in Web Editor NEW
515.0 515.0 18.0 8.55 MB

Translate web pages, highlighted text, Netflix subtitles, private messages, speak the translated text, and save important translations to your personal dictionary to learn words even offline

Home Page: https://chrome.google.com/webstore/detail/gbefmodhlophhakmoecijeppjblibmie

License: BSD 3-Clause "New" or "Revised" License

Shell 0.19% TypeScript 85.98% CSS 7.99% HTML 0.33% JavaScript 5.24% Makefile 0.13% Dockerfile 0.15%
addon browser-extension chrome-extension dictionaries firefox firefox-addon firefox-extension offline-translator plugable translate translation translator webextension

linguist's People

Contributors

dependabot[bot] avatar hamirmahal avatar jwenjian avatar viktoron avatar vitonsky avatar wordpure avatar zeref-dragneel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

linguist's Issues

Add option "auto language while mixed content"

When detect mixed content on page, suggest "auto detect" language in popup and auto translate from this language.

And allow to user decide edge of mixed content.

If translator has no support auto detection language then will use one of page languages (as now)

Refactor file structure

Make "core" as package, to decrease complexity of init project and prevent install from many directories

Maybe we should make repo as project

Publish it in all browsers stores

Prepare release

  • Generate locales files for all languages
  • Rework product description
  • Update screenshots
  • Translate product description

Publish in browsers stores

Add option "show translate button once"

Implement option "show translate button once", which will use flag which set after show button and unset after any "selection" event.

When flag is set, then button is not shown.

It may be useful for sites like twitter where after click on oter place, button can appear again. With this option button will not appear until user will select text again.

Think about make this option enable by default

Add synch with browser account

Optionally sync data with firefox/google account

Must be able configure data for sync

Data for sync:

  • Preferences
  • Dictionary
  • History

Optimize translate of high frequency untranslatable changes

For cases like site https://online-timer.ru with high frequency untranslatable changes translator work useless.

It not require real translate request and this case must be optimize to economy traffic, requests number and performance.

Concept

Skip translate a language independent chars for simple cases.

Detect language independent chars in text, search in translator cache a translates with original text which match with current request, but with ignore this chars on their positions and while match return translated text from this cache with replacing chars to actual.

Example:

Text in cache: Article number 1, posted in 2021 year.
Current request: Article number 523, posted in 7925 year.

Text pattern: ^Article number (\d+), posted in (\d+) year.

Notes

To do it perform, we may use temporary registry with data signature like this

type HotTextSignature = {
  pattern: RegExp;
  text: string;
  translate: string;
  replacements: Record<string, string>;
}

And keep it short time (few seconds/minutes) after last use.

Bug: switch for translate selected text

Switch for translate selected text set as text and translate same text. Add it to favorites give confused result.

Just swap source text and translation result.

Implement text speaking

Implement text speaking for text translation.

It must be module. For start it may be not configurable by user

Add tests for core

Add tests for translators in core directory

It important to catch bugs and prevent deploy with broken modules

Improve translate of selected text

Often while selection 1-3 words on the page, browser can't detect language.

At this time we just use page language.

I suggest implement option for enable preferent "auto detect" language instead page language if current translator support this feature (usually is that). Otherwise will use page language or last chosen direction depends on current settings.

Add action for build

Add action for build and publish release by commit with some tag like "release"

Several proposals for improvement

Thank you for creating this promising addon. I'd like to offer several proposals to improve on it.

  1. Currently it often fails to automatically translate some webpages. For example, on the following pages(even if "Always translate this language" is ticked):

(1) nasional.tempo.co/read/1491253/pasien-sembuh-covid-19-hari-ini-39-726-orang/full&view=ok
(2) jdih.tabanankab.go.id/berita/159/rapat-koordinasi-satpol-pp-disperindag-dan-dinas-lingkungan-hidup

图片

  1. Pls allow translation of webpages of any original language into English.This function is important and indispensible, because in many cases webpages are in mixed languages.

    In many cases the original language of a webpage is not detected or wrongly detected. For example, the original language of the following webpage is detected as English by your addon and can not be translated, but actually it also contains many Indonesian words.

https://www.linkedin.com/search/results/people/?keywords=menteri%20pendidikan&origin=CLUSTER_EXPANSION&sid=6ld

图片

When I use Chrome browser(with in-built Google Translate function), the original language of the above webpage is not detected because it is in mixed languages. However,the webpage can be translated into English with the Context Menu button as shown by the picture below.

图片

(1) The original language of that linkedin page is not detected by Google Translate, because it contains both English and many Indonesian words. So it just shows "Detected Language" instead of any specific language.

图片
图片

(2) But I need to translate the Indonesian words on that page and I can achieve that by using the Context Menu button as shown by the picture below.

图片

  1. Original Text on mouseover. This funciton is also indispensible as shown by the picure below.

Could you pls consider these proposals? Thank you and best regards!

图片

Find candidate for autonomic translator module

Now Linguist uses an third party services to translate texts. It is not private, because users send their texts to a servers like Google, Yandex, Bing, etc.

We need to allow users to use offline translation that will not send their texts to internet and will process it local on user machine. It is technically possible right now with custom translators, we have guide about it, however it is not embedded solution "for geeks only", so most users will not use this way.

Thus, we have to implement embedded module to offline translate text.

Requirements to candidate

  • High quality of translation
  • High performance
  • Support WASM or ready of maintainers to implement it
  • Many languages (at least 6)
  • Support all translate directions between supported languages
  • Not so big size of additional files (like dictionary or AI models)

Improve speed of translate page

At this time we collect all tags and only after it start translate.

This way lead to long waiting of translate page.

  • Instead we must check visibility while scan tags and instant translate it if it visible and in viewport boundaries.
  • Also we can set priority for tags content instead attributes
  • Also we can lazy collect DOM nodes, instead collect all while start
  • Also we can group nodes with limit by length

Not work auto translate for some sites

Some sites not have lang attribute for html tag, but set it with JS.

We should wait full loading page and after it check lang attrubute again, even if it empty while DOMContentLoaded.

Implement language suggestions

Suggest language direction while translate text from auto directon.

Do it optionally, if translate module support this feature

Fix migrations

Fix migrations for new IDB scheme to prepare to release

Typize requests

Add wrappers for requests, to bound handler and helper.

This is required to ensure correct types. We have too many wrongs due to this mistyping

Purposes

  • Type bounding hook and handler of request
  • Prevent non unique endpoint names
  • Optionally type checking in runtime by setting validator in property

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.