5

I've downloaded the package but as I'm trying to open it I get this message:

Archive:  /home/agnes/Downloads/ggtranslate.exe
[/home/agnes/Downloads/ggtranslate.exe]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
zipinfo:  cannot find zipfile directory in one of /home/agnes/Downloads/ggtranslate.exe or
          /home/agnes/Downloads/ggtranslate.exe.zip, and cannot find /home/agnes/Downloads/ggtranslate.exe.ZIP, period.
8128
  • 28,740
Agnese
  • 343
  • 3
    I can find two apps called Google-Translate-Desktop. One in http://www.athtek.com/google-translate-desktop.html, and other in http://code.google.com/p/google-translate-desktop/. They are different, the former looks like a windows only freeware, the second is a multi-platform open source java app. Which one are you talking about? – Javier Rivera Jan 20 '11 at 18:22

6 Answers6

5

Recently I've made a super simple script that opens a new browser tab with the google translator page showing information for the currently highlighted text on any app in Ubuntu.

It can be used as an alternative. One way to use it is to link the command to a keyboard shortcut; then, any time you press the key, a new tab will open automatically.

I took this approach because frequently I'm looking not only for the translation but also for the pronunciation as well.

In addition, you might want to check translate-shell out, it is a command-line utility that interfaces with many translation engines.

3

Setting up and configuring the 'translate highlighted text' script

  1. To be able to use the script, firstly install libnotify-bin (so the script can send desktop notifications), wget (to retrieve the translation from Google) and xsel (which is used to get the currently highlighted text). In Ubuntu, Linux Mint, etc. install them using the following command:

    sudo apt-get install libnotify-bin wget xsel  
    
  2. Next, copy the script code below:

    #!/usr/bin/env bash  
    notify-send --icon=info "$(xsel -o)" "$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&**tl=en**&dt=t&q=$(xsel -o | sed "s/[\"'<>]//g")" | sed "s/,,,0]],,.*//g" | awk -F'"' '{print $2, $6}')"  
    

    and paste it in a new file - let's call it notitrans (well, you can call it whatever you want, but that's how I'll refer to it from now on).

    In the script above, replace tl=en with the language into which you want the text to be translated, for instance tl=ru for Russian, tl=fr for French and so on.

    After you're done, save the file in your home directory and make it executable using the following command:

    chmod +x ~/notitrans
    
  3. Place the script in your $PATH - for instance, to copy the script to /usr/local/bin/, use the following command:

    sudo mv ~/notitrans /usr/local/bin/
    
  4. To be able to use the script, you can assign it a custom keyboard shortcut. Doing this depends on your desktop environment.

    On GNOME (and Unity), you can do this by going to System Settings > Keyboard > Shortcuts > Custom Shortcuts, where you'll need to click "+" to add a new keyboard shortcut. Here, enter any name you want for the new custom shortcut and "notitrans" as the command:

enter image description here

And finally, assign a keyboard shortcut to the newly added command by clicking on it and then holding down the keys you want to assign to it. Make sure the keyboard shortcut is not already in use!

Optional: variations of the 'translate highlighted text' script

enter image description here

Display the translation with Zenity (which allows the text to be copied) instead of using desktop notifications:

#!/usr/bin/env bash  
text="$(xsel -o)"  
translate="$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&**tl=en**&dt=t&q=$(echo $text | sed "s/[\"'<>]//g")" | sed "s/,,,0]],,.*//g" | awk -F'"' '{print $2, $6}')"   
echo -e "Original text:" "$text"'\n' > /tmp/notitrans  
echo "Translation:" "$translate" >> /tmp/notitrans  
zenity --text-info --title="Translation" --filename=/tmp/notitrans 

For this to work, make sure Zenity is installed on your system. On Ubuntu, install it using the following command:

sudo apt-get install zenity

Display the translation in a desktop notification AND automatically copy the translation to the clipboard:

#!/usr/bin/env bash
text="$(xsel -o)"
translate="$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&**tl=en**&dt=t&q=$(echo $text | sed "s/[\"'<>]//g")" | sed "s/,,,0]],,.*//g" | awk -F'"' '{print $2, $6}')"  
echo "$translate" | xclip -selection clipboard  
notify-send --icon=info "$text" "$translate"  

For this to work, make sure xclip is installed on your system. On Ubuntu, install it using the following command:

sudo apt-get install xclip
derHugo
  • 3,356
  • 5
  • 31
  • 51
Swapnil
  • 853
  • 1
  • 9
  • 22
2

Google Desktop Translator is a Java application that runs on Ubuntu if Java was installed. The file you downloaded obviously is designed to install and uncompress from Windows or (see Javier Rivera's comment) may be another third party Windows program. Both will not work in Ubuntu.

Download the appropriate .zip file directly from Google with this link:

http://code.google.com/p/google-translate-desktop/downloads/list

Uncompress the files, open a terminal, cd to your installation directory and run

java -jar google-translate-desktop-0.52.jar

The program window should now open:

google-translate

Unfortunately in version 0.52 this window has no decoration and cannot be moved, but there is full translation functionality. For quitting or for program settings a status icon is generated in the GNOME panel. Windows decoration is present in the beta version only that has a slightly reduced functionality.

If you're not experienced on your Ubuntu or feel uncomfortable to install anything from external sources you may consider to use Google's Web-frontend for translation instead.

Takkat
  • 142,284
  • Just ran run-linux.sh and java -jar google-translate-desktop-0.52.jar and got this msg: Could not open the file /home/agnes/Downloads/go…ranslate-desktop-0.52.jar. gedit has not been able to detect the character coding. Please check that you are not trying to open a binary file. Select a character coding from the menu and try again. – Agnese Jan 20 '11 at 12:16
  • How do I do it? – Agnese Jan 20 '11 at 13:11
  • Is java installed on your system? – Takkat Jan 20 '11 at 13:26
  • yes, I have java – Agnese Jan 20 '11 at 13:59
  • what do you get when you run in terminal as pointed out in edit of my answer? – Takkat Jan 20 '11 at 14:06
  • When I run it in terminal I get the following answer: agnes@agnes-laptop:~$ java -jar google-translate-desktop-0.52.jar Unable to access jarfile google-translate-desktop-0.52.jar – Agnese Jan 20 '11 at 14:45
  • You need to change to the installation directory first by typing cd /home/agnes/Downloads/. Then you should be able to run the command above. – Takkat Jan 20 '11 at 15:09
  • Still no success: agnes@agnes-laptop:~$ cd /home/agnes/Downloads/ agnes@agnes-laptop:~/Downloads$ java -jar google-translate-desktop-0.52.jar Unable to access jarfile google-translate-desktop-0.52.jar – Agnese Jan 20 '11 at 17:14
  • 1
    I was just able to test this on my 10.04 am64 (see screenshots) with no further steps. Java does not find the jar file on your system. Make sure there are no typing errors and the .jar file is really present in the directory from where you run java (e.g. ls lists google-translate-desktop-0.52.jar before you invoke the java command) – Takkat Jan 20 '11 at 17:28
  • does alt + left click move it? – Mateo Jan 17 '14 at 21:44
1

You tried to run a Windows program. Try this:

  1. Make sure all the files and subdirectories from the ZIP archive are in a folder.
  2. While in that folder, right-click on google-translate-desktop-x.y.jar, and click Properties, then Permissions.
  3. Make sure "Allow executing file as program" is checked.
  4. Close the dialog, right-click on the file, and under Open With, click your Java Runtime.

EDIT: You may have downloaded windows only freeware. Try downloading this, and following the above instructions after extracting the archive.

Glen
  • 155
0

Dialect is a translator app that uses Google translate as the backend.

image It is available on Flathub

flatpak install flathub com.github.gi_lom.dialect

Source: https://github.com/dialect-app/dialect

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
0

This answer no longer properly functions, as the link is no longer operational. This post has been left as-is, however, for historical purposes.

you can use Goot(Download). it uses google translator.

Thomas Ward
  • 74,764
Lincity
  • 25,371