DALLASCAO.COM

Site of Cao Shouguang, English to Chinese translator

Google Dictionary for Word (GD4Word)

GD4Word (Google Dictionary for Word) does one simple thing: Select a word, and press CTRL+ALT+D, a Google Dictionary window will open displaying the definition, translation and examples of that word.

GD4Word is a Word Macro and it only works inside Microsoft Word.

GD4Word is a free version of Google Translate for Translators, a program that seriously increases translation speed by adding Google Translate to TRADOS, Word and all text applications.

GD4Word

Click to download the installer that will automatically adds CTRL+ALT+D to your Word.

In case you want to do the coding yourself,

In Word 2003 and under,

Go to Tools–>Macros—>Visual Basic

Right click on “Normal”, and choose “Insert”—>”Module”

Paste the following code to the newly inserted module.

'code start

Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub Gdictionary()

Dim SLan As String
Dim TLan As String
Dim SText As String
Dim Gurl As String

SLan = "en"
TLan = "zh-CN"
SText = VBA.Trim(VBA.Replace(Selection.Text, Chr(13), ""))

Gurl = "http://www.google.com/dictionary?langpair=" + SLan + "|" + TLan + "&q=" + SText + "&hl=en&aq=f"

Debug.Print Gurl

ShellExecute 0&, vbNullString, Gurl, vbNullString, vbNullString, vbNormalFocus

End Sub

'code end

Then you can assign a keyboard shortcut to the macro: Gdictionary().

This code works when the source language uses ASCII characters only. If you want to make it work with pairs like Chinese to English, you will need to utf-8 encode your source text string.

“en”, “zh-CN” are shortcodes for the source language and the target language. You need to change them to your pair.

Google language short codes:

auto=Auto Detect,af=Afrikaans,sq=Albanian,ar=Arabic,be=Belarusian,bg=Bulgarian,ca=Catalan,zh-CN=Chinese (Simplified),zh-TW=Chinese (Traditional),hr=Croatian,cs=Czech,da=Danish,nl=Dutch,en=English,et=Estonian,tl=Filipino,fi=Finnis h,fr=French,gl=Galician,de=German,el=Greek,iw=Hebrew,hi=Hindi,hu=Hungarian,is=Icelandic,id=Indonesia n,ga=Irish,it=Italian,ja=Japanese,ko=Korean,lv=Latvian,lt=Lithuanian,mk=Macedonian,ms=Malay,mt=Malte se,no=Norwegian,fa=Persian,pl=Polish,pt=Portuguese,ro=Romanian,ru=Russian,sr=Serbian,sk=Slovak,sl=Sl ovenian,es=Spanish,sw=Swahili,sv=Swedish,th=Thai,tr=Turkish,uk=Ukrainian,vi=Vietnamese,cy=Welsh,yi=Y iddish

1 Comment

Leave a Comment