yii2-oauth2-server icon indicating copy to clipboard operation
yii2-oauth2-server copied to clipboard

Add translation support for the models

Open aliechti opened this issue 9 years ago • 0 comments

The models do not use Yii:t() which would be useful, for using the models in another language.

This would for example in OauthAccessTokens change:

public function attributeLabels()
{
    return [
        'access_token' => 'Access Token',
        'client_id' => 'Client ID',
        'user_id' => 'User ID',
        'expires' => 'Expires',
        'scope' => 'Scope',
    ];
}

to

public function attributeLabels()
{
    return [
        'access_token' => Yii::t('oauth2-server', 'Access Token'),
        'client_id' => Yii::t('oauth2-server', 'Client ID'),
        'user_id' => Yii::t('oauth2-server', 'User ID'),
        'expires' => Yii::t('oauth2-server', 'Expires'),
        'scope' => Yii::t('oauth2-server', 'Scope'),
    ];
}

aliechti avatar Aug 11 '15 14:08 aliechti