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

Remove translation in CRUD #190

Open
larry-tx opened this issue Jan 12, 2017 · 4 comments
Open

Remove translation in CRUD #190

larry-tx opened this issue Jan 12, 2017 · 4 comments
Labels

Comments

@larry-tx
Copy link

Is there any way to disable I18N translation behavior when generating CRUD in giiant. I have, on every single occasion, ensured that I18N is not check when generating CRUD. I have also ensured that Translation behavior is disabled when generating the models. Yet, every single time, I have to through all the views created by giiant, searching for 't(' to find all the instances were it occurs and manually delete each one individually.

I have absolutely no need or use for translations on the backends that I create. Having to set up a message source for each model that does nothing but give the English language for everything just adds unnecessary weight.

@schmunk42
Copy link
Owner

schmunk42 commented Jan 12, 2017

Do you run it on the CLI? That would be always my recommendation.

--enableI18N: boolean, 0 or 1 (defaults to 0)
  This indicates whether the generator should generate strings using Yii::t()
  method. Set this to true if you are planning to make your application
  translatable.

So if this is disabled, it's a bug. I need to double check.


I've added the help of the console commands: https://github.com/schmunk42/yii2-giiant/blob/master/docs/25-cli-commands.md

You can also specify this in an application controllerMap or script.

@larry-tx
Copy link
Author

larry-tx commented Jan 12, 2017 via email

@schmunk42
Copy link
Owner

schmunk42 commented Jan 12, 2017

Just double checked it. Clearly a bug.

Thank you for reporting.

@Parro
Copy link

Parro commented Apr 11, 2018

If you do not need translations in your app, you could put this in your configuration to avoid the missing category errors

'i18n' => [
    'translations' => [
        '*' => [
            'class' => 'yii\i18n\PhpMessageSource'
        ],
    ],
],

See https://www.yiiframework.com/doc/guide/2.0/en/tutorial-i18n#default-message-source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants