pull down to refresh

Translation PluginTranslation Plugin

This is a translation plugin for OpenAgents built with Extism Go PDK that uses the Microsoft Translator Text API via RapidAPI . The plugin takes a text input and translates it to a specified language.

Github : https://github.com/AndrewLWZZ/Translation-Plugin/

FeaturesFeatures

  • Translates text from one language (auto detect) to another using the Microsoft Translator Text API.
  • Supported Language :
CodeName
afAfrikaans
amAmharic
arArabic
asAssamese
azAzerbaijani
baBashkir
bgBulgarian
bhoBhojpuri
bnBangla
boTibetan
brxBodo
bsBosnian
caCatalan
csCzech
cyWelsh
daDanish
deGerman
doiDogri
dsbLower Sorbian
dvDivehi
elGreek
enEnglish
esSpanish
etEstonian
euBasque
faPersian
fiFinnish
filFilipino
fjFijian
foFaroese
frFrench
fr-CAFrench (Canada)
gaIrish
glGalician
gomKonkani
guGujarati
haHausa
heHebrew
hiHindi
hneChhattisgarhi
hrCroatian
hsbUpper Sorbian
htHaitian Creole
huHungarian
hyArmenian
idIndonesian
igIgbo
iktInuinnaqtun
isIcelandic
itItalian
iuInuktitut
iu-LatnInuktitut (Latin)
jaJapanese
kaGeorgian
kkKazakh
kmKhmer
kmrKurdish (Northern)
knKannada
koKorean
ksKashmiri
kuKurdish (Central)
kyKyrgyz
lnLingala
loLao
ltLithuanian
lugGanda
lvLatvian
lzhChinese (Literary)
maiMaithili
mgMalagasy
miMāori
mkMacedonian
mlMalayalam
mn-CyrlMongolian (Cyrillic)
mn-MongMongolian (Traditional)
mniManipuri
mrMarathi
msMalay
mtMaltese
mwwHmong Daw
myMyanmar (Burmese)
nbNorwegian
neNepali
nlDutch
nsoSesotho sa Leboa
nyaNyanja
orOdia
otqQuerétaro Otomi
paPunjabi
plPolish
prsDari
psPashto
ptPortuguese (Brazil)
pt-PTPortuguese (Portugal)
roRomanian
ruRussian
runRundi
rwKinyarwanda
sdSindhi
siSinhala
skSlovak
slSlovenian
smSamoan
snShona
soSomali
sqAlbanian
sr-CyrlSerbian (Cyrillic)
sr-LatnSerbian (Latin)
stSesotho
svSwedish
swSwahili
taTamil
teTelugu
thThai
tiTigrinya
tkTurkmen
tlh-LatnKlingon (Latin)
tlh-PiqdKlingon (pIqaD)
tnSetswana
toTongan
trTurkish
ttTatar
tyTahitian
ugUyghur
ukUkrainian
urUrdu
uzUzbek (Latin)
viVietnamese
xhXhosa
yoYoruba
yuaYucatec Maya
yueCantonese (Traditional)
zh-HansChinese Simplified
zh-HantChinese Traditional
zuZulu

PrerequisitesPrerequisites

  • Go 1.16 or higher
  • A RapidAPI account
  • Microsoft Translator Text API key from RapidAPI

InstallationInstallation

  1. Clone the repository:
    git clone https://github.com/AndrewLWZZ/Translation-Plugin.git
    cd Translation-Plugin
  2. Install dependencies:
    go get -u github.com/extism/go-pdk

UsageUsage

  1. Set your RapidAPI key in the API_KEY variable in the main.go file:
    var API_KEY string = "YOUR_API_KEY"
  2. Build the plugin:
    tinygo build -o plugin.wasm -target wasi main.go
  3. Run the plugin using Extism-CLI:
    extism call plugin.wasm run --input='{"text": "YOUR_TEXT?", "to": "LANGUAGE_CODE"}' --wasi --allow-host='*.rapidapi.com'

ExampleExample

https://github.com/AndrewLWZZ/Translation-Plugin/assets/170183093/290a4493-73c6-456f-856a-7b1d84d7c291

API ReferenceAPI Reference

The plugin uses the Microsoft Translator Text API. Refer to the API documentation for details on supported languages and additional features.

AcknowledgementsAcknowledgements

this territory is moderated

Excellent, thank you!

This qualifies for the bounty, please DM me @OpenAgentsInc on X a bitcoin address or email me chris@openagents.com

reply

That's sweet, thanks! I’ve already sent the details via DM on X.

reply

Awesome, thank you! Will review shortly

reply

I forgot to add the Lightning address. here's mine AndrewLWZZ@stacker.news

reply

💪🏾

reply