schmunk42 / yii2-giiant

Yii 2 Framework Code Generator Gii on Steroids
271 stars 120 forks source link

Remove translation in CRUD #190

Open larry-tx opened 7 years ago

larry-tx commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

I suppose that might be a little easier than manually deleting each instance of t(…). This is clearly a bug. Hope you’ll designate it as such. Please let me know when it’s fixed so that I can start using giiant again.

From: Tobias Munk [mailto:notifications@github.com] Sent: Wednesday, January 11, 2017 11:48 PM To: schmunk42/yii2-giiant yii2-giiant@noreply.github.com Cc: LarryTX LarryTX@outlook.com; Author author@noreply.github.com Subject: Re: [schmunk42/yii2-giiant] Remove translation in CRUD (#190)

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.

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/schmunk42/yii2-giiant/issues/190#issuecomment-272081885 , or mute the thread https://github.com/notifications/unsubscribe-auth/AABRBx8ldY271CgC34OXP4nrlGvyWvYTks5rRb6ZgaJpZM4LhWnx . https://github.com/notifications/beacon/AABRB3WzDTqKo0m4BxAr-iBX8N9L1TH4ks5rRb6ZgaJpZM4LhWnx.gif

schmunk42 commented 7 years ago

Just double checked it. Clearly a bug.

Thank you for reporting.

Parro commented 6 years ago

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