Get website language in javascript

Get selected website language in javascript module


you need to add create a new function and add it to the start function of your module.

odoo.define('m​odule_name.module', function(require){
start: function() {
    const lang = t​his._getLanguages();​
},
_getLanguages: function () {
var self = this;
var context;
this.trigger_up('context_get', {
callback: function (ctx) {
context = ctx;
},​
});
    return context.lang
},
});

Views
1 Total Views
1 Members Views
0 Public Views
Actions
0 Likes
0 Dislikes
0 Comments
Share on Social Networks
Share Link
Share by mail

Please login to share this webpage by email.