Changeset View
Changeset View
Standalone View
Standalone View
src/activities/gletters/gletters.js
Context not available. | |||||
76 | 76 | | |||
---|---|---|---|---|---|
77 | // register the voices for the locale | 77 | // register the voices for the locale | ||
78 | GCompris.DownloadManager.updateResource(GCompris.DownloadManager.getVoicesResourceForLocale(GCompris.ApplicationInfo.getVoicesLocale(items.locale))); | 78 | GCompris.DownloadManager.updateResource(GCompris.DownloadManager.getVoicesResourceForLocale(GCompris.ApplicationInfo.getVoicesLocale(items.locale))); | ||
79 | 79 | if(!items.levels) | |||
80 | items.wordlist.loadFromFile(GCompris.ApplicationInfo.getLocaleFilePath( | 80 | items.wordlist.loadFromFile(GCompris.ApplicationInfo.getLocaleFilePath( | ||
81 | items.ourActivity.dataSetUrl + "default-"+locale+".json")); | 81 | items.ourActivity.dataSetUrl + "default-"+locale+".json")); | ||
82 | else | ||||
scagarwal: @AkshayCHD The code misses starting and closing braces. Do add them. | |||||
83 | items.wordlist.loadFromJSON(items.levels); | ||||
82 | // If wordlist is empty, we try to load from short locale and if not present again, we switch to default one | 84 | // If wordlist is empty, we try to load from short locale and if not present again, we switch to default one | ||
83 | var localeUnderscoreIndex = locale.indexOf('_') | 85 | var localeUnderscoreIndex = locale.indexOf('_') | ||
84 | // probably exist a better way to see if the list is empty | 86 | // probably exist a better way to see if the list is empty | ||
Context not available. | |||||
93 | } | 95 | } | ||
94 | // If not found, we will use the default file | 96 | // If not found, we will use the default file | ||
95 | items.wordlist.useDefault = true | 97 | items.wordlist.useDefault = true | ||
96 | items.wordlist.loadFromFile(GCompris.ApplicationInfo.getLocaleFilePath( | 98 | if(!items.levels) | ||
97 | items.ourActivity.dataSetUrl + "default-"+localeShort+".json")); | 99 | items.wordlist.loadFromFile(GCompris.ApplicationInfo.getLocaleFilePath( | ||
100 | items.ourActivity.dataSetUrl + "default-"+localeShort+".json")); | ||||
101 | else | ||||
@AkshayCHD The code misses starting and closing braces. Do add them. scagarwal: @AkshayCHD The code misses starting and closing braces. Do add them. | |||||
102 | items.wordlist.loadFromJSON(items.levels); | ||||
98 | // We remove the using of default file for next time we enter this function | 103 | // We remove the using of default file for next time we enter this function | ||
99 | items.wordlist.useDefault = false | 104 | items.wordlist.useDefault = false | ||
100 | } | 105 | } | ||
Context not available. | |||||
110 | } | 115 | } | ||
111 | 116 | | |||
112 | function initLevel() { | 117 | function initLevel() { | ||
118 | if(items.levels) | ||||
119 | items.instructionText = items.levels[currentLevel].objective | ||||
@AkshayCHD The code misses starting and closing braces. Do add them. scagarwal: @AkshayCHD The code misses starting and closing braces. Do add them. | |||||
113 | items.audioVoices.clearQueue() | 120 | items.audioVoices.clearQueue() | ||
114 | items.bar.level = currentLevel + 1; | 121 | items.bar.level = currentLevel + 1; | ||
115 | wgMaxFallingItems = 3 | 122 | wgMaxFallingItems = 3 | ||
Context not available. | |||||
411 | + Core.getSoundFilenamForChar(letter))) | 418 | + Core.getSoundFilenamForChar(letter))) | ||
412 | } | 419 | } | ||
413 | 420 | | |||
414 | | ||||
415 | function focusTextInput() { | 421 | function focusTextInput() { | ||
416 | if (!GCompris.ApplicationInfo.isMobile && items && items.textinput) | 422 | if (!GCompris.ApplicationInfo.isMobile && items && items.textinput) | ||
417 | items.textinput.forceActiveFocus(); | 423 | items.textinput.forceActiveFocus(); | ||
Context not available. |
@AkshayCHD The code misses starting and closing braces. Do add them.