transapi-client
The client library for the TransAPI API for Cuberite.
Installation
- Copy transapi.lua into your plugin folder.
- Create a directory in your plugin folder called
languages
. - Create a file named [whatever].lua in the languages directory, and add translations to it as per the examples file. Your should probably have languages in their own files.
API
GetTranslation(cPlayer, Slug (string)) - Returns the translated string for the provided cPlayer object.
GetConsoleTranslation(Slug (string)) - Returns the translated string for the console.
Pitfalls
- TransAPI should not be used for startup logging, as it requires the TransAPI helper plugin to be loaded before yours.
- TransAPI requires that the global var
g_Languages
is not defined or used outside of itself.
Licensing
The TransAPI client lib is licensed under the MIT license, so you are free to improve and build upon it.