laminas / laminas-i18n-resources

Provides validator and captcha translations for laminas-i18n's Translator
https://docs.laminas.dev/laminas-i18n-resources/
BSD 3-Clause "New" or "Revised" License
9 stars 9 forks source link

Script is needed to check all message identifiers automatically #2

Open weierophinney opened 4 years ago

weierophinney commented 4 years ago

Problem

The translation files contain two main problems:

Suggestion

Create a script to extract all messages from validator and captcha classes and check all message identifiers in the translation files.

Any help is welcome and appreciated!


Originally posted by @froschdesign at https://github.com/zendframework/zend-i18n-resources/issues/43

Slamdunk commented 4 years ago

I think the issue is a bit more wide: provide a way to collect messages handled by Laminas Translator. Reported in that repo: https://github.com/laminas/laminas-i18n/issues/20

froschdesign commented 4 years ago

@Slamdunk This issue report is related to the pre-translated messages of the validator classes. This means to extract the messages templates of the related classes. The script for these messages is only for internal use.

See: https://github.com/laminas/laminas-validator/blob/649bbd4c4f0ba73645a59a473dbb93c473a4ea16/src/NotEmpty.php#L66-L69

Slamdunk commented 4 years ago

I would argue that the issue is still not internal only.

If I create a custom validator, I'd write a class with an identical structure of the Laminas' ones.

So I end up with the same issue of Laminas of collecting that $messageTemplates variable from my class in order to translate it in all the languages I need.

froschdesign commented 4 years ago

I'm sorry for the misunderstand. The script which I mean is for internal use of this component. How to fetch the text messages is not the topic of this component. The script will use a method which can also be used for other purposes.