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?