Closed rauwebieten closed 4 years ago
Cli command can not find these. Likely it could be adjusted for it but I haven't looked into it. Also there's no shortcut for t()
.
A shortcut is easily added in the twig config:
...
'functions' => [
't' => [\Yii::class,'t']
]
...
Also, when my twig templates are compiled into the cache directories, the extractor can find them now by parsing the compiled .php files.
Oh, cool. t()
could be implemented by default and pointing extraction to compiled templates could be documented.
Sorry to comment on a closed issue, but this does not appear to be picked up by
console/controllers/MessageController.php
Can Yii.t or t( calls in twig files be "extracted" like Yii::t in PHP files?
How can I translate messages in twig templates? It seems there is not function/filter defined.
I can use
{{ app.i18n.translate('app','First name',{},'nl-BE') }}
But is there a shortcut like Yii::t ?Also, can the cli-command for extracting messages find these messages?