Refactor translation to use extension, more flexible