Auto Translate Mouse At Text Cursor

Here is a simple demo .NET 4.5 app which will translate text to the specified language using Azure Cognitive Services. The text is received via .NET’s UI Automation feature, but this will also detect text on common Win32 controls such as menu items, which is primarily what I tested it on.

This is based on the following examples:

The Old New Thing – The managed way to retrieve text under the cursor (mouse pointer)

Cognitive Services C# Examples

The binary is available for download here, read the readme.txt, you will need Azure Cognitive Service API key to use, this can be configured in .config file. .NET 4.5 is required.

C# source code on github

Example in action, configured to translate English to Simplified Chinese.

The list of supported languages currently include:

Afrikaans (Afrikaans)
Arabic (العربية)
Assamese (Assamese)
Bulgarian (Български)
Bangla (বাংলা)
Bosnian (bosanski (latinica))
Catalan (Català)
Czech (Čeština)
Welsh (Welsh)
Danish (Dansk)
German (Deutsch)
Greek (Ελληνικά)
English (English)
Spanish (Español)
Estonian (Eesti)
Persian (Persian)
Finnish (Suomi)
Filipino (Filipino)
Fijian (Fijian)
French (Français)
French (Canada) (French (Canada))
Irish (Gaeilge)
Gujarati (ગુજરાતી)
Hebrew (עברית)
Hindi (हिंदी)
Croatian (Hrvatski)
Haitian Creole (Haitian Creole)
Hungarian (Magyar)
Indonesian (Indonesia)
Icelandic (Íslenska)
Italian (Italiano)
Japanese (日本語)
Kazakh (Kazakh)
Kurdish (Northern) (Kurdish (Northern))
Kannada (ಕನ್ನಡ)
Korean (한국어)
Kurdish (Central) (Kurdish (Central))
Lithuanian (Lietuvių)
Latvian (Latviešu)
Malagasy (Malagasy)
Maori (Māori)
Malayalam (മലയാളം)
Marathi (मराठी)
Malay (Melayu)
Maltese (Il-Malti)
Hmong Daw (Hmong Daw)
Norwegian (Norsk)
Dutch (Nederlands)
Odia (Odia)
Querétaro Otomi (Querétaro Otomi)
Punjabi (ਪੰਜਾਬੀ)
Polish (Polski)
Dari (Dari)
Pashto (Pashto)
Portuguese (Brazil) (Português (Brasil))
Portuguese (Portugal) (Português (Portugal))
Romanian (Română)
Russian (Русский)
Slovak (Slovenčina)
Slovenian (Slovenščina)
Samoan (Samoan)
Serbian (Cyrillic) (srpski (ćirilica))
Serbian (Latin) (srpski (latinica))
Swedish (Svenska)
Swahili (Kiswahili)
Tamil (தமிழ்)
Telugu (తెలుగు)
Thai (ไทย)
Klingon (Latin) (Klingon (Latin))
Klingon (pIqaD) (Klingon (pIqaD))
Tongan (lea fakatonga)
Turkish (Türkçe)
Tahitian (Tahitian)
Ukrainian (Українська)
Urdu (اردو)
Vietnamese (Tiếng Việt)
Yucatec Maya (Yucatec Maya)
Cantonese (Traditional) (粵語 (繁體中文))
Chinese Simplified (简体中文)
Chinese Traditional (繁體中文)

About chentiangemalc

specializes in end-user computing technologies. disclaimer 1) use at your own risk. test any solution in your environment. if you do not understand the impact/consequences of what you're doing please stop, and ask advice from somebody who does. 2) views are my own at the time of posting and do not necessarily represent my current view or the view of my employer and family members/relatives. 3) over the years Microsoft/Citrix/VMWare have given me a few free shirts, pens, paper notebooks/etc. despite these gifts i will try to remain unbiased.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment