kalessil / yii2inspections

MIT License
32 stars 2 forks source link

[fixed, bug] Not found message annotation #17

Closed nvlad closed 7 years ago

nvlad commented 7 years ago

image

with extension "vova07/yii2-imperavi-widget"

kalessil commented 7 years ago

Thank you for reporting @nvlad, shouldn't the category be imperavi? Or that's a Yii feature for addressing translations in extensions?

nvlad commented 7 years ago

Plugin found i18n declaration in extension vova07/yii2-imperavi-widget and add in completion list(category & message), also MissingTranslationsInspector mark this message as missed

kalessil commented 7 years ago

I see, checking this.

TrueXakeP commented 7 years ago

I have this warning too but with my own messages. Placing messages folder to project root doesn't help.

warning common/config.php:

return [
    ...
    'components' => [
        ...
        'i18n'     => [
            'translations' => [
                'app*'      => $appMsgs = [
                    'class'    => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@messages',
                ],
            ],
        ],
    ],
];

bootstrap.php:

Yii::setAlias('@messages', dirname(__DIR__) . '/messages');
kalessil commented 7 years ago

@TrueXakeP: the plugin expect translation files to be directly in ru/uk directory (the common/config.php is not parsed, we are following Yii2/Craft3 directory structure here).

Alternatively in v1.0.0 you can deactivate this specific case reports in the inspection settings (but autocompletion will remain)