Gravs documentation is a little bit harsh on PHP developers that want to write plugins. What can you do in this situation? Look trough source code, check other plugins or var_dump $this object ๐
I’ve spent some time searching for an answer how to access language var in plugins class. And this is it:
// Will output two letter ISO 3166-1 alpha-2 code of country
$language = $this->grav['language'];
$language->getLanguage();
Have fun with coding and don’t get crazy during that ๐