Freemarker Localized templates, Variable lookup not working!

Answered

Hi, 

I have a localized template for English(step-1-i18n_en.ftl) and for French (step-1-i18n_fr.ftl) and Freemarker is able to pick the correct file based on the provided locale when I import the file without the localization name as follows: 

<#include "step-1-i18n.ftl">

However in this case Intellij will not resolve any of the variables defined in either of these files and will set a warning that the variable could not be found. 

Whereas, if I use the following the variables are being resolved correctly:

<#if .locale?startsWith("fr")>
<#include "step-1-i18n_fr.ftl">
<#else>
<#include "step-1-i18n_en.ftl">
</#if>
0
1 comment

May you share a sample project? 

0

Please sign in to leave a comment.