Requires being added to secure mods config due to making HTTPS calls to external translation service
Dependencies:
- security
- irc (optional)
Download:
github: https://github.com/taikedz-mt/babelfish
ZIP: https://github.com/taikedz-mt/babelfish ... master.zip
- * Can be extended to use different web APIs
* Currently uses Yandex to do the translation because it was the only free API I could get.
* Can be used as an API for other mods
* You MUST add babelfish to the `secure.trusted_mods` for it to work, as it makes calls out to the Internet.
In its simplest form, players can simply do something like
Code: Select all
Hello everybody! %fr
Code: Select all
Bonjour tout le monde!
Code: Select all
/babel {player}
* Translates the last message from the specified player to your preferred language
* Only you see the result of this
* /babel mrGibberish
/bblang {language}
* Set your preferred language using a language code
* Default is English
/bb {language} {sentence}
* Broadcasts a message in the target language (French in this case)
* /bb fr My english sentence
/bmsg {language} {player} {sentence}
* Sends a private message to another player in the target language
* /bmsg es spanishplayer I do not understand you, please use the translation commands
/bbcodes
* List the available language codes
Mod creators can leverage babelfish by using
Code: Select all
babel:translate( phrase_to_translate , language_code )