This sbar module allows you to use the google translator from your screenbar!
Just click on the Google-Translator symbol in the screenbar, a window will be opened where you can write the word or sentence you want to translate into the first or second string gadget.
The text will be instantly translated while you are typing!
There are also two custom popup gadgets to choose the source and translated language.
You can use the gTranslator from any programm which supports Copy&Paste!
Its now possible to open the translator window by pressing the hotkey alt-#.
It can be customized in the settings.
Just activate the clipboard hook (press the right mouse button over the gTranslator icon
in the screenbar) then everything which is copied to the clipboard will be translated
and displayed in a help bubble at the mouse pointer's position!
You can also automatically insert the translated text in your application, by pressing
the Cut&Traste hotkey (default right amiga-shift-x) after marking a text.
What has changed in v3.4:
Fix: The error bubble also appeared if you use Cut'&'Traste
Chg: Changed the menu-hotkey to en/disable the clipboard to rAmiga-h, cause it collides with Scintillas
Although my menu-hotkey was rAmiga-SHIFT-c but it seems, that intuition only supports uppercase chars
if you also the define a menuitem with the char in lowercase!
New: Added a shorthelp to the lamp object
New: If the bubble with the translated string couldn't be created (f.e. the str was too long),
an error bubble appears
Fix: If you delete the last char in the source field, the last char in the target field stays there
Fix: Finding the source lang was broken, due to latest changing, thats why
retranslating wasn't done, if you have "source lang" set to "auto" and you copied
a text in your destination language, which should have been retranslating to you home language
New: Linefeeds in the translated text will be replaced by a space, this looks better in the bubble,
so MUI formats the text on its own
New: Added a new option to toggle the skipping of LFs
Fix: Multiple sentences didn't worked!? I know this had worked before...
Either way, I found a way to optimize the parsing of the translation a bit;)
Fix: Switching between screens, could prevent displaying the translater bubble
Chg: Changed the text of the "gTranslator working"-bubble to "gTranslating...", because
the previous "gTranslator is working..." was to splitted into 2 lines, which doesn't look good
Fix: The codepage was set to UTF8 before opening the window, not direct after creating the window
This leads to not recognized chars when translating of "UTF8 words" before the window was
opened for the first time, f.e. if you use the clipboard hook
Fix: Changed the text of the "gTranslator working"-bubble to "gTranslator is working...";)
New in v3.3
Chg: gTranslator is now working again!
Chg: Added support for multiple translations, because the new url produces a different
output format, where each sentence is translated for themselves
Fix: Spaces after a string won't get lost after a translation
Fix: Don't queue another translation, if a translation is already running
f.e. If you type faster then google can translate
New in v3.2:
- a small fix to handle the situation if a http request didn't succeed
New in v3.1:
- Cut&Tras´te feature
You are now able to translate text from any program which supports Cut&Paste. Just mark the text you want to translate and press rcommand-shift-x (changeable), after some time (a bubble
appears saying that gTranslator is working) the marked text gets replaced by the translated text!
- Clipboard hook, default is inactive
Mark a text f.e. in OWB, then choose to copy it to the clipboard, gTranslator then displays the translated text in a bubble-help! You can activate/deactivate this feature with a right
mouseclick over the gTranslators screenbar image, from the menu (Edit/Clipboard hook) of its window or with a hotkey (defaults to rcommand-shift-c) to toggle this feature. A little "*" in the
screenbar image shows that it is activated. The bubble-help can be closed by clicking the left mousebutton or by pressing ESC.
Here is a youtube video demonstrating this cool feature.
New in v3:
- gTranslator now uses Scintilla objects as text input/output fields which enables you to use UTF8 text.
- the translation functions of gTranslator.sbar can now be used from external applications f.e. OWB could use it to translate marked text there is a shell command (gTranslator) to translate
strings from a shell
- you can now type into both text fields
- you can specify a font in the settings
- long text will be splitted into parts of 1000 bytes to be able to translate it I try to be smart here to don't split within a sentence or word (if there aren't any)
Here is a brief overview of the menu:
||activate the source field
||activate the target field
||check if there is a newer version
||show an about window
||show MUIs AboutWindow
||close the window
||clear both fields
||undo the last changes
||redo the last undo
|Edit/Copy source to clipboard
||copy source to the clipboard
|Edit/Copy target to clipboard
||copy target to the clipboard
||en/disable the clipboard hook
Right mouseclick over the screenbar icon works too!
||choose a new source language
||choose a new target language
Read the History for a full changelog.
Here is a preview how it looks:
- copy "gTranslator.sbar" to SYS:Classes/Screenbar/
- copy gTranslator to SYS:C/ to use it from a shell
- Now you have to update the displayed sbars:
- right click on the screen-depth icon (upper right corner of the screen)
- choose 'Update List'
- then select the new entry "gTranslator" in the "modules" submenu
The new language selection gadget:
Here is a screenshot of the settings:
Have fun with it, and if you have some ideas/bug reports send it to gTranslator(at)igracki(dot)de.