translate
translate copied to clipboard
Does not detect strings inside `url()` function
Not common practice, I know, but I've found this plugin won't detect the following:
{{ url('mystring'|t) }}
To achieve this I relaxed the rule that the translated string must be surrounded by {{ or {%, instead it must be surrounded by at least a space.
Regex:
'/(\s*.*?)\'(.*?)\'.*?\|.*?(t|translate)(\(.*?\)|).*?(\s)/',
Example:
url( 'mystring'|t )
Quite brittle and not the best approach, but it got me past a deadline!
Thanks, this and one other issue have to be resolved by me creating a regex pattern that I'm working on, but is a though one.