Finish translation system. #191

This commit is contained in:
Michael Teeuw
2016-05-11 12:38:41 +02:00
parent 32c9f197b1
commit 7a067a0f6e
20 changed files with 393 additions and 100 deletions

View File

@@ -61,6 +61,14 @@ Module.register("weatherforecast",{
return ["weather-icons.css", "weatherforecast.css"];
},
// Define required translations.
getTranslations: function() {
// The translations for the defaut modules are defined in the core translation files.
// Therefor we can just return false. Otherwise we should have returned a dictionairy.
// If you're trying to build yiur own module including translations, check out the documentation.
return false;
},
// Define start sequence.
start: function() {
Log.info("Starting module: " + this.name);
@@ -93,7 +101,7 @@ Module.register("weatherforecast",{
}
if (!this.loaded) {
wrapper.innerHTML = "Loading weather ...";
wrapper.innerHTML = this.translate('LOADING');
wrapper.className = "dimmed light small";
return wrapper;
}