Open thibaultmeyer opened 9 years ago
Thanks 0xbaadf00d! does mvn test run?
But usually that's not a bug. It actually can happen that $lang is absent when Ninja is not able to determine the language - neither from the incoming request - nor from the lang cookie set by ninja. Does your test send the accept language header?
If you want to dig in the code have a look into TemplateEngineFreemarker.java line 242
Hi,
yes, tests are ran with maven (mvn test
or directly mvn package
).
If language can't be determined by request or cookie, the translation system use the default value from application.conf ? maybe $lang can be set to this default value too ?
Ninja version: 5.1.0 OS: Windows 8.1 64bits
I have a simple tamplate (from the default archetype) and I put this in the index.ftl.html :
mvn compile
andmvn ninja:run
works without issue and the HTML page in the browser show the current langage (ie: en, en-US, ...). But during themvn package
process, I got a error on the unit test phase :I have to use
<#if lang??>${lang}</#if>
rather than${lang}
, but isn't a good solution (i think) and this is the only predef variable to have this behavior...