Google translator (standalone) updated

Stuff that has yet to be sorted into a category.
Message
Author
User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#16 Post by ttuuxxx »

trapster wrote:Thanks ttuuxxx.
Can the items be a list of items in a file.
ie. all the different "2 letter" languages?
like this default example

#! /bin/bash

export MAIN_DIALOG='
<vbox>
<hbox>
<text>
<label>value-in-list:</label>
</text>
<combobox case-sensitive="false" value-in-list="true">
<variable>COMBOBOX1</variable>
<item>First</item>
<item>Second</item>
<item>Third</item>
</combobox>
</hbox>
<hbox>
<text>
<label>allow-empty:</label>
</text>
<combobox allow-empty="false" value-in-list="true">
<variable>COMBOBOX2</variable>
<item>First</item>
<item>Second</item>
<item>Third</item>
</combobox>
</hbox>
<hbox>
<button ok></button>
<button cancel></button>
</hbox>
</vbox>
'

gtkdialog3 --program=MAIN_DIALOG


ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#17 Post by big_bass »

trapster all the default gtk examples are here
http://www.murga-linux.com/puppy/viewtopic.php?t=38608

nice start though
note :gxmessage still looks good in older puppy versions
compared to xmessage
its very blocky looking in puppy 4 +
like 1980 graphics

nice job trapster

big_bass

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#18 Post by big_bass »

Code: Select all

#!/bin/sh
echo '--referer="http://www.google.com"
--user-agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080129 Iceweasel/2.0.0.12 (Debian-2.0.0.12-0etch1)"'>>/etc/wgetrc

I made you a quick setup script
you need to add this in the package
to set up the defaults

thanks its working now
big_bass

User avatar
Alex Snet
Posts: 3
Joined: Sun 01 Mar 2009, 10:35
Location: Russia, Moscow
Contact:

#19 Post by Alex Snet »

Hi 2 all.

I'm Alex Snet and this topic is about Translator.

I will translate my page to english in nearly time.

Thanks to all for comments.

What's about GTK? I think this is real. But it will takes some time for porting and learning this library.

With best regards,
Alex Snet.

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#20 Post by ttuuxxx »

Hi Alex

Welcome to puppy :)
If you ever need anything just ask :) We're here to help :)
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#21 Post by trapster »

big_bass wrote:

Code: Select all

#!/bin/sh
echo '--referer="http://www.google.com"
--user-agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080129 Iceweasel/2.0.0.12 (Debian-2.0.0.12-0etch1)"'>>/etc/wgetrc

I made you a quick setup script
you need to add this in the package
to set up the defaults

thanks its working now
big_bass
Yes, I mentioned this in the /usr/local/Ptranslate/ptranslate.sh (I think). Maybe it is in /usr/local/bin/Ptranslate.

You can add an alias to your profile or add what you have above to /etc/wgetrc manually.

ie.

Code: Select all

--referer="http://www.google.com"
--user-agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080129 Iceweasel/2.0.0.12 (Debian-2.0.0.12-0etch1)"'
I like your "automatic" way better and will add it.
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#22 Post by big_bass »

I'm Alex Snet and this topic is about Translator.

What's about GTK? I think this is real. But it will takes some time for porting and learning this library.
Welcome to puppy Alex

GTK is already working :D

thanks for sharing your work
it will be used well and help many people

Thank you
big_bass

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

#23 Post by vovchik »

Dear Puppians,

Here is Alex's latest binary with some minor bugfixes.

With kind regards,
Vovchik
Attachments
translator090302.tar.gz
(126.58 KiB) Downloaded 306 times

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

#24 Post by vovchik »

Dear trapster,

I thing you are also onto something. I played with the code a little and came up with this in gtkdialog - I still have not introduced combo boxes since I don't know how to get the language text to display with the corresponding flag in a gtkdialog list. Is it not possible? And I haven't yet done the paste and clear routines. The script should idally loop until the user wishes to exit, since there might be more than one text to be translated at a sitting. This is accomplished in gtkdialog by running the external things with an ampersand at the end. I am also trying to remove all external gtk utilities such as gtkmessage (Xmessage in your version) and gxdialog. gtkdialog can take care of all of that, but better as separately loaded scripts, I think. Incidentally, Cyrillic and Latin charsets with diacriticals appear properly in gtkdialog.

In any case, I am looking at the code and fiddling. Here is a preliminary screenshot.

With kind regards,
vovchik

PS. I basically borrowed Alex's concept - lock stock and barrel. His program is better, of course, but requires the qt4 libs which some users may not have. And Alex is making improvements every day.
Attachments
ptranslate1.jpg
(41.01 KiB) Downloaded 332 times

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#25 Post by trapster »

Very nice!!
Your talents are obviously far ahead of mine.
Don't stop now.
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#26 Post by ttuuxxx »

vovchik
Thats looking really good :) two thumbs up :)
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

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

#27 Post by vovchik »

Dear trapster and ttuuxxx,

I couldn't have made any progress without you two and Alex Snet. And I am still plugging along. I have the combo boxes working nicely now but have a number of things on my "todo" list:

1. Make the "clear" button clear the source language box - edit box in gtkdialog.
2. Make the "swap" button change "from" to "to".
3. Make the "settings restore" routine work with combobox choice selection.
4. Change the file locations so that the prog works in any old *nix (not everybody has r/w access to files in /usr).
5. Fix the "waiting for Google routine", so that it is easy to kill within gtkdialog (there is a gtkdialog function to kill a window).
6. Ensure that the program does not exit until the user really wants to say "quit" and end it all.
7. Make a proper pet with these changes.
8. Figure out how to display language flags in a combobox list - I am stumpted at the moment.
9. Fix up the sed routines provided by trapster (perhaps trapster/ttuuxxx can really help, since I am not very competent with sed) so that the prog does not exit unexpectedly when the source contains various OS-sensitive symbols "<"'& etc (i.e filtering).
10. Add error message when user has no inet connectivity or when google translate is down.
11. Provide a check of /etc/wgetrc to ensure that the necessary options are there before the gui is invoked and if not, to fix it.

No additionaly utilities are now required to run Ptranslate (my version - no Xmessage or anything else), apart from gtkdialog and the standard Unix cli utils.

Thanks for the encouragement and I hope you guys can help.

With kind regards,
vovchik

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#28 Post by trapster »

I updated (for what it's worth) Ptranslate.
I added a check for the --referer in /etc/wgetrc, combo boxes for the language and to continue when hitting "ok" in xmessage.

This might cover your #6 + #11 issues.
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

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

#29 Post by vovchik »

Dear trapster,

Thanks for your update. I will borrow the wgetrc update and checking routine, if you don't mind. I have done most of the things on my todo list, including coding (in C/GTK2) of a little wait screen display routine, since it is very difficult to kill the a process that gtkdialog itself spawns if the child relies on gtkdialog. I spent some hours testing all sorts of kill methods and it was simpler to duplicate the gtkdialog routine in straight C. Your kill pid routine now works with that program perfectly, as it does for Xdialog in your version. Only swap keys, paste and looping left, so there is light at the end of the tunnel.

With kind regards,
vovchik

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#30 Post by trapster »

Well stop teasing us and give us a peak. :)
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

Thor
Posts: 41
Joined: Wed 21 Feb 2007, 12:38

#31 Post by Thor »

Greetings:
Using Translator090302 in Puppy-4.2.0-RC2 frugal install and works perfect, thanks for your effort.
How do I change the size of the text to be translated and translated in translator090302?

Thor

(translation with Translator090302)

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#32 Post by trapster »

Ok, ok...
Lets break this down to simplicity.
Since we need to be online anyway...
Paste this into a console, or make it a script.

Code: Select all

gtkmoz http://www.translate.google.com/translate_t#
Can't get much smaller than that :D
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

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

#33 Post by vovchik »

Dear Thor,

Without checking the code (which i will do), I think I can say the following:

The font for QT4 apps/widgets (i.e. the two display windows in translator) is determined by the style settings of QT4. I use the GTK style, so that my QT apps look like my GTK apps. In this configuration, QT simply looks at my GTK settings and mirrors them. So, if you are using the GTK style for QT, adjust your GTK settings, where such text must also appear small.

If you are not certain what style your QT4 apps are using, navigate to /opt/qt4/bin and run qtconfig. Select a style. Use the fonts tab to select your default font and font size.

I hope that this explanation solves your font problem. The styles setting will aslo affect the appearance of ther QT4 apps, such as the latest Opera, if you are using shared libraries.

With kind regards,
vovchik

Thor
Posts: 41
Joined: Wed 21 Feb 2007, 12:38

#34 Post by Thor »

Sincerely:

Thanks for your indication trapster, but that is not what we wanted to achieve what I want is to see the text larger in windows translator090302.

vovchik:
stardust is the GTK theme and the path "/ opt/qt4/bin" does not appear qtconfig or bin in the path "~ / .config / AlexSnet is Translator.conf, which, if I am not mistaken, the languages selected .

Although not currently able to fix it, you appreciate the help, I will strive to see.

See you soon.

Thor

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#35 Post by trapster »

Thor:
Sorry, that post was not meant to address your font issue. It was just another suggestion for translating.
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

Post Reply