It is currently Thu Nov 23, 2017 12:05 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Small IDE Tool to Translate words strings - Google
PostPosted: Wed Aug 09, 2017 11:53 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 629
Location: Nottinghamshire UK
Hi To All. Here is a small tool for the IDE to convert word/s strings paragraph`s (code - quoted strings) via Google Translate.

As the tool use`s the clipboard it can be used with any other software where required.

Zebuddi. :)

1. Compile to exe, set as a tool, no params, I have set my shortcut to ctrl + 1.

Usage: copy selection to clipboard, hit crtl + 1 or your selected shortcut, a window opens with translated text set to your chosen language. 5,000 char limitation imposed via Google & Bing per translation.

Image
Code:
;Zebuddi. 9/8/2017
EnableExplicit

Procedure UpdateGadget()
   ResizeGadget(1, #PB_Ignore, #PB_Ignore, WindowWidth(0), WindowHeight(0))
EndProcedure

Define sLocale.s = "en" ; en=English etc. set for default translation language ,  Google & Bing 5,000 character limit for translation.

If OpenWindow(0, 0, 0, 750, 525, "Pure Translate. (Zebuddi 9/8/2017)", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
   WindowBounds(0, 750, 525, 1335, 525)
   StickyWindow(0, #True)
   WebGadget(1, 0, 0, 750, 600,  "https://translate.Google.com/#auto/" + sLocale + "/" + URLEncoder(GetClipboardText()))
   BindEvent(#PB_Event_SizeWindow, @UpdateGadget(), 0)
   Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

; Language Codes.

; "1   Afrikaans   Afrikaans   af"
; "2   Albanian   Shqip   sq"
; "3   Arabic   عربي   ar"
; "4   Armenian   Հայերէն   hy"
; "5   Azerbaijani   آذربایجان دیلی   az"
; "6   Basque   Euskara   eu"
; "7   Belarusian   Беларуская   be"
; "8   Bulgarian   Български   bg"
; "9   Catalan   Català   ca"
; "10   Chinese (Simplified)   中文简体   zh-CN"
; "11   Chinese (Traditional)   中文繁體   zh-TW"
; "12   Croatian   Hrvatski   hr"
; "13   Czech   Čeština   cs"
; "14   Danish   Dansk   da"
; "15   Dutch   Nederlands   nl"
; "16   English   English   en"
; "17   Estonian   Eesti keel   et"
; "18   Filipino   Filipino   tl"
; "19   Finnish   Suomi   fi"
; "20   French   Français   fr"
; "21   Galician   Galego   gl"
; "22   Georgian   ქართული   ka"
; "23   German   Deutsch   de"
; "24   Greek   Ελληνικά   el"
; "25   Haitian Creole   Kreyòl ayisyen   ht"
; "26   Hebrew   עברית   iw"
; "27   Hindi   हिन्दी   hi"
; "28   Hungarian   Magyar   hu"
; "29   Icelandic   Íslenska   is"
; "30   Indonesian   Bahasa Indonesia   id"
; "31   Irish   Gaeilge   ga"
; "32   Italian   Italiano   it"
; "33   Japanese   日本語   ja"
; "34   Korean   한국어   ko"
; "35   Latvian   Latviešu   lv"
; "36   Lithuanian   Lietuvių kalba   lt"
; "37   Macedonian   Македонски   mk"
; "38   Malay   Malay   ms"
; "39   Maltese   Malti   mt"
; "40   Norwegian   Norsk   no"
; "41   Persian   فارسی   fa"
; "42   Polish   Polski   pl"
; "43   Portuguese   Português   pt"
; "44   Romanian   Română   ro"
; "45   Russian   Русский   ru"
; "46   Serbian   Српски   sr"
; "47   Slovak   Slovenčina   sk"
; "48   Slovenian   Slovensko   sl"
; "49   Spanish   Español   es"
; "50   Swahili   Kiswahili   sw"
; "51   Swedish   Svenska   sv"
; "52   Thai   ไทย   th"
; "53   Turkish   Türkçe   tr"
; "54   Ukrainian   Українська   uk"
; "55   Urdu   اردو   ur"
; "56   Vietnamese   Tiếng Việt   vi"
; "57   Welsh   Cymraeg   cy"
; "58   Yiddish   ייִדיש   yi


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye