Get Localization Translation API
The Get Localization Translate API provides a convenient way to translate strings using JavaScript. The inspiration of this is Google Translate API that is very similar, but instead of machine translation this can be used to translate websites with actual human translators.
In order to use the API, you need an API key. You can get one from your project settings.
Getting Started
Methods
getlocalization.language.load( [localizationFile] )
localizationFile: URL to localization file
getlocalization.language.languages(callback)
This method returns available languages from project the API-key belongs. Response is in JSON format.
callback: Called after languages are retrieved.
Example of response:
{ "languages" : [
{ "name" : "Finnish", "language" : "fi" },
{ "name" : "France", "language" : "fr }
]}
getlocalization.language.translate(string, source, target, callback)
This method is for translating the string from source language to target language. If the translated string is not found, it's automatically added to translation project the API-key belongs.
string: String that will be translated
source: Source language (translated from)
target: Target language (translated to)
callback: Callback function, called when translation is ready.
