Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.


Folders and files

Last commit message
Last commit date

Latest commit



23 Commits

Repository files navigation



Ext.i18n.Bundle allows to use properties files (or bundle files) from Java to use them as i18n resources with Sencha Touch.


    name: 'AppTest',

    requires: ['Ext.i18n.Bundle'],

    bundle: {
        bundle: 'Application',
        lang: 'es-ES',
        path: 'resources',
        noCache: true

    launch: function(){
            fullscreen: true,
            items: [
                    xtype: 'titlebar',
                    docked: 'top',
                    title: {type: 'bundle', key: 'panel.title'}  //3
            tpl: [ //4
                'Hello {name}! <br>',
                    getMsgFromResources: function(){
            data: {name: 'Joe'}

Using Ext.i18n.Bundle is very simple. You just need to config your bundle instance. In this case we want to retrieve a bundle file called Application for Spanish language - es-ES - located at resources path. This will load a file called

GET http://yourdomain/resources/

In case this file doesn't exist, then the bundle will try at:

GET http://yourdomain/resources/

for the default bundle file.

The steps are the following:

1 - Declare the Ext.i18n.Bundle as required.
2 - Define the bundle instance for the current application using the config options.
3 - You can use a lazy initialization object to get bundle keys by specifying the type and key.
4 - You can use the bundle instance from a tpl method if you want too.

The bundle instance is attached to the current Application instance, which you can access at <Your App Name>.app.bundle in the example we have

Note: It is important to notice that bundle will be ready after the data is loaded. That's why the lazy initialization objects help to declare them in the config section of your components. In case you want to access the keys by code, you have to do it inside a class method such as constructor or initialize methods.


Ext.define('MyView', {
	extends: 'Ext.Panel',
	config: {
		html:'my.html') + ' - this is mixed content'


Ext.define('MyView', {
	extends: 'Ext.Panel',
	config: {/* ... */}

	initialize: function() {
		this.setHtml('my.html') + ' - this is mixed content');

It is important to notice as well that bundle lazy initialization objects cannot be mixed with text:


Ext.define('MyView', {
    extends: 'Ext.Panel',
    config: {
        html: {type: 'bundle', key: 'my.html'} + ' - this is mixed content' // wrong!!!

##Release Notes


  • Sencha Touch 2.3 compat
  • Added bundle as part of the Ext.application definition
  • Now you can use {type: 'bundle', key: 'key'} object to lazy instantiate your keys


  • Sencha Touch 2 Beta1 compatible code.


  • Sencha Touch 2 PR4 compatible code.
  • Patch for PhoneGap. PhoneGap is using XHR thru file:// protocol then AjaxProxy doesn't retrieve data.


  • Sencha Touch 2 PR3 comaptible code.
  • Removed config method. All the requests are made using GET method.
  • Solved issue with extra arguments passed to URL. Now you have no limits, start nor group extra parameters in URL.