Developer

Language Selector

Use the Web UI language selector to override language settings. If you introduce additional languages, update the language selector to incorporate them.

Language selector HTML templates and Java actions are defined in these files:
  • html\com\sybase365\mobiliser\web\application\pages\BaseLoginPage.html
  • html\com\sybase365\mobiliser\web\application\pages\BaseApplicationPage.html
Sample HTML settings are:
<div id = "languageSelector">    
  <script type = "text/javascript"> // <![ CDATA [    
     function _switch() {    
       \ $j ( "\# languageSelector").toggle("medium");    
       return   false ;    
     }   
  //]]></script>    
  <ul id = "language-select">    
   <li>    
     <a onclick = "_switch()" wicket:id = "changeToEnglish">   
     <wicket:message key = "application.header.language.english"/>    
     </a>    
   </li>    
   <li>    
     <a onclick = "_switch()" wicket:id = "changeToGerman">    
     <wicket:message key = "application.header.language.german"/>    
     </a>    
   </li>    
 </ul>   
</div>
Sample Java:
protected void initOwnPageComponents() {    
...    
   add(new Link("changeToEnglish") {    
     @Override    
     public void onClick() {    
       getWebSession().setLocale(getUpdatedLocale("en_US"));   
       getSession().info (    
       getLocalizer().getString("language.change.success", this));    
       setResponsePage(getApplication().getHomePage());    
    }    
   };    
   
   add(new Link("changeToGerman") {    
     @Override    
     public void onClick() {    
       getWebSession().setLocale(getUpdatedLocale("de_DE"));    
       getSession().info(getLocalizer().getString("language.change.success, this));   
       setResponsePage(getApplication().getHomePage());    
     }    
   };    
... 
}