Skip to content

Commit

Permalink
Merge pull request #3 from RendyTan/master
Browse files Browse the repository at this point in the history
Set language globally
  • Loading branch information
javisperez authored Nov 1, 2017
2 parents b8775ff + af8e87b commit 3ec2e04
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/vue-translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ const VueTranslate = {
Vue.locales = (locales) => {
vm.$translate.setLocales(locales);
};

// Global method for setting languages
Vue.lang = (lang) => {
vm.$translate.setLang(lang);
};
}
};

Expand All @@ -119,4 +124,4 @@ if (typeof exports === 'object') {
} else if (window.Vue) {
window.VueTranslate = VueTranslate; // Browser (not required options)
Vue.use(VueTranslate);
}
}

0 comments on commit 3ec2e04

Please sign in to comment.