I’m currently adding translation markup to a load of files. Here’s a before/after:
- <h3>Need to protect your scoop?</h3>
+ <h3><%= _('Need to protect your scoop?') %></h3>
Using vim-surround, this takes a few steps:
ysit'
(surround in tag with single quote)ysa')
(surround the single quotes with parenthesisysa(=
(surround the parenthesis with erb tags)- Manually insert
_
before the first paren
You can then run the macro on lines matching a pattern with something like
:g/pattern/norm! @a