define(["dictionary/English","dictionary/Polish"],function(a,b){var c=[],d=[],e=null,f=null,g={},h=function(a){var b=null;if(_.each(d,function(c){a===c.id?(c.active=!0,b=c,e=c):c.active=!1}),!b)throw alert("ERROR Dictionary language unrecognized"),new Error("ERROR Dictionary language unrecognized");_.isEmpty(g);g=b.dictionary},i=function(a){var b=null;if(_.each(c,function(c){a===c.id?(c.active=!0,f=a,b=c):c.active=!1}),!b)throw alert("ERROR Dictionary language unrecognized"),new Error("ERROR Dictionary language unrecognized")},j=function(){return f},k=function(){var a=_.find(d,function(a){return a.active});return a?a.id:null},l=function(a){if(g[a])return g[a];throw alert("Dictionary unrecognized key: "+a),new Error("Dictionary unrecognized key: "+a)},m=function(){return d},n=function(){return c},o=function(e,f){d=[{id:"en",active:!1,name:"English",icon:"./app/assets/img/gb.png",dictionary:a},{id:"pl",active:!1,name:"Polish",icon:"./app/assets/img/pl.png",dictionary:b}],h(e),c=[{id:"en",active:!0,iconFrom:"./app/assets/img/gb.png",iconTo:"./app/assets/img/gb.png",iconFrom24:"./app/assets/img/gb24.png",iconTo24:"./app/assets/img/gb24.png",visible:!0,name:"English"},{id:"zh",active:!1,iconFrom:"./app/assets/img/gb.png",iconTo:"./app/assets/img/cn.png",iconFrom24:"./app/assets/img/gb24.png",iconTo24:"./app/assets/img/cn24.png",visible:!0,name:"Chinese"},{id:"pl",active:!1,iconFrom:"./app/assets/img/gb.png",iconTo:"./app/assets/img/pl.png",iconFrom24:"./app/assets/img/gb24.png",iconTo24:"./app/assets/img/pl24.png",visible:!0,name:"Polish"}],i(f)};return{init:o,get:l,getActiveLanguage:k,getAllLanguages:m,getAllLearnLanguages:n,setLanguage:h,getActiveLearningLanguage:j,setLearningLanguage:i}});