Google translator (standalone) updated

Stuff that has yet to be sorted into a category.
Message
Author
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

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

#36 Post by vovchik »

Dear Thor,

Here is qtconfig and the GTK QT4 style. Copy the file libgtkstyle.so into your /opt/qt4/plugins/styles folder and run qtconfig (for qt4). It is usually in /opt/qt4/bin. If you don't have it, I have attached it. Select GTK as the style and say "save" in the file menu. Both files are in the archived attachment. You may have to copy these files into /usr/lib/qt4, depending on your build of qt4.

With kind regards,
vovchik
Attachments
qt-styles.tar.bz2
(141.36 KiB) Downloaded 407 times

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

#37 Post by Thor »

Vovchik Hey, thanks again:

I followed your directions, but when I save the changes, it does not, the console returns
the following message "Segmentation fault", I do dmesg in the console and a long list (I think it is system information)
at the end of this list makes:

qtconfig [3912]: segfault at c ip b79a148d sp bfff8620 error 4 in libQtGui.so.4.3.2 [b77db000 519000]
qtconfig.0 [5988]: segfault at c ip b795448d sp bfda9830 error 4 in libQtGui.so.4.3.2 [b778e000 519000]
qtconfig [6322]: segfault at c ip b78db48d sp bfc30650 error 4 in libQtGui.so.4.3.2 [b7715000 519000]
qtconfig.0 [9699]: segfault at c ip b791048d sp bfe680d0 error 4 in libQtGui.so.4.3.2 [b774a000 519000]
qtconfig [10139]: segfault at c ip b78cf48d sp bfd26f40 error 4 in libQtGui.so.4.3.2 [b7709000 519000]
qtconfig [15199]: segfault at c ip b799648d sp bfcebf10 error 4 in libQtGui.so.4.3.2 [b77d0000 519000]

I ldd / opt/qt4/bin/qtconfig console and returns this:

linux-gate.so.1 => (0xffffe000)
libQt3Support.so.4 => / opt/qt4/lib/libQt3Support.so.4 (0xb7d20000)
libQtSql.so.4 => / opt/qt4/lib/libQtSql.so.4 (0xb7cf6000)
libQtXml.so.4 => / opt/qt4/lib/libQtXml.so.4 (0xb7cb6000)
libQtNetwork.so.4 => / opt/qt4/lib/libQtNetwork.so.4 (0xb7c44000)
libQtGui.so.4 => / opt/qt4/lib/libQtGui.so.4 (0xb7709000)
libpng.so.3 => / usr/lib/libpng.so.3 (0xb76e1000)
libSM.so.6 => / usr/X11R7/lib/libSM.so.6 (0xb76d9000)
libICE.so.6 => / usr/X11R7/lib/libICE.so.6 (0xb76c5000)
libXi.so.6 => / usr/X11R7/lib/libXi.so.6 (0xb76bd000)
libXrender.so.1 => / usr/X11R7/lib/libXrender.so.1 (0xb76b6000)
libXrandr.so.2 => / usr/X11R7/lib/libXrandr.so.2 (0xb76b0000)
libfreetype.so.6 => / usr/lib/libfreetype.so.6 (0xb764f000)
libfontconfig.so.1 => / usr/X11R7/lib/libfontconfig.so.1 (0xb7628000)
libXext.so.6 => / usr/X11R7/lib/libXext.so.6 (0xb761c000)
libX11.so.6 => / usr/X11R7/lib/libX11.so.6 (0xb754b000)
libQtCore.so.4 => / opt/qt4/lib/libQtCore.so.4 (0xb7430000)
libz.so.1 => / lib/libz.so.1 (0xb7421000)
libgthread-2.0.so.0 => / usr/lib/libgthread-2.0.so.0 (0xb741d000)
librt.so.1 => / lib/librt.so.1 (0xb7409000)
libglib-2.0.so.0 => / usr/lib/libglib-2.0.so.0 (0xb737c000)
libpthread.so.0 => / lib/libpthread.so.0 (0xb7367000)
libdl.so.2 => / lib/libdl.so.2 (0xb7363000)
libstdc. so.6 => / usr / lib / libstdc. so.6 (0xb727c000)
libm.so.6 => / lib/libm.so.6 (0xb725a000)
libgcc_s.so.1 => / usr/lib/libgcc_s.so.1 (0xb724e000)
libc.so.6 => / lib/libc.so.6 (0xb7153000)
libsqlite3.so.0 => / usr/lib/libsqlite3.so.0 (0xb70f5000)
libpng12.so.0 => / usr/lib/libpng12.so.0 (0xb70d0000)
libXfixes.so.3 => / usr/X11R7/lib/libXfixes.so.3 (0xb70cc000)
libXcursor.so.1 => / usr/X11R7/lib/libXcursor.so.1 (0xb70c4000)
libexpat.so.1 => / usr/lib/libexpat.so.1 (0xb70a7000)
libXau.so.6 => / usr/X11R7/lib/libXau.so.6 (0xb70a4000)
libXdmcp.so.6 => / usr/X11R7/lib/libXdmcp.so.6 (0xb709f000)
/ lib/ld-linux.so.2 (0xb7f12000)

I see that the library gives libQtGui.so.4.3.2 errors but not to do.

Best regards.

Thor

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

#38 Post by vovchik »

Dear Thor,

I am sorry you are having problems. It could be that my newer version of QT4 is acting up on your system. Here are QT4.3.1 versions of the two files. Please try them and report the results.

With kind regards,
vovchik
Attachments
qtconfig-4.3.1.tar.gz
(118.65 KiB) Downloaded 364 times

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

#39 Post by Thor »

Hello vovchik:

Indeed, you're right, putting the "QT4.3.1" works perfectly.

My eyes and I appreciate the help offered.

Best regards.

Thor

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

New version is coming

#40 Post by Alex Snet »

Hi 2 all.

New version with more dictionaries and offline mode is coming.
But I need your help!
Can U draw for me a new icon ( 512, 256, 128, 64, 32, 24 and 16 pixels).
Icon must be in PNG.

Also I can say, that in the new version will be two authors: me and lexnewton. ( http://qt-apps.org/content/show.php/Goo ... ent=100039 and http://qt-apps.org/content/show.php/QGo ... ent=100713 )

Some features of new version:
1. Support more dictionaries (e.g. Yandex, DICT, PROMT, Google, etc. )
2. Improved dictionary.
3. Offline mode and caching.
4. Proxy, fonts and more settings.
5. Tray icon.
6. Rich text translations.
7. and more, and more, and more...

Please, send icon to my mail: me [at] alexsnet.ru

Big thx!

Post Reply