Message extract error: Make sure both category and message are static strings

Hello,

I have Yii:t() wrapped in another component/method:

<?php
namespace app\components;

    use Yii;

    class Locale extends \yii\base\Component { 

        public static function t(string $data = null, array $params = null): string {

            if($data == null)
                return '';

            $last_char = null;
            if (substr_compare( $data, '.', -1 ) === 0) { $last_char = '.'; }
            if (substr_compare( $data, ':', -1 ) === 0) { $last_char = ':'; }
            if ($last_char) { $data = substr($data, 0, -1); }

            $trans = ($params) 
                ? \Yii::t('app', $data, $params)
                : \Yii::t('app', $data);

            return $last_char
                ? $trans . $last_char
                : $trans;
        }

But running ./yii message messages\config.php on my project extracts no resources with 'translator' => 'Locale::t' in config.php.

Instead I get a lot of these errors:

Skipping line 49. Make sure both category and message are static strings.

Is this a known problem and has there been any attempts to fix this?

On config.php change translator value from 'Locale::t' to 'Yii::t', because that’s how you are translating on code.

Perhaps I am mis-reading libedux reply, but didn’t I indicate in original posting that translator in config.php is already set to Locale::t?

You can’t use variables in t(). I think these messages are indicating that.

It is not about variables which we don’t use.

It is because Locale::t() method does not have a category parameter as first parameter.

Ah, that. Yes, it can only now read similar signature of the method.

You may want to add a note about this to documentation, right now it reads like any overriding of Yii:t() is valid.

Where in the docs you’d expect it?