Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Vietnamese language #15

Merged
merged 1 commit into from
Oct 30, 2014
Merged

Add Vietnamese language #15

merged 1 commit into from
Oct 30, 2014

Conversation

aoopvn
Copy link
Contributor

@aoopvn aoopvn commented Oct 30, 2014

I just add Vietnamese language for messages, so that anybody can get benefit from it.

Thank you very much for your awesome work!

@aoopvn
Copy link
Contributor Author

aoopvn commented Oct 30, 2014

Btw, just in case that other pull request for multi-language is still on the waiting list, my suggestion below is a temporary way to allow user override the messages without losing their translation after run composer update. It's only my opinion.

public function initI18N()
{
      if (!isset(Yii::$app->i18n->translations['kveditable']))
      {
         //current code logic
      } 
}

then in main.php user can get an overridable i18n for kveditable, just like awesome @kartik-v 's gridview

'i18n' => [
            'translations' => [               
                //override kveditable config, just like gridview
                'kveditable' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@common/messages',
                    //'forceTranslation' => true
                ],
            ],
]

Then you got your translation in messages.

kartik-v added a commit that referenced this pull request Oct 30, 2014
@kartik-v kartik-v merged commit 3304f18 into kartik-v:master Oct 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants