Remove locals() from strings substitutions

Fixes bug 1168988

Change-Id: Ifd1e7a027f16062ff35e777cf2d953f652a806a7
Merge "Remove locals() from strings substitutions"