You are on page 1of 12

ExtJs Localization

IMPLEMENTATION TECHNIQUES

ExtJs Localization

31-Mar-14

Agenda
2

Definition

ExtJs localization - Static


ExtJs localization - Dynamic Existing Approaches

Demo Application
L10N Requirements

ExtJs Localization

31-Mar-14

Definition
3

Localization

Translation

ExtJs Localization

31-Mar-14

ExtJs localization
4

40 language files

extjs/locale/ext-lang-

<li>_<ci>.js

ExtJs Localization

31-Mar-14

ExtJs localization
5

Static Create gui component

Add script tag with locale file Translate custom texts

Show me the code

ExtJs Localization

31-Mar-14

ExtJs localization
6

Dynamic

Select language -> combo, country flag, etc. Encode to the url -> Ext.urlEncode Create locale file path -> Ext.util.Format.format ("../../locale/ext-lang-{0}.js", lang);

Insert script -> Ext.Loader.injectScriptElement Recreate the gui

Show me the example

ExtJs Localization

31-Mar-14

Existing approaches
7

LocaleManager by Sencha team developer

Json locale files Change language -> Ajax request Keep changes Override the required component from ExtJs
Class with properties locale files Locale folder Unable to change the language Default language texts are mixed with code

LocaleLoader by Jordy Theiller


x x

ExtJs Localization

31-Mar-14

Existing approaches cont


8

Calendar by FeyaSoft

Class with properties locale files Change language->Ajax request Persist changes

ExtJs Localization

31-Mar-14

Demo Application
9

Pros: Object definition for locale files Create user-lang property in localStorage No overrides Loading only the specified locale file Cons: No data persisting Show me the example

ExtJs Localization

31-Mar-14

L10N Requirements
10

change language dynamically

separate translation files


load one locale file at a time synchronized locale files

naming convention for the locale keys


intuitive locale file structure persistence of changes

ExtJs Localization

31-Mar-14

References
11

http://docs.sencha.com/extjs/4.2.1/#!/api http://en.wikipedia.org/wiki/Language_local isation Mastering Ext JS - Loiane Groner stackoverflow.com https://github.com

ExtJs Localization

31-Mar-14

12

To Be Continued

ExtJs Localization

31-Mar-14

You might also like