laminas-i18n
laminas-i18n copied to clipboard
Add way to collect messages
Feature Request
Q | A |
---|---|
New Feature | yes |
RFC | no |
BC Break | no |
Summary
Hi, Yii2 framework has an extension (yii2-translate-manager) to help gathering all the messages that need a translation.
The extension also provides a complete set of tools to help manage the I18n topic: all of them could easily be written as a laminas-i18n
addon/extension too, but the ability of allowing a standard way to gather the messages to be translated I think should rely in this very package.
How to achieve this?
- A static analyzer addon (PHPStan/Psalm)? Elegant but a bit cumbersome, also requires perfect typing
- A conventional global function to inspect with a regex/tokenizer? Simple and easy, but not elegant
Any idea?
Maybe useful for inspiration, so leaving this here. In our project we use the following helper script: https://github.com/GEWIS/gewisweb/blob/master/translate-helper
But I think this corresponds to what you call the not elegant solution.