From 54615932f836326de804f4a522128049a7e7b99e Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 24 Oct 2016 11:41:36 +0200 Subject: [PATCH] merge in some espanol commits --- customize.dist/messages.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/customize.dist/messages.js b/customize.dist/messages.js index f1062ada3..b35e5897c 100644 --- a/customize.dist/messages.js +++ b/customize.dist/messages.js @@ -1,11 +1,13 @@ define(['/customize/languageSelector.js', '/customize/translations/messages.js', + //'/customize/translations/messages.es.js', // uncomment when we're ready to merge 'espanol' '/customize/translations/messages.fr.js', - '/bower_components/jquery/dist/jquery.min.js'], function(LS, Default, French) { + '/bower_components/jquery/dist/jquery.min.js'], function(LS, Default, /*Spanish,*/ French) { var $ = window.jQuery; var map = { - 'fr': French + 'fr': French, + //'es': Spanish, }; var defaultLanguage = 'en'; @@ -32,6 +34,21 @@ define(['/customize/languageSelector.js', } messages._initSelector = LS.main; + messages._checkTranslationState = function () { + var missing = []; + Object.keys(map).forEach(function (code) { + var translation = map[code]; + Object.keys(Default).forEach(function (k) { + if (/^_/.test(k) || /nitialState$/.test(k)) { return; } + if (!translation[k]) { + var warning = "key [" + k + "] is missing from translation [" + code + "]"; + missing.push(warning); + console.log(warning); + } + }); + }); + return missing; + }; // Get keys with parameters messages._getKey = function (key, argArray) {