GithubHelp home page GithubHelp logo

mozilla / translate Goto Github PK

View Code? Open in Web Editor NEW
57.0 8.0 15.0 105.96 MB

Translations website utilizing Bergamot proceedings

Home Page: https://mozilla.github.io/translate

License: Mozilla Public License 2.0

JavaScript 98.63% CSS 0.77% HTML 0.56% Shell 0.04%

translate's Introduction

Translations Website

This repo contains a static website utilizing the proceedings of project Bergamot.

The concept is the same as Firefox Translation, where the inference occurs entirely in the webpage by utilizing the WebAssembly port of the neural machine translation engine (marian), while the models are dynamically downloaded and loaded as the user switches between the languages.

Live Demo

The live demo is hosted on Github Pages and published on https://mozilla.github.io/translate.

Compatible and tested on:

  • Firefox desktop
  • Chrome desktop
  • Edge desktop
  • Brave desktop
  • Firefox Nightly for Android
  • Chrome for Android

Testing locally

$npm install
$bash start_dev_server.sh
$firefox https://mozilla.github.io/translate

translate's People

Contributors

abhi-agg avatar andrenatal avatar bgrins avatar eu9ene avatar potch 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

translate's Issues

Erroneous translation results when attempting to translate a text in a different language

[Affected versions]:
Firefox Nightly (94.0a1/20210920212918)

[Affected Platforms]:
Windows 10 x64

[Prerequisites]:
Access https://mozilla.github.io/translate/.

[Steps to reproduce]:

  1. Translate any text from EN to RU.
    For example, use: “Giovanni Antonio Grassi (10 September 1775 – 12 December 1849) was an Italian Jesuit who led many academic and religious institutions in the United States and Europe. Born in Lombardy, he studied at the Jesuit College in Polotsk, where he began his academic career. He was soon ordered to China as a missionary, but after traveling across Europe for two years attempting to secure passage, his orders were rescinded and he instead began teaching at Stonyhurst College in England.”
  2. Once the translation has finished, copy the translation results and paste it into the “From” field
  3. Cycle through the “From” languages while setting and keeping EN as a language to translate to. Wait for the translations to finish
  4. Observe the erroneous results.

[Expected]:
Maybe the engine should detect the input language and change the “From” language to the one detected so as not to get such results.

[Actual]:
When the engine attempts to translate a text which is in a language different from the one selected, the translation result is erroneous.

2021-09-21_10h57_50

Translation results field is not cleared after completely clearing the input field

[Affected versions]:
Firefox Nightly (94.0a1/20210920212918)

[Affected Platforms]:
Windows 10 x64

[Prerequisites]:
Access https://mozilla.github.io/translate/.

[Steps to reproduce]:

  1. Translate any text using any available language combination.
    For example, use: “Giovanni Antonio Grassi (10 September 1775 – 12 December 1849) was an Italian Jesuit who led many academic and religious institutions in the United States and Europe. Born in Lombardy, he studied at the Jesuit College in Polotsk, where he began his academic career. He was soon ordered to China as a missionary, but after traveling across Europe for two years attempting to secure passage, his orders were rescinded and he instead began teaching at Stonyhurst College in England.”
  2. Once the translation has finished, delete/clear the entire contents of the input field
  3. Notice the translation results field was not updated/cleared to reflect the lack of text from the input field.

[Expected]:
The results field should update in real time in accordance with the input field.

NOTE: When partially deleting/clearing content from the input field, the results field gets properly updated.

[Actual]:
The results field does not get updated/cleared when the entire input field is cleared.

2021-09-21_11h06_59

“Error translating” when duplicating a tab

[Affected versions]:
Firefox Nightly (94.0a1/20210909212746)

[Affected Platforms]:
Windows 10 x64

[Prerequisites]:
Access https://mozilla.github.io/translate/.

[Steps to reproduce]:

  1. Translate any random text in any supported language combinations
  2. Once the translation has finished, duplicate the tab
  3. Notice that on the duplicate tab the input text as well as the translated text are still present, but the “From” and “To” language combination has been reset.
  4. Click on the text from the “From” field and press “Enter”
  5. Observe that the “Error translating” message is displayed

NOTE:
Setting a “To” language without setting a “From” language will not resolve the issue. Both “From” and “To” languages must be set once more to resolve the issue.

[Expected]:
Duplicating a tab with translation results should keep the original language combination set on the duplicate tab as well.

[Actual]:
Duplicating a tab resets the selected language combination and causes the “Error translating” message to be displayed.

2021-09-10_10h52_46

Issue translating same text from 2 different sources, from DE to EN

[Affected versions]:
Firefox Nightly (95.0a1/20211005215418)

[Affected Platforms]:
Windows 10 x64

[Prerequisites]:
Access https://mozilla.github.io/translate/.

[Steps to reproduce]:

  1. Access https://de.wikipedia.org/wiki/Wikipedia:Hauptseite and copy part of the available “Artikel des Tages” text. (the one I used was an article about Riparia Bridge and I copied the following portion:

    Die Riparia Bridge war eine eingleisige Eisenbahnbrücke über den Snake River zwischen dem Whitman County und dem Columbia County im Südosten des Bundesstaates Washington. Die von George S. Morison entworfene Fachwerkbrücke war eine der ersten Stahlbrücken in den USA. Sie wurde bis 1889 von der Oregon Railroad and Navigation Company (OR&N) errichtet
  2. Paste the text in the “From” field on the translation website, which was previously configured for translating DE to EN. Wait for the text to be translated.
  3. Notice the translation errors i.e untranslated words, added characters to some words, etc.
  4. On the “Artikel des Tages” section, click on the “Zum Artikel...” link at the end to go to the full article page.
  5. On the article page, notice that the initial portion of the article is the same as the one available in the “Artikel des Tages” section on the previous page.
  6. Copy the same portion of the article as in the “Artikel des Tages” sction and paste it in the “From” field of the translation website. Wait for the text to be translated.
  7. Notice that the text is correctly translated, with no errors in translation, no untranslated words or added characters.

[Expected]:
Since I’m translating the same text but from different sources, the translation results should be the same as well.

[Actual]:
Different translation results when translating the same text from different sources.

Note:
Pasting the texts via Special Paste (CTRL+SHIFT+V) → “Unformatted text” option, in a word editor reveals some differences between the 2 seemingly identical texts. See attached screenshot:
2021-10-06_12h01_09

Video of reproduction steps:
https://user-images.githubusercontent.com/50236075/136172742-a68f03e3-9bb0-46ec-8557-7df348039f77.mp4

Cannot open browser console during long text translation process

[Affected versions]:
Firefox Nightly (94.0a1/20210920212918)

[Affected Platforms]:
Windows 10 x64

[Prerequisites]:
Access https://mozilla.github.io/translate/.

[Steps to reproduce]:

  1. Translate any long text using any available language combination. For example, use the https://en.wikipedia.org/wiki/COVID-19 article for sample text. I copied around 15 pages of text as seen in a text editor software such as Microsoft Word/LibreOffice Writer with a font size of 12.
  2. During the translation process attempt to open the browser console (CTRl+SHIFT+J)
  3. Notice the console is brought up but is empty/blank
  4. Close the console window
  5. Open the console again
  6. Observe that the console window does not show up
    NOTE: Restarting the browser will bring up the browser console immediately upon restart.

[Expected]:
I should be able to use all browser functions while translations are in progress.

[Actual]:
The browser console comes up blank the first time and afterwards it’s not displayed at all.

It might be a performance issue since the 15 pages of text it tries to translate take up to 1 minute and a half to finish. However, strangely enough, I did not notice any significant spikes in RAM or CPU usage.

Punctuation marks influence translation results.

[Affected versions]:
Firefox Nightly (94.0a1/20210920212918)

[Affected Platforms]:
Windows 10 x64

[Prerequisites]:
Access https://mozilla.github.io/translate/.

[Steps to reproduce]:

  1. Translate a short text from EN to RU. For example (please don’t mind the stupid example): “I went to school to learn English, German and math. I love school. I love apples too. Apples have vitamin C.”
  2. Delete the full stop at the end of the “Apples have vitamin C.” sentence.
  3. Notice some words change in the translation results.

[Expected]:
Punctuation marks should not change the translation results as no modifications have been brought to the actual wording of the text.

[Actual]:
Punctuation marks can change the translation results.

2021-09-21_14h32_44.mp4

“Installing model...”/”Models installed.” messages are displayed even after models are installed

[Affected versions]:
Firefox Nightly (94.0a1/20210908213905)

[Affected Platforms]:
Windows 10 x64

[Prerequisites]:
Access https://mozilla.github.io/translate/.

[Steps to reproduce]:

  1. On the translation website, set a language combination, for example EN-RU
  2. Notice “Installing model...”/”Models installed.” messages are displayed
  3. Switch between the languages so that the “From” language will be RU and the “To” language will be EN
  4. Notice “Installing model...”/”Models installed.” messages are displayed again
  5. Switch back to the configuration from Step 1
  6. Notice “Installing model...”/”Models installed.” messages are displayed once more

[Expected]:
“Installing model...”/”Models installed.” messages should be displayed only once per language combination

[Actual]:
“Installing model...”/”Models installed.” messages are displayed each time the user switches between the same 2 languages.

Some single words are being duplicated in the translation in EN-RU combination

[Affected versions]:
Firefox Nightly (94.0a1/20210908213905)

[Affected Platforms]:
Windows 10 x64

[Prerequisites]:
Access https://mozilla.github.io/translate/.

[Steps to reproduce]:

  1. On the translation website, set EN-RU as a language combination
  2. In the “From” field, type one single word, for example “mother”, “love”, “people” (these were all I could find that act this way. Some other words like “pear”, ‘pea”, “carrot” etc result in only one appearance of the translated word)
  3. Notice that in the translation field, the translated word appears 2 times.

NOTES:

  1. Adding a second word in the “From” field, after the original one, will cause the duplicate translated word to be replaced by the translation of the second one i.e. “mother” gets translated to “мать мать”, but “mother apple” gets translated to “мать яблоко”.
  2. Capitalizing the word to be translated will result in only one appearance of the translated word i.e. “love” gets translated to “Любить любовь”, but “Love” get translated to “Любовь”.

[Expected]:
Translating one word should result in only one appearance of the translated word and not duplicates.

[Actual]:
Translating one word should causes the translated word to appear twice.

Missing license

Please add license information. Forking the project and using the code without license is impossible.

Capitalizing a word causes unexpected translation results in strings containing duplicate words

[Affected versions]:
Firefox Nightly (94.0a1/20210929155324)

[Affected Platforms]:
Windows 10 x64

[Prerequisites]:
Access https://mozilla.github.io/translate/.

[Steps to reproduce]:

  1. Translate the following string “mother mother” and notice the translation results
  2. Capitalize the second word so the input becomes “mother Mother” and notice the results in different language combinations. For example:
    EN-IT: mother Mother → Madre Madre (both words are capitalized)
    EN- PT: mother Mother → mãe mãe mãe (a third word is added)
    EN-RU: mother Mother → Мать Мать (both words are capitalized)
    EN-CZ: mother Mother → matka matka (no words are capitalized)
    EN-DE: mother Mother → Mutter Mutter (both words are capitalized)
    EN-ES: mother Mother → madre madre (no words are capitalized)
    EN-ET: mother Mother → ema ema (no words are capitalized)

[Expected]:
The translation engine should account for word capitalization and translate accordingly. It should also maintain the same amount of words as in the input field.

[Actual]:
Unexpected results are observed when capitalizing words in the input string.

Note:
Stranger translation results appear when sequentially capitalizing strings with duplicate words. See video for more details.

2021-09-30_14h43_06.mp4

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.