Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed language localization.
  • Loading branch information
JPJPJPOPOP committed Jan 21, 2018
commit 4487627e23fc781eb1faa69949ffe75497f65c4e
12 changes: 8 additions & 4 deletions assets/js/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ var localizedLanguageCodes /*: {[string]: string} */ = {}, localizedLanguageName

/* global config, getPairs, getGenerators, getAnalyzers, persistChoices, getURLParam, cache, ajaxSend, ajaxComplete, sendEvent,
srcLangs, dstLangs, generators, analyzers, readCache, modeEnabled, populateTranslationList, populateGeneratorList,
populateAnalyzerList, analyzerData, generatorData, curSrcLang, curDstLang, restoreChoices, refreshLangList, onlyUnique,
getSpellers */
populateAnalyzerList, populatePrimarySpellCheckerList, analyzerData, generatorData, spellerData, curSrcLang, curDstLang,
restoreChoices, refreshLangList, onlyUnique, getSpellers */

var dynamicLocalizations /*: {[lang: string]: {[string]: string}} */ = {
'fallback': {
Expand Down Expand Up @@ -310,6 +310,9 @@ function localizeLanguageNames(localizedNamesFromJSON) {
if(modeEnabled('analyzation')) {
populateAnalyzerList(analyzerData);
}
if(modeEnabled('spellchecking')) {
populatePrimarySpellCheckerList(spellerData);
}
}
}

Expand Down Expand Up @@ -385,7 +388,8 @@ function localizeInterface() {
'#originalText': curSrcLang,
'#translatedText': curDstLang,
'#morphAnalyzerInput': $('#primaryAnalyzerMode').val(),
'#morphGeneratorInput': $('#primaryGeneratorMode').val()
'#morphGeneratorInput': $('#primaryGeneratorMode').val(),
'#spellCheckerInput': $('#primarySpellCheckerMode').val()
};

$.each(elements, function (selector, lang /*: string */) {
Expand Down Expand Up @@ -433,4 +437,4 @@ function setLocale(newLocale /*: string */) {
/*:: import {generatorData, generators, getGenerators, populateGeneratorList} from "./generator.js" */
/*:: import {analyzerData, analyzers, getAnalyzers, populateAnalyzerList} from "./analyzer.js" */
/*:: import {cache, persistChoices, readCache, restoreChoices} from "./persistence.js" */
/*:: import {getSpellers} from "./spellchecker.js" */
/*:: import {getSpellers, populatePrimarySpellCheckerList, spellerData} from "./spellchecker.js" */
4 changes: 2 additions & 2 deletions assets/js/spellchecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var spellers = {}, spellerData = {};
var currentSpellCheckerRequest;

/* exported getSpellers */
/* exported getSpellers, spellerData */
/* global config, modeEnabled, persistChoices, readCache, ajaxSend, ajaxComplete, filterLangPairList, allowedLang, cache,
localizeInterface, getLangByCode, restoreChoices, callApy */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'callApy' is defined but never used no-unused-vars

/* global ENTER_KEY_CODE */
Expand Down Expand Up @@ -227,7 +227,7 @@ function spellCheckerNotAvailable(data) {
$('#spellCheckerInput').append($('<div></div>').text(data.explanation));
}

/*:: export {getSpellers} */
/*:: export {getSpellers, spellerData} */

/*:: import {modeEnabled, ajaxSend, ajaxComplete, allowedLang, filterLangPairList, callApy, ENTER_KEY_CODE} from "./util.js" */
/*:: import {persistChoices, restoreChoices} from "./persistence.js" */
Expand Down