Sunday, 15 June 2014

wordpress - Sublime Text regex: replace Strings with Gettext -



wordpress - Sublime Text regex: replace Strings with Gettext -

i made error writing template page in wordpress , set regular strings everywhere instead of gettext calls. should replace strings in these specific constructs gettext calls.

example:

displaydatarow($$fueltypepacksname,'model-tech-wheels','wheels'); displaydatarow($$fueltypepacksname,'model-tech-curb-weight',__( 'wheels', 'agr' ));

i haven't learned regex yet, sorry :(

it not clear want replace, pattern finding strings

'[^']*'

so, if illustration want replace "hello world" gettext("hello world") have do

find: ('[^']*') replace: gettext(\1)

essentially, parantheses added around pattern mean "keep find", , \1 means "replace first thing found.

regex wordpress sublimetext gettext

No comments:

Post a Comment