replace tags with locals