schmunk42 / gii-template-collection

Gii Template Collection with code templates for models and CRUDs
https://github.com/schmunk42/gii-template-collection
51 stars 20 forks source link

Clarify "Message catalog" settings #48

Open motin opened 11 years ago

motin commented 11 years ago

There is currently a "Message Catalog Standard" with default value "crud" and a "Message Catalog" with default value "model".

  1. Why is "model" a default value? I have never used this label. "crud" and "app" are sane defaults though.
  2. What exactly is "Message Catalog Standard"? The name nor it's hint does not explain (it's "standard" as opposed to "generated", but it's used in generated code)

Somewhere I suspect that "Message Catalog" is for fieldname-dependent translations and "Standard" is for more ordinary static strings, but in that case the defaults ought to be "app" for "Standard" and "crud" for fieldname-dependent translations, and the names and hints should explain their application.

uldisn commented 11 years ago

I prefer use for module message catalag in same module separate from app messages. Then module more plugable.Currently in one module I use follow values:

Tobias prefer use "model". If its mean separate for each model in module, then I think, that not good. So many translation files. My be better "module", if it is common for module.

In "Full Module" Gii generator I included message catalog with standard translation for LV and no more problems with translation "Save", "Cance;",....

schmunk42 commented 11 years ago

I merged @uldisn PR introducing the new message catalog. The idea is that the "standard" translations for button labels, etc... go into crud while the model specific translations go into model usually MyModule.model in my cases.

I think the separation makes totally sense, how can we name that, so that this is more intuitive?

motin commented 11 years ago

Since messageCatalog was introduced in gtc, I believe the default has been "crud", and at least I have grown accustomed to think of the messages/lang/crud.php as the place to translate things like "Book", "Chapter" etc, but 'model' is even better I believe.

The default catalog name is 'messages' in yii, so maybe we should default to that in case of the "standard" messages? Otherwise 'app' has been a default in gtc for a while.

Based on that, a proposal could be:

"Message Catalog Standard" Hint: Message catalog for CRUD standard hints and labels. Default: crud -> "Default Message Catalog" Hint: Message catalog for general strings such as 'Cancel', 'Save' etc. Default: messages or app

"Message Catalog" Hint: Message catalog for CRUD generated hints and labels. Default: model -> "CRUD Message Catalog" or "Model Message Catalog" Hint: Message catalog for CRUD generated hints and labels that depend on your data model Default: crud or model, respectively