Welcome to the COTW Translation Service. This is how the service can be used:
1. Reference this javascript file in your webpage:
http://dev.webservices.cotw.eu/Translations/translation.min.js
2. In the script tag, the next properties should be added:
data-translation-language - the language
data-translation-namespace - the labels are organized in namespaces. In the COTW labels table, if you specify for example the 'car' namespace, all labels starting with 'car' will be part of this namespace. You can specify multiple namespaces, one after another, divided by space character (like in the above example). If you don't specify any namespace, all the labels will be loaded. Namespaces are used for optimization purposes.
data-translation-debug = 'true' - using this, all labels and the current translations will be displayed at the bottom of the page (for debugging purpose).
In order to add translatable items into the page, the item should be part of a div or span, and a data-i18n attribute with the name of the label should be added, like this:
<span data-i18n="cardetail.broken">Broken(dev)</span>
Internals:
The labels are downloaded and stored in the browser local storage, so first time it can take a couple of seconds depending on the size of the translation, but after that, the translations will be loaded from the local storage, so it will be very fast. For example, all the labels for a particular language is about 200k, and downloading and processing them can take several seconds. If a namespace if speecified, loading the translations could be very fast.