mitchellsimoens/Ux.locale.Manager — pull request #27 by tralves (2013-06-12 14:29:52+00:00)
Title: Tpl support

# Description:
Added support for tpl localization.

Notes:
Only implemented for Sencha Touch! Not Ext.
Only tested on ST 2.2.1

This was implemented in the Component override, so it should work with every component child object.

# Usage:

1. Create the component with the `data` and `locales.tpl` like so:

```javascript
var welcomePanel = {
xtype: "panel",
data: {
name: VSBabyMobile.app.vsbUser.get("UserName")
},
locales: {
tpl: "home_screen.hello"
}
};
```
or:
```javascript
var welcomePanel = {
xtype: "panel",
data: {
name: VSBabyMobile.app.vsbUser.get("UserName")
},
locales: {
tpl: {
defaultTpl: "Hello {name} and welcome!",
key: "home_screen.hello"
}
}
};
```

2. The `locales/{locale}.json` file will have the template:

```javascript
"home_screen": {
"hello":"Olá {name} e bem vindo!",
}
```