To change the User’s Default Language after a new registration (English, by default), you need to edit the following file:
– controllers/UserController.php – Line 332
For example, if you want the default language after a new registration to be Portuguese, you need to replace this line:
$profile->language = !empty(Yii::$app->language) ? Yii::$app->language : 'en-US'
By:
$profile->language = 'pt-PT'
Note: ‘pt-PT’ must be an available language in the application, that is, the translation file must be included in the @app/messages folder.
And that’s it!