Closed brandonkelly closed 7 years ago
Yeah, I put it in there just to show how translations are done in terms of the category to use, etc. Since it's possible people would generate a plugin with no other components, so it seemed like a good place to put it.
I will keep that in mind for other logging stuff tho thx.
OK, well if it's meant to be an example, you should at least update it to use a token for the plugin name (you should never need to concatenate a non-translated string with a translated string when building a single message):
Craft::info(Craft::t('wmylforms', '{name} plugin loaded', ['name' => 'WmylForms']), __METHOD__);
or better yet,
Craft::info(Craft::t('wmylforms', '{name} plugin loaded', ['name' => $this->name]), __METHOD__);
Gotcha, will do.
This line in a generated plugin:
should just be:
We've found that translating log messages ends up causing more trouble than it's worth, since it's usually the developer that ends up having to parse the logs, so it's better if it's in their native language.