Changeset 1882


Ignore:
Timestamp:
2011-04-12 15:00:16 (13 months ago)
Author:
mpo
Message:

show how to download the bundle in json format and how to grab the locale in the template

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samples/kauri-i18n-sample/src/main/kauri/pages/index.html.xml

    r1880 r1882  
    1010 
    1111    <table i18n:bundle="org.kauriproject.samples.i18n"> 
     12      <t:variable name="msgUri" value="${publicUri('service:/main/jaxrs/msg')}" /> 
     13      <t:variable name="bundleUri" value="${publicUri('service:/i18n/bundles/org.kauriproject.samples.i18n')}" /> 
    1214      <tr> 
    1315        <th>English</th> 
     
    1820        <td>yes</td> 
    1921        <td>${i18n('yes')}</td> 
    20         <td><a href="./jaxrs/msg/yes">yes</a></td> 
     22        <td><a href="${msgUri}/yes">yes</a></td> 
    2123      </tr> 
    2224      <tr> 
    2325        <td>no</td> 
    2426        <td>${i18n('no')}</td> 
    25         <td><a href="./jaxrs/msg/no">no</a></td> 
     27        <td><a href="${msgUri}/no">no</a></td> 
    2628      </tr> 
    2729      <tr> 
    2830        <td>Example of parameters and mixed content</td> 
    2931        <td>${format(i18n('doc_status'), i18n('doc_status_draft'))}</td> 
    30         <td><a href="./jaxrs/msg/doc_status">doc_status</a> and <a href="./jaxrs/msg/doc_status_draft">doc_status_draft</a></td> 
     32        <td><a href="${msgUri}/doc_status">doc_status</a> and <a href="${msgUri}/doc_status_draft">doc_status_draft</a></td> 
     33      </tr> 
     34      <tr> 
     35        <td>Download bundle in <a href="${bundleUri}/en_US">English</a></td> 
     36        <td>or in <a href="${bundleUri}/${request.getAttributes().get('org.kauriproject.locale').getLocale()}">active language</a></td> 
    3137      </tr> 
    3238    </table> 
Note: See TracChangeset for help on using the changeset viewer.