fix undefined error
pass locale from generator object to formatter object
move formatter-related attributes from Base role to Formatter role