added support for locale passing to templating system