/**
 * 五语键齐 · 运行：node website/app/js/kr_i18n_selftest.js
 */
(function () {
  "use strict";
  var fails = 0;
  function ok(name, cond) {
    if (!cond) { fails++; console.error("FAIL", name); }
    else console.log("ok", name);
  }
  require("./kr_i18n.js");
  var KEYS = [
    "demoCase", "demoNote", "tapePlay", "tapePlaying", "tapeStop", "tapeGo",
    "tapeHint", "defaultHint", "shifuBlurb", "shifuAsk", "shifuListen",
    "downloadFull", "downloadHint", "tagline", "paipan", "tabKey", "tianYiHint",
    "dingTi", "gongNengDeLi", "yong2Hint", "lingTwoHint", "scaleHint"
  ];
  var langs = global.KRLang.langs;
  ok("五语列表", langs.join(",") === "zh,en,es,ja,ar");
  langs.forEach(function (L) {
    global.KRLang.set(L);
    KEYS.forEach(function (k) {
      var v = global.KRLang.t(k);
      ok(L + " " + k, v && v !== k && v.length > 1);
    });
  });
  global.KRLang.set("zh");
  if (fails) { console.error("FAILED", fails); process.exit(1); }
  console.log("ALL_OK");
})();
