gxlat - Desktop Google Translator redux
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
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
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
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 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
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
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
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
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
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.
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]
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
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].
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
I can't get any version to work in slacko 5.6
Obviously a problem with trans and not with the gxlat GUI
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
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Bonjour,
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.
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!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
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é!
@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.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Bonjour ArgolanceArgolance 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
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?
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
argolance,MochiMoppel wrote:Bonjour ArgolanceArgolance 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
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?
Were you previously using the busybox gawk applet in ToOpPy?
[url]https://bkhome.org/news/[/url]
The trans script is from here:
https://github.com/soimort/translate-shell
https://github.com/soimort/translate-shell
I used to use the translate cli script that it used to be, but it stopped working a while back.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.
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
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
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Bonsoir,
@BarryK
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
@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 .
Download latest trans 0.9.6.8 release.
Cordialement.
@BarryK
[EDIT]: In Precise/ToOpPy, gawk is a script apart inside /bin as well as awk which is a sym-link to it.argolance,
Were you previously using the busybox gawk applet in ToOpPy?
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
... And what about the internationalization of your program?Many have given me a lot of good suggestions [...]
@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 .
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
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
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
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Bonjour,
Cordialement.
Thank you very much: that's great news! I would be happy to do the French translation.vovchik wrote:I haven't forgotten about your internationalization request.
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!The new trans is in the attached archive. It should be unpacked and copied to /usr/local/bin.
Cordialement.
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
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
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331