Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

English
In this article, we will showcase ability to set language locale automatically by picking up the locale returned by the end user's browser.


Figure 1: App Locale Changes Automatically Based on Browser's Locale

...

If not, we won't not be able to see the impact we want to when we actually change the locale later on.

Image RemovedImage Added


Place this html to show language icons on the top right for manual switching. This code is adapted from Change User Locale In Userview UI Header.

Code Block
languagexml
titleSub Header
linenumberstrue
<div id="languages">
    <li><a onClick="switchLanguage('en_US'); return false;" class="btn waves-effect btn waves-button waves-float"><img title="English" src="#appResource.US-United-States-Flag-icon.png#"/></a></li>
    <li><a onClick="switchLanguage('pt'); return false;" class="btn waves-effect btn waves-button waves-float"><img title="Portuguese" src="#appResource.PT-Portugal-Flag-icon.png#"/></a></li>
    <li><a onClick="switchLanguage('fr'); return false;" class="btn waves-effect btn waves-button waves-float"><img title="French" src="#appResource.FR-France-Flag-icon.png#"/></a></li>
</div>

...