Commits

vmorsiani committed fd48e30

added locale support

  • Participants
  • Parent commits f491d1d

Comments (0)

Files changed (3)

File jticketing-webapp/src/main/resources/org/wanna/jticketing/web/locale/messages_en.properties

 #Navigation
 navigation.dashboard=Dashboard
+navigation.ticket=Ticket
 login=login
 
 #Ticket forms

File jticketing-webapp/src/main/webapp/WEB-INF/templates/layout.xhtml

-<?xml version="1.0" encoding="UTF-8"?>
 
-<!DOCTYPE html
-        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml"
+<f:view contentType="text/html" encoding="UTF-8" locale="#{localeBean.currentLocale}"
+      xmlns="http://www.w3.org/1999/xhtml"
       xmlns:h="http://java.sun.com/jsf/html"
-      xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets">
+      xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:f="http://java.sun.com/jsf/core">
 
 <h:head>
     <title>JTicketing</title>
-    <h:outputStylesheet library="css/default" name="layout.css"/>
 </h:head>
 
 <h:body>
                 </h:outputLink>
             </h:panelGrid>
             <h:panelGrid rendered="#{not userBean.authenticated}">
-                <h:link value="login" outcome="nav_login"/>
+                <h:link value="#{message['login']}" outcome="nav_login"/>
             </h:panelGrid>
         </p:layoutUnit>
         <p:layoutUnit position="center">
     </p:layout>
 </h:body>
 
-</html>
+</f:view>

File jticketing-webapp/src/main/webapp/includes/navigation.xhtml

 <h:body>
     <h:form>
         <p:menubar>
-            <p:menuitem value="Dashboard" url="/secured/dashboard/view.html"/>
-            <p:menuitem value="Tickets" url="/secured/ticket/view.html"/>
+            <p:menuitem value="#{message['navigation.dashboard']}" url="/secured/dashboard/view.html"/>
+            <p:submenu label="#{message['navigation.ticket']}">
+                <p:menuitem value="search" url="/secured/ticket/view.html"/>
+            </p:submenu>
+
             <p:menuitem>
                 <h:panelGrid>
                     <h:form>