mitchellsimoens/Ux.locale.Manager — pull request #29 by matthewdfleming (2014-04-14 17:04:50+00:00)
Title: Added support for i18n of the data portion of the config. 

This allows for translations within standard _Components_ with tpl as well as the list items within a _DataView_. I tested this only within Sencha Touch (2.3.1). Since you are much more familiar with the event patterns used, please let me know if there is some condition or feature that I'm messing up based upon the implementation.

Container tpl block example
---------------------------------------------
The name of the member variable within the locales/data block gets pushed into the tpl with a variable of the same name. So in the example above, _privacyPolicyText_ will get translated using the _General.Footer.Links.PrivacyPolicy.Text_ key inside the i18n json files, and that value will be used within the template.

```javascript
extend: 'Ext.Container',
locales: {
data: {
privacyPolicyText: 'General.Footer.Links.PrivacyPolicy.Text'
}
},
tpl: [
'© ' + Ext.Date.format(new Date(), 'Y') + ' Company® ',
'{privacyPolicyText}'
]
```

DataView itemTpl block example
------------------------------------------------
Same as the container block above, the only things to note here are:
* You can see how the existing i18n mixes in with the data substitution
* There is a second object form of the data substitution if you want to use the key/defaultTranslation style that seems to be supported in general.

```javascript
xtype: 'dataview',
locales: {
title: 'Screens.Programs.ToolBarText',
loadingText: 'General.Mask.Loading.Programs',
emptyText: 'Screens.Programs.Body.NoneAvailable',
data: {
viewByDateText: {
key: 'Screens.Programs.Body.ViewByDateText',
defaultTranslation: ''
},
unavailableProgramText: 'Screens.Programs.Body.UnavailableProgram'
}
},
itemTpl: [
'

unavailable">',
'

completed">

',
'

',
'

{name}

',
'

',
'',
'{viewByDateText} {viewBy:date("m/d/Y")}',
'',
'{unavailableProgramText}',
'',
'

',
'

',
'

',
'

'
],
```