Commits

Anonymous committed 3f9e9e5

Initial release

Comments (0)

Files changed (11)

+Just run the script from your terminal:
+
+	python gtkpyglot.py
+                   GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+  This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+  0. Additional Definitions.
+
+  As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+  "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+  An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+  A "Combined Work" is a work produced by combining or linking an
+Application with the Library.  The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+  The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+  The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+  1. Exception to Section 3 of the GNU GPL.
+
+  You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+  2. Conveying Modified Versions.
+
+  If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+   a) under this License, provided that you make a good faith effort to
+   ensure that, in the event an Application does not supply the
+   function or data, the facility still operates, and performs
+   whatever part of its purpose remains meaningful, or
+
+   b) under the GNU GPL, with none of the additional permissions of
+   this License applicable to that copy.
+
+  3. Object Code Incorporating Material from Library Header Files.
+
+  The object code form of an Application may incorporate material from
+a header file that is part of the Library.  You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+   a) Give prominent notice with each copy of the object code that the
+   Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the object code with a copy of the GNU GPL and this license
+   document.
+
+  4. Combined Works.
+
+  You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+   a) Give prominent notice with each copy of the Combined Work that
+   the Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
+   document.
+
+   c) For a Combined Work that displays copyright notices during
+   execution, include the copyright notice for the Library among
+   these notices, as well as a reference directing the user to the
+   copies of the GNU GPL and this license document.
+
+   d) Do one of the following:
+
+       0) Convey the Minimal Corresponding Source under the terms of this
+       License, and the Corresponding Application Code in a form
+       suitable for, and under terms that permit, the user to
+       recombine or relink the Application with a modified version of
+       the Linked Version to produce a modified Combined Work, in the
+       manner specified by section 6 of the GNU GPL for conveying
+       Corresponding Source.
+
+       1) Use a suitable shared library mechanism for linking with the
+       Library.  A suitable mechanism is one that (a) uses at run time
+       a copy of the Library already present on the user's computer
+       system, and (b) will operate properly with a modified version
+       of the Library that is interface-compatible with the Linked
+       Version.
+
+   e) Provide Installation Information, but only if you would otherwise
+   be required to provide such information under section 6 of the
+   GNU GPL, and only to the extent that such information is
+   necessary to install and execute a modified version of the
+   Combined Work produced by recombining or relinking the
+   Application with a modified version of the Linked Version. (If
+   you use option 4d0, the Installation Information must accompany
+   the Minimal Corresponding Source and Corresponding Application
+   Code. If you use option 4d1, you must provide the Installation
+   Information in the manner specified by section 6 of the GNU GPL
+   for conveying Corresponding Source.)
+
+  5. Combined Libraries.
+
+  You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+   a) Accompany the combined library with a copy of the same work based
+   on the Library, uncombined with any other library facilities,
+   conveyed under the terms of this License.
+
+   b) Give prominent notice with the combined library that part of it
+   is a work based on the Library, and explaining where to find the
+   accompanying uncombined form of the same work.
+
+  6. Revised Versions of the GNU Lesser General Public License.
+
+  The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+  Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+  If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
+-*- markdown -*-
+gtkPyglot
+=========
+
+A simple desktop tool aimed to help translators providing them the 
+services from pylyglot.org and google translate directly on their 
+desktop in simple and clean interface.
+
+Introduction
+-------------
+
+gtkPyglot was inspired by the pylyglot.org website, and since always 
+having a webbrowser opened to check a translation the developer (that
+would be me) decided that he needs a tool for easely working with the
+website. The Idea borned and after a couple of hours the tool was 
+working and giving the results. Some more polishing and in the last
+minute adding the support for google translate - the gtkPyglot tool
+was ready to publish for testing. 
+
+This application will not translate a whole application. It gives
+you the possibility to check how other have translated a particular 
+term from english in your language. Ofcourse that doesn't mean the 
+results will be always corrent, but it schould give you a hint how 
+you could translate a specific menu label, button, description etc.
+
+Requirements
+------------
+
+*  Internet connection - since the application still needs to access
+the services from pylyglot and google
+*  Python >= 2.6
+*  PyGTK  >= 2.16
+*  python-simplejson
+
+Installation
+------------
+
+There is no installation needed, just download the archive, extract and
+run from the terminal:
+	
+	$ python gtkpyglot.py
+	
+If you like the application and want to contribute, a package for your
+favorite distribution will be appritiated, but that's just an example,
+any help is welcome.

data/flattr-badge-large.png

Added
New image

data/google.png

Added
New image

data/logo.png

Added
New image
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy project-wide -->
+  <object class="GtkWindow" id="window1">
+    <property name="width_request">600</property>
+    <property name="height_request">500</property>
+    <property name="title" translatable="yes">gtkPyglot 1.0</property>
+    <property name="window_position">center</property>
+    <property name="default_width">600</property>
+    <property name="default_height">500</property>
+    <property name="icon">logo.svg</property>
+    <signal name="destroy" handler="on_window1_destroy"/>
+    <child>
+      <object class="GtkVBox" id="vbox1">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkToolbar" id="toolbar1">
+            <property name="visible">True</property>
+            <property name="toolbar_style">icons</property>
+            <property name="icon_size">6</property>
+            <property name="icon_size_set">True</property>
+            <child>
+              <object class="GtkToolButton" id="paste_button">
+                <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">Paste term from
+your clipboard</property>
+                <property name="label" translatable="yes">Paste from clipboard</property>
+                <property name="use_underline">True</property>
+                <property name="stock_id">gtk-paste</property>
+                <signal name="clicked" handler="paste_button_clicked"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="copy_button">
+                <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">Copy selection
+to the clipboard</property>
+                <property name="label" translatable="yes">Copy selected to clipboard</property>
+                <property name="use_underline">True</property>
+                <property name="stock_id">gtk-copy</property>
+                <signal name="clicked" handler="copy_button_clicked"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="clear_button">
+                <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">Clear searchbox</property>
+                <property name="label" translatable="yes">Clear the search box</property>
+                <property name="use_underline">True</property>
+                <property name="stock_id">gtk-clear</property>
+                <signal name="clicked" handler="clear_button_clicked"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSeparatorToolItem" id="toolbutton3">
+                <property name="visible">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="about_button">
+                <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">About this application</property>
+                <property name="label" translatable="yes">About</property>
+                <property name="use_underline">True</property>
+                <property name="stock_id">gtk-about</property>
+                <signal name="clicked" handler="about_button_clicked"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSeparatorToolItem" id="toolbutton5">
+                <property name="visible">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="quit_button">
+                <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">Quit the application</property>
+                <property name="label" translatable="yes">Quit</property>
+                <property name="use_underline">True</property>
+                <property name="stock_id">gtk-quit</property>
+                <signal name="clicked" handler="quit_button_clicked"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkImage" id="image1">
+            <property name="visible">True</property>
+            <property name="pixbuf">logo.png</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="padding">34</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="hbox1">
+            <property name="visible">True</property>
+            <property name="spacing">5</property>
+            <child>
+              <object class="GtkComboBox" id="combobox1">
+                <property name="height_request">40</property>
+                <property name="visible">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="padding">5</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="entry1">
+                <property name="height_request">40</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">&#x2022;</property>
+                <property name="primary_icon_stock">gtk-find</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button1">
+                <property name="label">gtk-ok</property>
+                <property name="width_request">64</property>
+                <property name="height_request">40</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="search_button_clicked"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button2">
+                <property name="height_request">40</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="translate_button_clicked"/>
+                <child>
+                  <object class="GtkHBox" id="hbox2">
+                    <property name="visible">True</property>
+                    <child>
+                      <object class="GtkImage" id="image2">
+                        <property name="visible">True</property>
+                        <property name="pixbuf">google.png</property>
+                      </object>
+                      <packing>
+                        <property name="padding">3</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="padding">5</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="border_width">7</property>
+            <property name="hscrollbar_policy">automatic</property>
+            <property name="vscrollbar_policy">automatic</property>
+            <child>
+              <object class="GtkTreeView" id="treeview1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="rules_hint">True</property>
+                <property name="enable_grid_lines">horizontal</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="position">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkStatusbar" id="statusbar1">
+            <property name="visible">True</property>
+            <property name="spacing">2</property>
+            <property name="homogeneous">True</property>
+            <child>
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label3">
+                <property name="visible">True</property>
+                <property name="use_markup">True</property>
+                <property name="justify">right</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">4</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkAboutDialog" id="aboutdialog1">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">About gtkPyglot</property>
+    <property name="window_position">center</property>
+    <property name="destroy_with_parent">True</property>
+    <property name="icon">logo.svg</property>
+    <property name="type_hint">normal</property>
+    <property name="skip_taskbar_hint">True</property>
+    <property name="skip_pager_hint">True</property>
+    <property name="has_separator">False</property>
+    <property name="program_name">gtkPyglot</property>
+    <property name="version">1.0</property>
+    <property name="copyright" translatable="yes">Lincense: GNU/GPL v3</property>
+    <property name="comments" translatable="yes">GTK Frontend for the Pylyglot translations 
+website, using their xml-rpc service to retrieve 
+the translations and google translator.</property>
+    <property name="website">bitbucket.org/vkolev/gtkpyglot</property>
+    <property name="website_label" translatable="yes">Website</property>
+    <property name="license" translatable="yes">gtkPyglot Copyright 2011 Vladimir Kolev &lt;vladi@vladimirkolev.com&gt;
+      
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+       
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+       
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+MA 02110-1301, USA.</property>
+    <property name="authors">Vladimir Kolev &lt;vladi@vladimirkolev.com&gt;</property>
+    <property name="logo">logo_about.png</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkButton" id="button3">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="relief">none</property>
+            <property name="xalign">1</property>
+            <child>
+              <object class="GtkImage" id="image3">
+                <property name="visible">True</property>
+                <property name="pixbuf">flattr-badge-large.png</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">2</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
Added
New image
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="48"
+   height="48"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.0 r9654"
+   sodipodi:docname="logo.svg"
+   inkscape:export-filename="/home/vladi/Programming/pylyglot_api/app/data/logo_about.png"
+   inkscape:export-xdpi="120"
+   inkscape:export-ydpi="120">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="11.2"
+     inkscape:cx="15.310969"
+     inkscape:cy="28.497768"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1280"
+     inkscape:window-height="952"
+     inkscape:window-x="0"
+     inkscape:window-y="24"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-1004.3622)">
+    <path
+       sodipodi:type="arc"
+       style="fill:none;stroke:#8abb19;stroke-width:4.80000019;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path2985"
+       sodipodi:cx="22.991072"
+       sodipodi:cy="24.473215"
+       sodipodi:rx="18.348215"
+       sodipodi:ry="18.348215"
+       d="m 41.339287,24.473215 c 0,10.133439 -8.214776,18.348215 -18.348215,18.348215 -10.13344,0 -18.3482154,-8.214776 -18.3482154,-18.348215 0,-10.133439 8.2147754,-18.348215 18.3482154,-18.348215 10.133439,0 18.348215,8.214776 18.348215,18.348215 z"
+       transform="matrix(1.1160796,0,0,1.1182458,-1.6981065,1001.1198)" />
+    <text
+       xml:space="preserve"
+       style="font-size:51.96163559px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#8abb19;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial Bold"
+       x="685.19965"
+       y="806.15216"
+       id="text3755"
+       sodipodi:linespacing="125%"
+       transform="matrix(0.79040694,0.82236194,-0.6666666,0.57155211,0,0)"><tspan
+         sodipodi:role="line"
+         id="tspan3757"
+         x="685.19965"
+         y="806.15216">:</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:38.95692444px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#8abb19;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial Bold"
+       x="789.6394"
+       y="686.86133"
+       id="text3759"
+       sodipodi:linespacing="125%"
+       transform="matrix(0.67199624,0.73924598,-0.75311425,0.65962173,0,0)"><tspan
+         sodipodi:role="line"
+         id="tspan3761"
+         x="789.6394"
+         y="686.86133"
+         style="font-size:38.95692444px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#8abb19;fill-opacity:1;font-family:Arial;-inkscape-font-specification:Arial Bold">P</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:24.50785637px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Comfortaa;-inkscape-font-specification:Comfortaa"
+       x="15.065105"
+       y="1040.0009"
+       id="text2987"
+       sodipodi:linespacing="125%"
+       transform="scale(1.0160106,0.98424169)"><tspan
+         sodipodi:role="line"
+         id="tspan2989"
+         x="15.065105"
+         y="1040.0009"
+         style="font-size:84.02693939px">.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Comfortaa;-inkscape-font-specification:Comfortaa"
+       x="-789.80066"
+       y="670.32532"
+       id="text2991"
+       sodipodi:linespacing="125%"
+       transform="matrix(0.62048736,-0.78421645,0.78421645,0.62048736,0,0)"><tspan
+         sodipodi:role="line"
+         id="tspan2993"
+         x="-789.80066"
+         y="670.32532"
+         style="font-size:48px">\</tspan></text>
+  </g>
+</svg>

data/pyglot_35.png

Added
New image

data/pyglot_64.png

Added
New image
+#!/usr/env/bin python2.6
+#-*- encoding: utf-8 -*-
+
+import sys
+import pygtk
+pygtk.require("2.0")
+import gtk
+import xmlrpclib
+import urllib
+import simplejson
+
+
+SERVER_URL = "http://pylyglot.org/rpc_service/"
+GOOGLE_URL = "http://ajax.googleapis.com/ajax/services/language/translate"
+
+server = xmlrpclib.Server(SERVER_URL)
+langs_raw = server.get_languages()
+langs = []
+for lang in langs_raw:
+        langs.append(lang['short_name'])
+
+cur_path = sys.path[0]
+if cur_path != "":
+        cur_path = "%s/" % cur_path        
+
+stats = server.get_status()
+
+params = {}
+params['langpair'] = ""
+params['v'] = "1.0"
+params['q'] = ""
+
+class GtkPylyglot(object):
+        
+        def __init__(self):
+                builder = gtk.Builder()
+                builder.add_from_file("%sdata/main-gui.ui" % cur_path)
+                builder.connect_signals({
+                        "on_window1_destroy" : gtk.main_quit,
+                        "copy_button_clicked" : self.copy_click,
+                        "paste_button_clicked" : self.paste_click,
+                        "clear_button_clicked" : self.clear_click,
+                        "about_button_clicked" : self.show_about,
+                        "quit_button_clicked" : gtk.main_quit,
+                        "search_button_clicked" : self.search,
+                        'translate_button_clicked' : self.translate,
+                })
+                self.window = builder.get_object("window1")
+                self.searchbox = builder.get_object("entry1")
+                self.combobox = builder.get_object("combobox1")
+
+                # Show the languages in the combobox
+                self.langstore = gtk.ListStore(str)
+                self.langcell = gtk.CellRendererText()
+                self.combobox.pack_start(self.langcell)
+                self.combobox.add_attribute(self.langcell, 'text', 0)
+                self.combobox.set_model(self.langstore)
+                self.combobox.set_wrap_width(5)
+                langs.sort()
+                for lang in langs:
+                        self.langstore.append(['%s' % lang])
+                self.combobox.set_active(0)
+
+                # Show the statistics in the statusbar
+                self.label_langs = builder.get_object("label1")
+                self.label_langs.set_markup("<b>Languages: </b> %s" % stats['total_languages'])
+                self.label_packs = builder.get_object("label2")
+                self.label_packs.set_markup("<b>Packages: </b> %s" % stats['total_packages'])
+                self.label_trans = builder.get_object("label3")
+                self.label_trans.set_markup("<b>Translations: </b> %s" % stats['total_translations'])
+
+                # Prepare the table for the results
+                self.store = gtk.ListStore(str, str, str)
+                self.tree_view = builder.get_object('treeview1')
+                self.tree_view.set_model(self.store)
+                self.create_columns(self.tree_view)
+
+                self.window.show()
+
+        def copy_click(self, sender):
+                selection = self.tree_view.get_selection()
+                model, itern = selection.get_selected()
+                self.set_in_clipboard(model.get_value(itern, 0))
+
+        def set_in_clipboard(self, translation):
+                clipboard = gtk.clipboard_get("CLIPBOARD")
+                clipboard.set_text(translation)
+                clipboard.store()
+
+        def clear_click(self, sender):
+                self.searchbox.set_text("")
+
+        def paste_click(self, sender):
+                clip = gtk.Clipboard(display=gtk.gdk.display_get_default(), 
+                                     selection="CLIPBOARD")
+                if(clip.wait_is_text_available() == True):
+                        clip_text = clip.wait_for_text()
+                        self.searchbox.set_text(clip_text)
+
+        def create_columns(self, treeView):
+                rendererText = gtk.CellRendererText()
+                column = gtk.TreeViewColumn("Translation", rendererText, text=0)
+                column.set_fixed_width(365)
+                column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
+                column.set_resizable(True)
+                column.set_sort_column_id(0)
+                treeView.append_column(column)
+
+                rendererText = gtk.CellRendererText()
+                column = gtk.TreeViewColumn("Last update", rendererText, text=1)
+                column.set_sort_column_id(1)
+                treeView.append_column(column)
+
+                rendererText = gtk.CellRendererText()
+                column = gtk.TreeViewColumn("Standard", rendererText, text=2)
+                column.set_sort_column_id(2)
+                treeView.append_column(column)
+
+
+        def search(self, sender):
+                searchlang = self.combobox.get_active_text()
+                searchterm = self.searchbox.get_text()
+                if(searchterm == ""):
+                        dialog = gtk.MessageDialog(None, gtk.DIALOG_DESTROY_WITH_PARENT,
+                                                  gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE,
+                                                  "Nothing to search for...")
+                        dialog.run()
+                        dialog.destroy()
+                else:
+                        translations = server.get_translation(searchlang, searchterm)
+                        if not translations:
+                                resdialog = gtk.MessageDialog(None, gtk.DIALOG_DESTROY_WITH_PARENT,
+                                                             gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
+                                                              "Sorry no results for: %s" % searchterm)
+                                resdialog.run()
+                                resdialog.destroy()
+                        else:
+                                self.store.clear()
+                                for trans in translations:
+                                        self.store.append(['%s' % trans['translation'],
+                                                          '%s' % trans['updatedate'],
+                                                          '%s' % trans['standardized']])
+
+        def show_about(self, sender):
+                builder = gtk.Builder()
+                builder.add_from_file("%sdata/main-gui.ui" % cur_path)
+                self.about = builder.get_object("aboutdialog1")
+                self.about.run()
+                self.about.destroy()
+
+        def translate(self, sender):
+                if self.searchbox.get_text() == "":
+                        dialog = gtk.MessageDialog(None, gtk.DIALOG_DESTROY_WITH_PARENT,
+                                                  gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE,
+                                                  "Nothing to search for...")
+                        dialog.run()
+                        dialog.destroy()
+                else:
+                        fromtxt = self.combobox.get_active_text()
+                        fromtxt = fromtxt.split("_")[0]
+                        fromtxt = fromtxt.split("@")[0]
+                        params['langpair'] = "en|%s" % fromtxt
+                        params['q'] = self.searchbox.get_text()
+                        data = urllib.urlencode(params)
+                        response = urllib.urlopen(GOOGLE_URL, data)
+                        json = simplejson.load(response)
+                        self.store.append(['%s' % json['responseData']['translatedText'],
+                                          'null', 'null'])
+
+
+
+
+if __name__ == "__main__":
+        app = GtkPylyglot()
+        gtk.main()