The time now is Mon 18 Jan 2021, 09:40
All times are UTC - 4 |
Author |
Message |
vovchik

Joined: 23 Oct 2006 Posts: 1538 Location: Ukraine
|
Posted: Fri 06 Jul 2018, 06:53 Post subject:
|
|
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
Description |
|

Download |
Filename |
gxlat.tar.gz |
Filesize |
44.67 KB |
Downloaded |
457 Time(s) |
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1538 Location: Ukraine
|
Posted: Mon 09 Jul 2018, 04:38 Post subject:
|
|
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
Description |
|

Download |
Filename |
gxlat.pet |
Filesize |
44.82 KB |
Downloaded |
478 Time(s) |
|
Back to top
|
|
 |
musher0
Joined: 04 Jan 2009 Posts: 15041 Location: Gatineau (Qc), Canada
|
Posted: Mon 09 Jul 2018, 16:00 Post subject:
|
|
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)
|
Back to top
|
|
 |
mikeslr

Joined: 16 Jun 2008 Posts: 3913 Location: 500 seconds from Sol
|
Posted: Mon 09 Jul 2018, 16:29 Post subject:
Thanks |
|
Thank you, vovchik, and thank your friend for us.
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1538 Location: Ukraine
|
Posted: Mon 09 Jul 2018, 17:12 Post subject:
|
|
@ 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
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1538 Location: Ukraine
|
Posted: Tue 10 Jul 2018, 08:11 Post subject:
|
|
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
Description |
|
Filesize |
69.32 KB |
Viewed |
1010 Time(s) |

|
Description |
|

Download |
Filename |
gxlat.pet |
Filesize |
45.46 KB |
Downloaded |
440 Time(s) |
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 9400 Location: Perth, Western Australia
|
Posted: Sat 28 Jul 2018, 10:11 Post subject:
|
|
What a great app!
I have posted about it on my blog:
http://bkhome.org/news/201807/gxlat-language-translator.html
Fixed a couple of things in the PET, and bumped the version to 0.4, uploaded here:
http://distro.ibiblio.org/easyos/noarch/packages/pet/pet_packages-noarch/gxlat-0.4.pet
...let me know if I did anything wrong with the changes that I made.
_________________ https://bkhome.org/news/
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: Sat 28 Jul 2018, 19:04 Post subject:
|
|
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 github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
MochiMoppel

Joined: 26 Jan 2011 Posts: 2084 Location: Japan
|
Posted: Sat 04 Aug 2018, 09:46 Post subject:
|
|
I can't get any version to work in slacko 5.6
Obviously a problem with trans and not with the gxlat GUI
Code: | trans -e google -brief -sl en -tl fr Example |
Description |
|
Filesize |
23.41 KB |
Viewed |
719 Time(s) |

|
|
Back to top
|
|
 |
slavvo67
Joined: 12 Oct 2012 Posts: 1625 Location: The other Mr. 305
|
Posted: Sat 04 Aug 2018, 22:56 Post subject:
|
|
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
|
Back to top
|
|
 |
Argolance

Joined: 06 Jan 2008 Posts: 3822 Location: PORT-BRILLET (Mayenne - France)
|
Posted: Wed 08 Aug 2018, 08:15 Post subject:
|
|
Bonjour,
MochiMoppel wrote: | I can't get any version to work in slacko 5.6
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 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: | #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.
_________________
Puppy Search
|
Back to top
|
|
 |
MochiMoppel

Joined: 26 Jan 2011 Posts: 2084 Location: Japan
|
Posted: Tue 14 Aug 2018, 00:46 Post subject:
|
|
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 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?
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 9400 Location: Perth, Western Australia
|
Posted: Tue 14 Aug 2018, 08:26 Post subject:
|
|
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 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?
_________________ https://bkhome.org/news/
|
Back to top
|
|
 |
Keef

Joined: 20 Dec 2007 Posts: 1001 Location: Staffordshire
|
Posted: Tue 14 Aug 2018, 14:48 Post subject:
|
|
The trans script is from here:
https://github.com/soimort/translate-shell
Quote: | 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.
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1538 Location: Ukraine
|
Posted: Tue 14 Aug 2018, 16:17 Post subject:
|
|
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
|
Back to top
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|