<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<ui:composition template="/main.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:tc="http://myfaces.apache.org/tobago/component"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<ui:param name="title" value="#{demoBundle.format}"/>
<p>Use the EL functions from <code>tc:format1</code> to <code>tc:format9</code>
to replace up to 9 variables in a given internationalized text.
This work like in <tc:link label="java.text.MessageFormat"
link="https://docs.oracle.com/javase/6/docs/api/java/text/MessageFormat.html"/>.</p>
<tc:section label="Format 1">
<p>The message format is: "#{demoBundle.format1}"</p>
<pre><code class="language-markup"><tc:out value="\#{tc:format1(demoBundle.format1, 695700)}"/></code></pre>
<tc:out id="o1" value="#{tc:format1(demoBundle.format1, 695700)}"/>
</tc:section>
<tc:section label="Format 3">
<p>The message format is: "#{demoBundle.format3}"</p>
<pre><code
class="language-markup"><tc:out value="\#{tc:format3(demoBundle.format3, 5800, 15700000, 5000000)}"/></code></pre>
<tc:out id="o2" value="#{tc:format3(demoBundle.format3, 5800, 15700000, 5000000)}"/>
</tc:section>
<tc:section label="Format 9">
<p>The message format is: "#{demoBundle.format9}"</p>
<pre><code
class="language-markup"><tc:out value="\#{tc:format9(demoBundle.format9, 0, 1, 2, 3, 4, 5, 6, 7, 8)}"/></code></pre>
<tc:out id="o3" value="#{tc:format9(demoBundle.format9, 0, 1, 2, 3, 4, 5, 6, 7, 8)}"/>
</tc:section>
<tc:section label="UpperCase">
<p>You may also use the <code>fn:</code> function library for string manipulation.</p>
<pre><code class="language-markup"><tc:out value="\#{fn:toUpperCase('uppercase')}"/></code></pre>
<tc:out id="o4" value="#{fn:toUpperCase('uppercase')}"/>
</tc:section>
</ui:composition>