You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extracting translation keys from source is nice, and saves us a few steps and makes thing less error prone in general.
Currently, in PHP, only TranslatorInterface::trans() in controllers calls are extracted as such. However, often we have just a translatable string, which is passed to the translator later on. E.g. with knp menus:
To extract translation.key i propose to add $string = Translatable::_('translation.key'). Which is an identity function defined in contracts. It enables extractors to act upon. More short, maybe t('string') even ...
Next, we should scrape entire src IMHO, or any source file from the DI container.
Extracting translation keys from source is nice, and saves us a few steps and makes thing less error prone in general.
Currently, in PHP, only
TranslatorInterface::trans()
in controllers calls are extracted as such. However, often we have just a translatable string, which is passed to the translator later on. E.g. with knp menus:To extract
translation.key
i propose to add$string = Translatable::_('translation.key')
. Which is an identity function defined in contracts. It enables extractors to act upon. More short, maybet('string')
even ...Next, we should scrape entire
src
IMHO, or any source file from the DI container.Related, can we consider https://github.com/php-translation/extractor for core? Or why is there something competing doing a better job?
The text was updated successfully, but these errors were encountered: