laminas-i18n icon indicating copy to clipboard operation
laminas-i18n copied to clipboard

Add way to collect messages

Open Slamdunk opened this issue 4 years ago • 1 comments

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?

  1. A static analyzer addon (PHPStan/Psalm)? Elegant but a bit cumbersome, also requires perfect typing
  2. A conventional global function to inspect with a regex/tokenizer? Simple and easy, but not elegant

Any idea?

Slamdunk avatar Mar 16 '20 11:03 Slamdunk

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.

Koen1999 avatar Jan 31 '22 09:01 Koen1999