The Locale object is passed to Configuration.getTemplate as parameter. The TemplateLoader already received the template name(s) deduced for the Locale. How localized names are deduced is defined by Configuration.setTemplateLookupStrategy. The default is http://freemarker.incubator.apache.org/docs/api/freemarker/cache/TemplateLookupStrategy.html#DEFAULT_2_3_0, but you can define your own strategy by extending TemplateLookupStrategy.
Tuesday, December 8, 2015, 3:44:39 AM, John D. Ament wrote: > I was wondering, how does template loading work with locale aware requests? > > For example, I may have template files like: > > - registration_en_txt.ftl > - registration_fr_txt.ftl > > Ideally, I'd like to specify my locale when fetching the template to > separate out the locating and language awareness. I don't see any > information that could be passed around with this information. If I look > at > https://github.com/apache/incubator-freemarker/blob/2.3-gae/src/main/java/freemarker/cache/TemplateLoader.java > I > don't see the locale passed in when trying to get a template. > > John -- Thanks, Daniel Dekany --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
