fixed some template translation code and added some temporary logging code