Giter VIP home page Giter VIP logo

text-translator's Introduction

##Text Translator Translation of the text by different translators (currently Google.Translate, Yandex.Translate).

###Shortcuts <Super>T - open translator dialog.
<Super><Shift>T - open translator dialog and translate text from clipboard.
<Super><Alt>T - open translator dialog and translate from primary selection(requires xclip).
<Ctrl><Enter> - translate text.
<Ctrl><Shift>C - copy translated text to clipboard.
<Ctrl>S - swap languages.
<Ctrl>D - reset languages to default.
<Tab> - toggle transliteration of result text. ###Screenshots ######Dialog Translator Translator 2 Language chooser ######Settings Main settings Translators settings Keybindings

text-translator's People

Contributors

awamper avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

text-translator's Issues

extension isn't opening the second time

Hey, I have a strange problem here, the first time I use the translator everything works well but after closing the window I can't open it again until I restart the gnome shell. There aren't any errors seen in looking glass or in xsession-errors. Maybe you have some idea? Thanks

[Feature Request] Update result on toggle.

Thanks for this great extension.

It would be nice that a language toggle will also update the result so users won't need to press the Go button.

I would even remove the Go button completely and simplify the design a little bit more to make it look as part of Gnome interface, like:

  • Remove the Quit button, users don't need guidance to press ESC.
  • Remove the Toggle Instant Translation button, this should be only be available through settings.
  • Remove the Help button, better add a remark like: "Press F1 for help" and bind F1 to open the help window.
  • Remove the Settings button, users know where to find the extensions settings and there's already extension to help with quick accessing these (like: SettingsCenter).
  • Don't use colours, this gives the feeling that the extension isn't part of Gnome.

Just my 2cents, this is a very usable extension and I absolutely love it.

Add pronounciation

If possible, please add an option for automatic or button/shortcut for manual pronunciation using Google Translate.

How to add another translation provider ?

Currently this extensions have 2 providers: Google and Yandex. I want to add Bing Translator to have a solution when Google and Yandex both not working correctly. How can I do it ?

quit the windows by simple click outside the window

Hi, :-)
I want everytime qui the windows by click outside the windows, but I'm everytime frustrated by the need to click on "shutdown" buton, or escape keyboard...

I think that's will be good if we can do that...

Syncerely
.H.

Dual screen

Hi,
when i launch the translator extension, i can't access my applications on my second screen.
It could be fun to have the extension on one screen, when i'm writing documents on the second.

Anyway, thanks for your work.
Best regards.

pronunciation in the source not target language

I believe users want it to speak the source language more often than target language. Or make a option for choice.

in line 883 and 884 of file entension.js.
this._dialog.target.text,
this._current_target_lang

make it to:

this._dialog.source.text,
this._current_source_lang

Gpaste

Is there way to use gpaste instead of xclipit for translate primary selection?

Copy / Paste not working with Thunderbird

Awesome gadget!

I just wanted to point out a really strange issue I found and I think maybe it's a result of what is being put on the clipboard by the text translator.

If I copy a translation and paste it into GEdit then it pastes it as plain text no problem. But when I paste the same copied text to Thunderbird email it pastes an image (or some unrecognized object) not actually the text that I copied.

Cheers

Proposed redesign

I propose these changes:

  • The right button are not fully aligned to the right (At least in my resolution).
  • Change red cursor to white.
  • Separate buttons of origin and destination language and put each over its corresponding text area.

screenshot from 2016-01-15 14-43-32

This extension is amazing!

support for http proxy

I like the extension but I'm unable to use it at work, where it would be especially useful to me, because the requests aren't passing through the company's http proxy.

I'd be very grateful if someone could implement the support. Thank you!

Localization

Your extension is great, i like it. Do you plan including localization support? I would translate it to German for instance.
And one minor thing: Sometimes I think it is a bit annoying that the buttons at the bottom are moving. Mainly when the button you want to click has moved away in the mean time.

Gnome 3.18

It'd be nice to add support for new Gnome 3.18 found in Fedora 23 Beta.

Doesn't seem to remember translation settings

Hello @awamper,

I've been trying your extension lately and I like it lot, sorts out very nicely the hurdle of having to switch to the browser to open a translator in a tab, kudos!

However I found that it doesn't honors the languages I set in the configuration panel, steps to reproduce the issue:

  1. First switch the preferred languages for both Yandex and Google translator
  2. Launch the translator: it will still default to English -> Russian. Yes, I can see the tabs with the languages I used previously below but I still have to manually click on them.

Cheers.

Can't use Yandex Translate

When I choose Yandex Translate insted of Google (which doesn't work anymore) in preferences, it will always automatically switch back to Google.
Same when I use the dconf-editor for configuration.

The translator interface won't escape and/or locks the underlying apps if used 2 or 3 times.

Great extension, but there's a big ugly bug. I'm running gnome 3.8, Ubuntu 13.10 (beta)

The thing is: when I use translator, after 1 or 2 usage of the interface, I can't exit the translating window anymore.
It locks completely the other running app's windows (can't use them with either the mouse or the keyboard), and I can't get out of this with "esc" or else. I can only access the top bar, and thus only disconnect from the session to fix it.

Add Translit Feature for languages like Greece, Chinese etc.

Hello,

extreme good code, very useful extension thank you for sharing.

I added translit output maybe you can think about to merge this in your code.

Best Regards,
Florijan

Patch:

diff -rupN test/text-translator/google_tts.js [email protected]/google_tts.js
--- test/text-translator/google_tts.js  2014-08-09 23:00:35.901708315 +0200
+++ [email protected]/google_tts.js 2014-08-09 22:56:48.826271821 +0200
@@ -2,6 +2,7 @@ const Lang = imports.lang;
 const Gst = imports.gi.Gst;

 const URI = 'https://translate.google.com/translate_tts?ie=UTF-8&q=%s&tl=%s';
+const TRANSLIT_PART_SEPERATOR = '--------------------Translit--------------------\n\n';

 const GoogleTTS = new Lang.Class({
     Name: 'GoogleTTS',
@@ -24,6 +25,12 @@ const GoogleTTS = new Lang.Class({
     speak: function(text, lang) {
         this._kill_stream();

+        let translitPartIndex = text.indexOf(TRANSLIT_PART_SEPERATOR);
+
+        if(translitPartIndex > -1){
+          text = text.substring(0, translitPartIndex);
+        }
+
         let uri = URI.format(encodeURIComponent(text), lang);
         this._player.set_property("uri", uri);
         this._player.set_state(Gst.State.PLAYING);

diff -rupN test/text-translator/translation_providers/google_translation_provider.js [email protected]/translation_providers/google_translation_provider.js
--- test/text-translator/translation_providers/google_translation_provider.js 2014-08-09 23:00:35.905041630 +0200
+++ [email protected]/translation_providers/google_translation_provider.js  2014-08-09 23:04:51.553656663 +0200
@@ -13,6 +13,7 @@ const LIMIT = 1400;
 const MAX_QUERIES = 3;

 const SENTENCES_REGEXP = /\n|([^\r\n.!?]+([.!?]+|\n|$))/gim;
+const TRANSLIT_PART_SEPERATOR = '--------------------Translit--------------------\n\n';

 const DictionaryEntry = new Lang.Class({
     Name: "DictionaryEntry",
@@ -288,6 +289,10 @@ const Translator = new Lang.Class({

         for(let i = 0; i < json.sentences.length; i++) {
             result += json.sentences[i].trans;
+            if(json.sentences[i].translit){
+                result += "\n\n" + TRANSLIT_PART_SEPERATOR;
+                result += json.sentences[i].translit;
+            }
         }
         result = Utils.escape_html(result);

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.