Localized includes large content blocks based on the view Locale or a provided Locale,
with fallbacks to default content. It is not recommended for small messages such as labels or headers: use resource bundles there.
These examples use the locale attribute. Normally you want to rely on the Locale set in the view.
Content1 (nl) in folder1
Content1 (nl_BE) in folder1
Content1 (fr) in root
Content1 (fallback) in root
<p>Content1 (fallback) in root</p>
Markdown and EL
Markdown requires you to include org.commonmark:commonmark in your project.
It's now 2026-11-02T11:23:34.828492299Z[GMT]
Inline
Not recommended, as it is hard to add languages to an application, but useful for a small set of languages.
Facets also allow you to use components.
Vast en zeker
Snack between lunch and dinner
Content files
Files should be put in the WEB-INF/pfe-localized folder. Files used in this demo can be found in our
GitHub repo.
Files should be named {name}, {name}_{language} or {name}_{language}_{country}.
Language and country should match those in the set view locale or the provided locale. See also the
Locale
documentation.
<div class="card">
<h5>Basic Usage</h5>
<p>These examples use the <code>locale</code> attribute. Normally you want to rely on the <code>Locale</code> set in the view.</p>
<div>
<pe:localized folder="folder1" name="content1" escape="false" locale="nl_NL"/>
<pe:localized folder="folder1" name="content1" escape="false" locale="nl_BE"/>
<pe:localized folder="folder1" name="content1" escape="false" locale="fr"/>
<pe:localized folder="folder1" name="content1" escape="false" locale="de"/>
<pe:localized name="content1"/>
</div>
</div>
<div class="card">
<h5>Markdown and EL</h5>
<p>Markdown requires you to include <code>org.commonmark:commonmark</code> in your project.</p>
<div>
<pe:localized folder="folder2" name="content2" escape="false" evalEl="true" markdown="true"/>
</div>
</div>
<div class="card">
<h5>Inline</h5>
<p>Not recommended, as it is hard to add languages to an application, but useful for a small set of languages.
Facets also allow you to use components.</p>
<div>
<pe:localized locale="nl_NL">
<f:facet name="nl_BE">Zeker en vast</f:facet>
<f:facet name="nl">Vast en zeker</f:facet>
</pe:localized>
<hr/>
<pe:localized>
<f:facet name="nl_BE">Vieruurtje</f:facet>
<f:facet name="nl">Snack tussen lunch en avondeten</f:facet>
<f:facet name="default">Snack between lunch and dinner</f:facet>
</pe:localized>
</div>
</div>