diff --git a/js/firstscreen.js b/js/firstscreen.js index 04d58c9e8..0bfe312b4 100644 --- a/js/firstscreen.js +++ b/js/firstscreen.js @@ -94,10 +94,14 @@ enyo.kind({ // At first launch, display tutorial var that = this; - window.setTimeout(function() { + var interval = window.setInterval(function() { if (that.history.length == 0) { + if (!l10n.initialized) { + return; + } that.startTutorial(); } + window.clearInterval(interval); }, constant.timerBeforeTutorial); }, diff --git a/lib/l10n.js b/lib/l10n.js index 8bc90285b..137554fea 100644 --- a/lib/l10n.js +++ b/lib/l10n.js @@ -1,6 +1,5 @@ define(['i18next.min', 'axios.min'], function (i18next, axios) { - const l10n = {language: {direction: "ltr"}}; - let initialized = false; + const l10n = {language: {direction: "ltr"}, initialized: false}; l10n.init = async (lang) => { await i18next.init({ @@ -38,12 +37,12 @@ define(['i18next.min', 'axios.min'], function (i18next, axios) { l10n.init("en"); } i18next.changeLanguage(lang); - initialized = true; + l10n.initialized = true; triggerLocalizedEvent(); }); } else { i18next.changeLanguage(lang); - initialized = true; + l10n.initialized = true; triggerLocalizedEvent(); } };