gxlat - Desktop Google Translator redux

Word processors, spreadsheets, presentations, translation, etc.
Message
Author
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#46 Post by vovchik »

Dear all,

After many years I decided to update gxlat. There is a great little script (included in the archive) called trans that can deal with Google's new translate API. gxlat now uses that to fetch translations. Just unpack and copy files to the appropriate places. perhaps somebody can make a pet. :)

With kind regards,
vovchik
Attachments
gxlat.tar.gz
(44.67 KiB) Downloaded 398 times

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#47 Post by vovchik »

Dear all,

A forum friend has kindly provided a pet of gxlat, which is attached here. Thanks. Let me know how this little app works for you...i use it nearly every day for something or other that comes up and needs translation. Your mileage may vary. :)

With kind regards,
vovchik
Attachments
gxlat.pet
(44.82 KiB) Downloaded 423 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#48 Post by musher0 »

Hi Vovchik.

Good to see you back! :)

Google Translation, eh? Why not DeepL? Some say it translates better than Google.

Just a thought.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

Thanks

#49 Post by mikeslr »

Thank you, vovchik, and thank your friend for us.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#50 Post by vovchik »

@ musher0 and mikeslr,

Thanks guys. As I haven't done anything with gtkdialog for a long time (doing things in BaCon, c and c++ lately), perhaps one of you can look at that pesky swap button code. It should, in theory, swap bottom and top languages in the combo boxes and the texts in the edit boxes, but it's not doing that properly. And since trans works so nicely, I think we should stick with it. We could also experiment with the various engines it supports (aspell, google, deepl, bing, spell, hunspell, apertium and yandex). I haven't tried deepl, but it's certainly worth experimenting with. Perhaps there could be a combo box with some of those engines, so the user can try and compare translations. And a checkbox for sound might be good, too, since trans can play audio. :)

In any case, I hope it is working reasonably now.

With kind regards,
vovchik

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#51 Post by vovchik »

Dear all,

I updated gxlat. It now allows you to select the translation engine via a combbox and also can let you hear the translation (if the service provides this option) by enabling the Sound checkbox. Google and Bing are pretty good regarding sound availability. You need to have mplayer, mpv, espeak or mpg123 installed to get sound. You first will hear the translation and then get the translated text in the bottom text box. Enjoy. :)

With kind regards,
vovchik
Attachments
fltk139.png
(69.32 KiB) Downloaded 982 times
gxlat.pet
(45.46 KiB) Downloaded 392 times

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#52 Post by BarryK »

What a great app!

I have posted about it on my blog:

http://bkhome.org/news/201807/gxlat-lan ... lator.html

Fixed a couple of things in the PET, and bumped the version to 0.4, uploaded here:

http://distro.ibiblio.org/easyos/noarch ... at-0.4.pet

...let me know if I did anything wrong with the changes that I made.
[url]https://bkhome.org/news/[/url]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#53 Post by technosaurus »

When L18l was using my alternative to gettext, I wrote up a shell function that used Google translate to automatically generate translated strings. That function could be useful to add to your app for .po files. Let me know if you are interested and I will dig up the thread. One part that I know will need to be changed (besides using po files) is that it generates results for all supported language even if it already exists. Honestly, it probably belongs in the woof build process too, but it needs to be tested and having a nice GUI for translating installed apps could help with our severe lack of localization.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#54 Post by MochiMoppel »

I can't get any version to work in slacko 5.6 :cry:
Obviously a problem with trans and not with the gxlat GUI

Code: Select all

trans -e google -brief -sl en -tl fr Example
Attachments
gxlat.png
(23.41 KiB) Downloaded 688 times

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#55 Post by slavvo67 »

The "Swap" button only moves to: over to the from:field but the to: field stays the same. Would be nice if you started typing the language in the box and it goes to that letter. Overall, minor issues. Well done!

Slavvo67

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#56 Post by Argolance »

Bonjour,
MochiMoppel wrote:I can't get any version to work in slacko 5.6 :cry:
Obviously a problem with trans and not with the gxlat GUI
I had the same issue running Puppy 5.7.1/ToOpPy 2.2 and it appears that "trans" had nothing to do with! I compiled/installed latest gawk release from :arrow: sources here, then gxlat worked great, though "Google" engine is far from giving the best translations: nothing to do with the results obtained with DeepL which seems not working here!

Code: Select all

#trans -e google -brief -sl en -tl fr "The "Swap" button only moves to: over to the from:field but the to: field stays the same. Would be nice if you started typing the language in the box and it goes to that letter. Overall, minor issues. Well done!"
Le bouton Permuter ne se déplace que vers: sur le champ from: mais le champ to: reste le même. Serait bien si vous avez commencé à taper la langue dans la boîte et il va à cette lettre. Dans l'ensemble, problèmes mineurs. Bien joué! 
It might be nice to change the image displayed at the top of the window according to the selected engine.

@vovchik
Thank you for this "great app"!
May I say that it is a pity that such a GUI was not built to allow internationalization? :(


Cordialement.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#57 Post by MochiMoppel »

Argolance wrote:I had the same issue running Puppy 5.7.1/ToOpPy 2.2 and it appears that "trans" had nothing to do with! I compiled/installed latest gawk release from :arrow: sources here, then gxlat worked great
Bonjour Argolance
well, IMO trans has something to do with it Error detection is one of the jobs of a script, and if gawk spills out errors trans should handle this situation and not go on as if nothing has happened.

Nevertheless that wouldn't help me much as my ultimate goal is to use trans in my own projects. I can't expect users to update to the latest gawk just for using my program.

I have gawk version 3.1.8 , which is 8 years old, but so is gxlat. I wonder why gxlat ever worked before and why it now requires the newest gawk. Maybe there is another reason?

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#58 Post by BarryK »

MochiMoppel wrote:
Argolance wrote:I had the same issue running Puppy 5.7.1/ToOpPy 2.2 and it appears that "trans" had nothing to do with! I compiled/installed latest gawk release from :arrow: sources here, then gxlat worked great
Bonjour Argolance
well, IMO trans has something to do with it Error detection is one of the jobs of a script, and if gawk spills out errors trans should handle this situation and not go on as if nothing has happened.

Nevertheless that wouldn't help me much as my ultimate goal is to use trans in my own projects. I can't expect users to update to the latest gawk just for using my program.

I have gawk version 3.1.8 , which is 8 years old, but so is gxlat. I wonder why gxlat ever worked before and why it now requires the newest gawk. Maybe there is another reason?
argolance,
Were you previously using the busybox gawk applet in ToOpPy?
[url]https://bkhome.org/news/[/url]

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#59 Post by Keef »

The trans script is from here:
https://github.com/soimort/translate-shell
Dependencies

GNU Awk (gawk) 4.0 or later
This program relies heavily on GNU extensions of the AWK language, which are non-portable for other AWK implementations (e.g. nawk).
How to get gawk:
gawk comes with all GNU/Linux distributions.
On FreeBSD, gawk is available in the ports.
On macOS, gawk is available in MacPorts and Homebrew.
GNU Bash or Zsh
You may use Translate Shell from any Unix shell of your choice (bash, zsh, ksh, tcsh, fish, etc.); however, the wrapper script requires either bash or zsh installed.
I used to use the translate cli script that it used to be, but it stopped working a while back.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#60 Post by vovchik »

Dear all,

Thanks for the comments. The trans prog (including URL) is explained in the readme - click that button in Help. Many have given me a lot of good suggestions, so I will try to incorporate those in a subsequent version (favourites, swap fix, logo change depending on xlat engine). I didn't run into any problems with trans or gawk since I am using version 4.0.1. Version 4.0 is a requirement, it seems. Let's hope Google does not change its API. :)

With kind regards,
vovchik

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#61 Post by Argolance »

Bonsoir,

@BarryK
argolance,
Were you previously using the busybox gawk applet in ToOpPy?
[EDIT]: In Precise/ToOpPy, gawk is a script apart inside /bin as well as awk which is a sym-link to it.
By the way, I had to delete both to use the gawk release I compiled/installed and that have gawk and the sym-link inside /usr/bin (./configure --prefix=/usr --localedir=/usr/share/locale) otherwise the old had precedence over the new.

@vovchik
Many have given me a lot of good suggestions [...]
... And what about the internationalization of your program? :roll:

@Keef
I noticed that gxlat works perfectly running Slacko 6 which uses a version of gawk after release 4.

@all
Translation using deepl was not working with trans 0.9.6.7 (integrated to the gxlat-0.4 package) and works now with the 0.9.6.8 release :D.
:arrow: Download latest trans 0.9.6.8 release.

Code: Select all

# trans -e deepl "Check for upgrade of this program"
Check for upgrade of this program

Vérifier la mise à jour de ce programme

[ English -> Français ]

    Vérifier la mise à niveau de ce programme
    Vérifier la mise à jour de ce programme.
    Vérification de la mise à jour de ce programme
    Vérifiez la mise à jour de ce programme.
    Vérifier la mise à niveau de ce programme.
    Vérification de la mise à niveau de ce programme
Cordialement.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#62 Post by vovchik »

Dear Argolance,

Thanks for discovering that trans has updated and deepl now works. I haven't forgotten about your internationalization request. :) I am thinking - also about how to improve gxlat as a whole. The new trans is in the attached archive. It should be unpacked and copied to /usr/local/bin.

With kind regards,
vovchik
Attachments
trans.tar.gz
(40.08 KiB) Downloaded 425 times

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#63 Post by Argolance »

Bonjour,
vovchik wrote:I haven't forgotten about your internationalization request.
Thank you very much: that's great news! I would be happy to do the French translation. :D
The new trans is in the attached archive. It should be unpacked and copied to /usr/local/bin.
:!: However, please let me specify that your pet package has gxlat and trans files in /usr/local/bin while Barry's package has them in /usr/bin!

Cordialement.

User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

#64 Post by 666philb »

hi vovchik,

the swap button isn't working for me. i'm presuming that it's supposed to change the direction of translation, however clicking on it resets both languages to english.

thanks

BTW gxlat is included in bionicpup64
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

Post Reply