Use language plugin to change a variable's value?

Hello! I use a Multi-Language System Plugin to add, obviously, more languages to my game. I try to implement a system that basically makes a variable change depending on what language is set on right now, to translate CG's and use different audio. The thing is, i have no idea how to exactly implement that. I thought that
Code:
$gameVariables.setValue("variable", ${language});
should've worked, but it doesn't. Just to make it clear, the text code (i mean this ${language}) works correctly, it shows correct id when showing a text message, but the script doesn't work. Does anyone knows how can this be implemented in one way or another?
Hello! I use a Multi-Language System Plugin to add, obviously, more languages to my game. I try to implement a system that basically makes a variable change depending on what language is set on right now, to translate CG's and use different audio. The thing is, i have no idea how to exactly implement that. I thought that
Code:
$gameVariables.setValue("variable", ${language});
should've worked, but it doesn't. Just to make it clear, the text code (i mean this ${language}) works correctly, it shows correct id when showing a text message, but the script doesn't work. Does anyone knows how can this be implemented in one way or another?
By looking a bit in the plugin code, you can find on line 518 this function :
JavaScript:
$.getCurrentCode = function() {
        return this.getCurrentLanguage().code;
    };

So, in order to return the language itself in a script call, you would need to do something like this :
JavaScript:
let currentLanguage = ODW.MLS.getCurrentCode();
$gameVariables.setValue(id, currentLanguage);

The code will be supposedly formatted to "en" for English, "nl" for dutch, "fr" for french, etc...

If you want the language itself, you might want to recover the label, as stated on line 544
JavaScript:
$.getCurrentLabel = function() {
        return this.getCurrentLanguage().label;
    };

Apply same method as above :
JavaScript:
let currentLanguageLabel = ODW.MLS.getCurrentLabel();
$gameVariables.setValue(id, currentLanguageLabel);

Original thread: https://forums.rpgmakerweb.com/threads/use-language-plugin-to-change-a-variables-value.172811/