Bottelet / translation-checker

find translations you forgot to add to your language files, check, and maintain translations in yor Laravel application
MIT License
90 stars 6 forks source link

Add possibility to extend regex functionality #4

Closed negoziator closed 1 month ago

negoziator commented 1 month ago

Simplification

  1. Initialize default regexes
  2. Loop over default regexes and remove all ifstatements

Extendability

  1. Add a function to add your own regex that matches other functions than the default ones.

example:

$extractor->addPattern('/mytranslatefunction\((["\'])(.*?)\1\)/', 2, 'mytranslatefunction');

This will now also make the RegexExtractor match translate functions called mytranslatefunction(...)