Skip to content

Commit

Permalink
#5 Add 'setLang', cpmpile a 'new translater.js' .
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 11, 2016
1 parent 22683de commit 4187d75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
7 changes: 3 additions & 4 deletions dist/translater.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ var Translater = function(option,callback){
// 默认给URL参数 ?lang=en
option = option || {};
if(getUrlParam("lang")){
// console.log("222");
option.lang = getUrlParam("lang");
}

console.log(option)
if(option.lang) {
console.log("wwww");
setCookie('t-lang',option.lang,24);
this.lang_name = option.lang;
}else{
Expand Down Expand Up @@ -56,6 +52,9 @@ Translater.prototype = {
}
}
setCookie('t-lang',name,24);
},
getLang:function() {
return this.lang_name;
}
}

Expand Down
2 changes: 1 addition & 1 deletion dist/translater.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions src/translater.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ var Translater = function(option,callback){
// 默认给URL参数 ?lang=en
option = option || {};
if(getUrlParam("lang")){
// console.log("222");
option.lang = getUrlParam("lang");
}

console.log(option)
if(option.lang) {
console.log("wwww");
setCookie('t-lang',option.lang,24);
this.lang_name = option.lang;
}else{
Expand Down Expand Up @@ -41,7 +37,7 @@ Translater.prototype = {
setCookie('t-lang',name,24);
},
getLang:function() {
return this.lang_name;
return this.lang_name;
}
}

Expand Down

0 comments on commit 4187d75

Please sign in to comment.