Check template instead of locale folder for supported languages.

This way the language files are not needed at runtime, only the
precompiled templates are.

Thanks to Jonas Smedegaard for reporting.