Anylang = (function() {
  var tables = {};

  function Anylang(langDestination, langOrigin){
    this.origin = langOrigin;
    this.langDestination = langDestination;
    this.table = tables[langDestination][langOrigin];
  };

  Anylang.addLang = function addLang(equivs) {
    tables[equivs.langDestination] = tables[equivs.langDestination] || {};
    tables[equivs.langDestination][equivs.langOrigin] = equivs.table.map(function(eq){
      if (typeof eq.from === "string") {
        eq.from = new RegExp(eq.from, 'g');
        return eq;
      }
      return eq;
    });
  }

  Anylang.prototype.equiv = function equiv(txt) {
    for (var j=0; j<this.table.length; j++) {
        var repl = this.table[j];
        txt = txt.replace(repl.from, repl.to);
    }
    return txt;
  }
  
  if (typeof document !== "undefined") {

    function bindToInput(input) {
      var data = input.dataset;
      var langs = data.anylangTo + '-' + data.anylangFrom;
      var anylang = new Anylang(data.anylangTo, data.anylangFrom);
      var target = document.getElementById(data.anylangTarget);
      var change = function anylang_change(evt){
        var curlangs = data.anylangTo + '-' + data.anylangFrom;
        if (curlangs !== langs) {
          langs = curlangs;
          anylang = new Anylang(data.anylangTo, data.anylangFrom);
        }
        var trans = anylang.equiv(input.value);
        data.anylangEquiv = trans;
        if (target !== null) {
          if (target.value !== void 0) {
            target.value = trans;
          } else {
            target.innerHTML = trans;
          }
        }
      }
      input._anylang_update_equiv = change;
      input.addEventListener("keyup", change);
      input.addEventListener("change", change);
    }

    Anylang.attach = bindToInput;
    Anylang.detach = function Anylang_detach(input) {
      input.removeEventListener("keyup", input._anylang_update_equiv);
      input.removeEventListener("change", input._anylang_update_equiv);
    }

    document.addEventListener("DOMContentLoaded", function(event) {
      var inputs = document.querySelectorAll("input[data-anylang-to]");
      for (var i=0; i<inputs.length; i++) {
        bindToInput(inputs[i]);
      }
    });
  }
  return Anylang;
})();

@@ -160,16 +160,28 @@
 nation;%0A
+    try %7B%0A  
     this
@@ -226,16 +226,136 @@
 rigin%5D;%0A
+    %7D catch (e) %7B%0A      console.log(%22Anylang: language not loaded: %22+langDestination);%0A      this.invalid = true;%0A    %7D%0A
   %7D;%0A%0A  
@@ -1451,32 +1451,48 @@
 rom);%0A        %7D%0A
+        try %7B%0A  
         var tran
@@ -1529,41 +1529,8 @@
 ;%0A  
-      data.anylangEquiv = trans;%0A
     
@@ -1552,24 +1552,26 @@
 !== null) %7B%0A
+  
           if
@@ -1607,24 +1607,26 @@
             
+  
 target.value
@@ -1645,16 +1645,18 @@
         
+  
 %7D else %7B
@@ -1664,24 +1664,26 @@
             
+ 
+ 
 target.inner
@@ -1698,34 +1698,38 @@
 rans;%0A          
-%7D%0A
+  %7D%0A  
         %7D%0A      
@@ -1718,24 +1718,125 @@
           %7D%0A
+        %7D catch(e) %7B%0A          var trans = input.value;%0A        %7D%0A        data.anylangEquiv = trans;%0A
       %7D%0A    

Work even when there is no language loaded