[BUGFIX] Fix localization handling to support XLIFF
authorDominique Feyer <dominique.feyer@reelpeek.net>
Mon, 13 Jun 2011 20:30:44 +0000 (22:30 +0200)
committerDominique Feyer <dominique.feyer@reelpeek.net>
Tue, 14 Jun 2011 14:29:25 +0000 (16:29 +0200)
Change-Id: Iaf9c1a2cde556e4b4007c1f1365013c84d4ed258
Relates: #25397

typo3/sysext/workspaces/Resources/Public/JavaScript/actions.js
typo3/sysext/workspaces/Resources/Public/JavaScript/component.js
typo3/sysext/workspaces/Resources/Public/JavaScript/configuration.js
typo3/sysext/workspaces/Resources/Public/JavaScript/grid.js
typo3/sysext/workspaces/Resources/Public/JavaScript/helpers.js
typo3/sysext/workspaces/Resources/Public/JavaScript/toolbar.js

index b68b6c6..e93afb5 100644 (file)
@@ -59,7 +59,7 @@ TYPO3.Workspaces.Actions = {
                }
 
                var progress = parameters.total > 0 ? parameters.processed / parameters.total : 0;
-               var label = parameters.total > 0 ? parameters.processed + '/' + parameters.total : TYPO3.lang["runMassAction.init"];
+               var label = parameters.total > 0 ? parameters.processed + '/' + parameters.total : TYPO3.l10n.localize('runMassAction.init');
                top.Ext.getCmp('executeMassActionProgressBar').updateProgress(progress, label, true);
 
                this.runningMassAction(parameters, TYPO3.Workspaces.Actions.runMassActionCallback);
@@ -69,7 +69,7 @@ TYPO3.Workspaces.Actions = {
                if (response.error) {
                        top.Ext.getCmp('executeMassActionProgressBar').hide();
                        top.Ext.getCmp('executeMassActionOkButton').hide();
-                       top.Ext.getCmp('executeMassActionCancleButton').setText(TYPO3.lang.close);
+                       top.Ext.getCmp('executeMassActionCancleButton').setText(TYPO3.l10n.localize('close'));
                        top.Ext.getCmp('executeMassActionForm').show();
                        top.Ext.getCmp('executeMassActionForm').update(response.error);
                } else {
@@ -78,9 +78,9 @@ TYPO3.Workspaces.Actions = {
                        } else {
                                top.Ext.getCmp('executeMassActionProgressBar').hide();
                                top.Ext.getCmp('executeMassActionOkButton').hide();
-                               top.Ext.getCmp('executeMassActionCancleButton').setText(TYPO3.lang.close);
+                               top.Ext.getCmp('executeMassActionCancleButton').setText(TYPO3.l10n.localize('close'));
                                top.Ext.getCmp('executeMassActionForm').show();
-                               top.Ext.getCmp('executeMassActionForm').update(TYPO3.lang["runMassAction.done"].replace('%d', response.total));
+                               top.Ext.getCmp('executeMassActionForm').update(TYPO3.l10n.localize('runMassAction.done').replace('%d', response.total));
                                top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree();
                        }
                }
@@ -88,7 +88,7 @@ TYPO3.Workspaces.Actions = {
        generateWorkspacePreviewLink: function() {
                TYPO3.Workspaces.ExtDirectActions.generateWorkspacePreviewLink(TYPO3.settings.Workspaces.id, function(response) {
                        top.TYPO3.Dialog.InformationDialog({
-                               title: TYPO3.lang.previewLink,
+                               title: TYPO3.l10n.localize('previewLink'),
                                msg: String.format('<a href="{0}" target="_blank">{0}</a>', response)
                        });
                });
@@ -196,7 +196,7 @@ TYPO3.Workspaces.Actions = {
        },
        handlerResponseOnExecuteAction: function(response) {
                if (!Ext.isObject(response)) {
-                       response = { error: { message: TYPO3.lang["error.noResponse"] }};
+                       response = { error: { message: TYPO3.l10n.localize('error.noResponse') }};
                }
 
                if (Ext.isObject(response.error)) {
index 88f6487..cfe9081 100644 (file)
@@ -171,7 +171,7 @@ Ext.ux.TYPO3.Workspace.RowPanel = Ext.extend(Ext.Panel, {
                        width:'100%',
                        autoHeight:true,
                        layout:'fit',
-                       title: TYPO3.lang.rowDetails
+                       title: TYPO3.l10n.localize('rowDetails')
                };
                Ext.apply(this, config);
                Ext.ux.TYPO3.Workspace.RowPanel.superclass.constructor.call(this, config);
index 66a395d..f85453e 100644 (file)
@@ -89,7 +89,7 @@ TYPO3.Workspaces.Configuration.WsPath = {
        hidden: true,
        hideable: false,
        sortable: true,
-       header : TYPO3.lang["column.wsPath"],
+       header : TYPO3.l10n.localize('column.wsPath'),
        renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                var path = record.json.path_Workspace;
                return path;
@@ -103,7 +103,7 @@ TYPO3.Workspaces.Configuration.LivePath = {
        hidden: true,
        hideable: true,
        sortable: true,
-       header : TYPO3.lang["column.livePath"],
+       header : TYPO3.l10n.localize('column.livePath'),
        renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                var path = record.json.path_Live;
                return path;
@@ -116,7 +116,7 @@ TYPO3.Workspaces.Configuration.WsTitleWithIcon = {
        width: 120,
        hideable: true,
        sortable: true,
-       header : TYPO3.lang["column.wsTitle"],
+       header : TYPO3.l10n.localize('column.wsTitle'),
        renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                var dekoClass = 'item-state-' + record.json.state_Workspace;
                value = "<span class=\"" + dekoClass + "\">" + value + "</span>";
@@ -135,7 +135,7 @@ TYPO3.Workspaces.Configuration.TitleWithIcon = {
        width: 120,
        hideable: false,
        sortable: true,
-       header : TYPO3.lang["column.liveTitle"],
+       header : TYPO3.l10n.localize('column.liveTitle'),
        renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                if (record.json.state_Workspace == 'unhidden') {
                        var dekoClass = 'item-state-hidden';
@@ -154,7 +154,7 @@ TYPO3.Workspaces.Configuration.ChangeState = {
        width: 80,
        sortable: true,
        hidden: true,
-       header : TYPO3.lang["column.difference"],
+       header : TYPO3.l10n.localize('column.difference'),
        renderer: function(value, metaData) {
                return value + "%";
        },
@@ -165,7 +165,7 @@ TYPO3.Workspaces.Configuration.ChangeDate = {
        dataIndex : 'workspace_Tstamp',
        width: 120,
        sortable: true,
-       header : TYPO3.lang["column.changeDate"],
+       header : TYPO3.l10n.localize('column.changeDate'),
        renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                return record.json.workspace_Formated_Tstamp;
        },
@@ -181,7 +181,7 @@ TYPO3.Workspaces.Configuration.SendToPrevStageButton = {
        items:[
                {
                        iconCls: 't3-icon t3-icon-extensions t3-icon-extensions-workspaces t3-icon-workspaces-sendtoprevstage',
-                       tooltip: TYPO3.lang["tooltip.sendToPrevStage"],
+                       tooltip: TYPO3.l10n.localize('tooltip.sendToPrevStage'),
                        handler: function(grid, rowIndex, colIndex) {
                                var record = TYPO3.Workspaces.MainStore.getAt(rowIndex);
                                TYPO3.Workspaces.Actions.sendToPrevStageWindow(record.json.table, record.json.uid);
@@ -198,7 +198,7 @@ TYPO3.Workspaces.Configuration.SendToNextStageButton = {
        items: [
                {},{    // empty dummy important!!!!
                        iconCls: 't3-icon t3-icon-extensions t3-icon-extensions-workspaces t3-icon-workspaces-sendtonextstage',
-                       tooltip: TYPO3.lang["tooltip.sendToNextStage"],
+                       tooltip: TYPO3.l10n.localize('tooltip.sendToNextStage'),
                        handler: function(grid, rowIndex, colIndex) {
                                var record = TYPO3.Workspaces.MainStore.getAt(rowIndex);
                                TYPO3.Workspaces.Actions.sendToNextStageWindow(record.json.table, record.json.uid, record.json.t3ver_oid);
@@ -212,7 +212,7 @@ TYPO3.Workspaces.Configuration.Stage = {
        dataIndex : 'label_Stage',
        width: 80,
        sortable: true,
-       header : TYPO3.lang["column.stage"],
+       header : TYPO3.l10n.localize('column.stage'),
        hidden: false,
        filter : {
                type : 'string'
@@ -249,7 +249,7 @@ TYPO3.Workspaces.Configuration.Stage = {
 
 TYPO3.Workspaces.Configuration.RowButtons = {
        xtype: 'actioncolumn',
-       header: TYPO3.lang["column.actions"],
+       header: TYPO3.l10n.localize('column.actions'),
        width: 70,
        hideable: false,
        hidden: (TYPO3.settings.Workspaces.allView === '1'),
@@ -257,7 +257,7 @@ TYPO3.Workspaces.Configuration.RowButtons = {
        items: [
                {
                        iconCls:'t3-icon t3-icon-actions t3-icon-actions-version t3-icon-version-workspace-preview'
-                       ,tooltip: TYPO3.lang["tooltip.viewElementAction"]
+                       ,tooltip: TYPO3.l10n.localize('tooltip.viewElementAction')
                        ,handler: function(grid, rowIndex, colIndex) {
                                var record = TYPO3.Workspaces.MainStore.getAt(rowIndex);
                                TYPO3.Workspaces.Actions.viewSingleRecord(record.json.table, record.json.uid);
@@ -272,7 +272,7 @@ TYPO3.Workspaces.Configuration.RowButtons = {
                },
                {
                        iconCls:'t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-open',
-                       tooltip: TYPO3.lang["tooltip.editElementAction"],
+                       tooltip: TYPO3.l10n.localize('tooltip.editElementAction'),
                        handler: function(grid, rowIndex, colIndex) {
                                var record = TYPO3.Workspaces.MainStore.getAt(rowIndex);
                                var newUrl = 'alt_doc.php?returnUrl=' + Ext.urlEncode({}, document.location.href).replace("?","%3F").replace("=", "%3D").replace(":","%3A").replace("/", "%2f") + '&id=' + TYPO3.settings.Workspaces.id + '&edit[' + record.json.table + '][' + record.json.uid + ']=edit';
@@ -288,7 +288,7 @@ TYPO3.Workspaces.Configuration.RowButtons = {
                },
                {
                        iconCls:'t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-pagemodule-open',
-                       tooltip: TYPO3.lang["tooltip.openPage"],
+                       tooltip: TYPO3.l10n.localize('tooltip.openPage'),
                        handler: function(grid, rowIndex, colIndex) {
                                var record = TYPO3.Workspaces.MainStore.getAt(rowIndex);
                                if (record.json.table == 'pages') {
@@ -307,12 +307,12 @@ TYPO3.Workspaces.Configuration.RowButtons = {
                },
                {
                        iconCls:'t3-icon t3-icon-actions t3-icon-actions-version t3-icon-version-document-remove',
-                       tooltip: TYPO3.lang["tooltip.discardVersion"],
+                       tooltip: TYPO3.l10n.localize('tooltip.discardVersion'),
                        handler: function(grid, rowIndex, colIndex) {
                                var record = TYPO3.Workspaces.MainStore.getAt(rowIndex);
                                var configuration = {
-                                       title: TYPO3.lang["window.discard.title"],
-                                       msg: TYPO3.lang["window.discard.message"],
+                                       title: TYPO3.l10n.localize('window.discard.title'),
+                                       msg: TYPO3.l10n.localize('window.discard.message'),
                                        fn: function(result) {
                                                if (result == 'yes') {
                                                        TYPO3.Workspaces.Actions.deleteSingleRecord(record.json.table, record.json.uid);
@@ -344,12 +344,12 @@ TYPO3.Workspaces.Configuration.SwapButton = {
        items: [
                {
                        iconCls:'t3-icon t3-icon-actions t3-icon-actions-version t3-icon-version-swap-workspace'
-                       ,tooltip: TYPO3.lang["tooltip.swap"]
+                       ,tooltip: TYPO3.l10n.localize('tooltip.swap')
                        ,handler: function(grid, rowIndex, colIndex) {
                                var record = TYPO3.Workspaces.MainStore.getAt(rowIndex);
                                var configuration = {
-                                       title: TYPO3.lang["window.swap.title"],
-                                       msg: TYPO3.lang["window.swap.message"],
+                                       title: TYPO3.l10n.localize('window.swap.title'),
+                                       msg: TYPO3.l10n.localize('window.swap.message'),
                                        fn: function(result) {
                                                if (result == 'yes') {
                                                        TYPO3.Workspaces.Actions.swapSingleRecord(record.json.table, record.json.t3ver_oid, record.json.uid);
index a7231df..fd1cadd 100644 (file)
@@ -39,7 +39,7 @@ Ext.override(Ext.grid.GridView, {
                        if (colModel.config[i].hideable !== false) {
                                text = colModel.getColumnHeader(i);
                                if (colModel.getColumnId(i) === 'wsSwapColumn') {
-                                       text = TYPO3.lang["column.wsSwapColumn"];
+                                       text = TYPO3.l10n.localize('column.wsSwapColumn');
                                }
                                colMenu.add(new Ext.menu.CheckItem({
                                        text: text,
@@ -97,9 +97,9 @@ TYPO3.Workspaces.WorkspaceGrid = new Ext.grid.GridPanel({
                columns: [
                        TYPO3.Workspaces.SelectionModel,
                        TYPO3.Workspaces.RowExpander,
-                       {id: 'uid', dataIndex : 'uid', width: 40, sortable: true, header : TYPO3.lang["column.uid"], hidden: true, filterable : true },
-                       {id: 't3ver_oid', dataIndex : 't3ver_oid', width: 40, sortable: true, header : TYPO3.lang["column.oid"], hidden: true, filterable : true },
-                       {id: 'workspace_Title', dataIndex : 'workspace_Title', width: 120, sortable: true, header : TYPO3.lang["column.workspaceName"], hidden: true, filter : {type : 'string'}},
+                       {id: 'uid', dataIndex : 'uid', width: 40, sortable: true, header : TYPO3.l10n.localize('column.uid'), hidden: true, filterable : true },
+                       {id: 't3ver_oid', dataIndex : 't3ver_oid', width: 40, sortable: true, header : TYPO3.l10n.localize('column.oid'), hidden: true, filterable : true },
+                       {id: 'workspace_Title', dataIndex : 'workspace_Title', width: 120, sortable: true, header : TYPO3.l10n.localize('column.workspaceName'), hidden: true, filter : {type : 'string'}},
                        TYPO3.Workspaces.Configuration.WsPath,
                        TYPO3.Workspaces.Configuration.LivePath,
                        TYPO3.Workspaces.Configuration.WsTitleWithIcon,
@@ -132,7 +132,7 @@ TYPO3.Workspaces.WorkspaceGrid = new Ext.grid.GridPanel({
        ],
        view : new Ext.grid.GroupingView({
                forceFit: true,
-               groupTextTpl : '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "' + TYPO3.lang["items"] + '" : "' + TYPO3.lang["item"] + '"]})',
+               groupTextTpl : '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "' + TYPO3.l10n.localize('items') + '" : "' + TYPO3.l10n.localize('item') + '"]})',
                enableGroupingMenu: false,
                enableNoGroups: false,
                hideGroupedColumn: true
index 32ec9a9..872c720 100644 (file)
@@ -64,11 +64,11 @@ TYPO3.Workspaces.Helpers = {
                        ],
                        buttons: [
                                {
-                                       text: TYPO3.lang.ok,
+                                       text: TYPO3.l10n.localize('ok'),
                                        handler: configuration.executeHandler
                                },
                                {
-                                       text: TYPO3.lang.cancel,
+                                       text: TYPO3.l10n.localize('cancel'),
                                        handler: function(event) {
                                                top.TYPO3.Windows.close('sendToStageWindow');
                                        }
index 946f906..b88245b 100644 (file)
@@ -63,7 +63,7 @@ TYPO3.Workspaces.Toolbar.selectStateActionCombo = new Ext.form.ComboBox({
        valueField: 'uid',
        displayField: 'title',
        mode: 'local',
-       emptyText: TYPO3.lang.chooseAction,
+       emptyText: TYPO3.l10n.localize('chooseAction'),
        selectOnFocus: true,
        disabled : true,
        hidden : true,   // we hide it by default and show it in case there are any actions available
@@ -105,7 +105,7 @@ TYPO3.Workspaces.Toolbar.selectStateMassActionCombo = new Ext.form.ComboBox({
        valueField: 'action',
        displayField: 'title',
        mode: 'local',
-       emptyText: TYPO3.lang.chooseMassAction,
+       emptyText: TYPO3.l10n.localize('chooseMassAction'),
        selectOnFocus: true,
        triggerAction: 'all',
        editable: false,
@@ -115,22 +115,22 @@ TYPO3.Workspaces.Toolbar.selectStateMassActionCombo = new Ext.form.ComboBox({
        listeners: {
                'select' : function (combo, record) {
                        var label = '';
-                       var affectWholeWorkspaceWarning = TYPO3.lang["tooltip.affectWholeWorkspace"];
+                       var affectWholeWorkspaceWarning = TYPO3.l10n.localize('tooltip.affectWholeWorkspace');
                        switch (record.data.action) {
                                case 'publish':
-                                       label = TYPO3.lang["tooltip.publishAll"];
+                                       label = TYPO3.l10n.localize('tooltip.publishAll');
                                        break;
                                case 'swap':
-                                       label = TYPO3.lang["tooltip.swapAll"];
+                                       label = TYPO3.l10n.localize('tooltip.swapAll');
                                        break;
                                case 'discard':
-                                       label = TYPO3.lang["tooltip.discardAll"];
+                                       label = TYPO3.l10n.localize('tooltip.discardAll');
                                        break;
                        }
                        top.TYPO3.Windows.close('executeMassActionWindow');
                        var dialog = top.TYPO3.Windows.showWindow({
                                id: 'executeMassActionWindow',
-                               title: TYPO3.lang["window.massAction.title"],
+                               title: TYPO3.l10n.localize('window.massAction.title'),
                                items: [
                                        {
                                                xtype: 'form',
@@ -153,7 +153,7 @@ TYPO3.Workspaces.Toolbar.selectStateMassActionCombo = new Ext.form.ComboBox({
                                                id: 'executeMassActionOkButton',
                                                data: record.data,
                                                scope: this,
-                                               text: TYPO3.lang.ok,
+                                               text: TYPO3.l10n.localize('ok'),
                                                disabled:false,
                                                handler: function(event) {
                                                        TYPO3.Workspaces.Actions.triggerMassAction(event.data.action);
@@ -162,7 +162,7 @@ TYPO3.Workspaces.Toolbar.selectStateMassActionCombo = new Ext.form.ComboBox({
                                        {
                                                id: 'executeMassActionCancleButton',
                                                scope: this,
-                                               text: TYPO3.lang.cancel,
+                                               text: TYPO3.l10n.localize('cancel'),
                                                handler: function() {
                                                        top.TYPO3.Windows.close('executeMassActionWindow');
                                                        // if clicks during action - this also interrupts the running process -- not the nices way but efficient
@@ -192,7 +192,7 @@ TYPO3.Workspaces.Toolbar.depthFilter = new Ext.form.ComboBox({
        displayField: 'label',
        id: 'depthSelector',
        mode: 'local',
-       emptyText: TYPO3.lang.depth,
+       emptyText: TYPO3.l10n.localize('depth'),
        selectOnFocus: true,
        triggerAction: 'all',
        editable: false,
@@ -202,12 +202,12 @@ TYPO3.Workspaces.Toolbar.depthFilter = new Ext.form.ComboBox({
                autoLoad: true,
                fields: ['depth','label'],
                data : [
-                       ['0', TYPO3.lang.depth_0],
-                       ['1', TYPO3.lang.depth_1],
-                       ['2', TYPO3.lang.depth_2],
-                       ['3', TYPO3.lang.depth_3],
-                       ['4', TYPO3.lang.depth_4],
-                       ['999', TYPO3.lang.depth_infi]
+                       ['0', TYPO3.l10n.localize('depth_0')],
+                       ['1', TYPO3.l10n.localize('depth_1')],
+                       ['2', TYPO3.l10n.localize('depth_2')],
+                       ['3', TYPO3.l10n.localize('depth_3')],
+                       ['4', TYPO3.l10n.localize('depth_4')],
+                       ['999', TYPO3.l10n.localize('depth_infi')]
                ]
        }),
        value: 999,