title: Set global language value in Yii2 application
body: <p>Where can I set language (based on user's cookie) globally? How to make it work in the whole application (controllers,views, etc.) ?</p>
  
  <p>In documentation I found  <code>\Yii::$app-&gt;language = '';</code> but, where I can write my logic to change the language in right way?</p>