Book Image

Mastering ExtJS - Second Edition

By : Loiane Avancini
Book Image

Mastering ExtJS - Second Edition

By: Loiane Avancini

Overview of this book

Table of Contents (19 chapters)
Mastering Ext JS Second Edition
About the Author
About the Reviewers

The multilingual capability

Sometimes you want to ship the project or product that you are working on overseas, and so having the translation capability is very important. After all, not everyone understands or speaks the same language that you do. And this is what we are going to implement in this topic: a multilingual component that we can use to translate the labels of this project. So at the end of this topic, this is going to be our output:

The idea is to store the user language preference locally, so the next time the user loads the application, the preferred language will be automatically set. And when the user changes the language, the application needs to be reloaded, so the new translations can be loaded into the memory.

Creating the change language component

If we take a look at the screenshot we showed at the beginning of this topic, we can notice that the multilingual component is a button, and when we click on the arrow, a menu pops up with the available languages.

The button with...