Snippets

Дејан Стјепановић Replace text in HTML (l10n)

Created by Дејан Стјепановић

Regex:

([^-|^\?|^=])>\s*([^<|\n]*\w+[^<|\n]*)\s*<

Replace with:

$1><?php echo \$this->translate('$2'); ?><

Original:

<a href="#" class="quick-view">
    <b><span class="icon"></span> Quick view</b>
</a>

After replace:

<a href="#" class="quick-view">
    <b><span class="icon"></span><?php echo $this->translate('Quick view'); ?></b>
</a>

Tested in PhpStorm

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.