Add translation support

Add translation support by adding the language dir
with bare PO files.
All translations are changed to use their plugin domain.
This commit is contained in:
Jelle van der Waa
2016-06-09 11:13:23 +02:00
parent ecaa6e3a35
commit ec102f9c03
9 changed files with 312 additions and 33 deletions

View File

@ -44,7 +44,7 @@ Zarafa.plugins.mdm.MDM = Ext.extend(Zarafa.core.Plugin, {
Zarafa.onReady(function() {
container.registerPlugin(new Zarafa.core.PluginMetaData({
name : 'mdm',
displayName : _('Mobile device management'),
displayName : _('Mobile device management', 'plugin_mdm'),
pluginConstructor : Zarafa.plugins.mdm.MDM
}));
});

View File

@ -53,9 +53,9 @@ Zarafa.plugins.mdm.data.MDMResponseHandler = Ext.extend(Zarafa.core.data.Abstrac
*/
doWipe : function(response) {
if (response.wipe === true) {
container.getNotifier().notify('info.mdm', _('Mobile Device Manager'), _('Wiping device'));
container.getNotifier().notify('info.mdm', _('Mobile Device Manager'), _('Wiping device', 'plugin_mdm'));
} else {
container.getNotifier().notify('info.mdm', _('Mobile Device Manager'), _('Password incorrect'));
container.getNotifier().notify('info.mdm', _('Mobile Device Manager'), _('Password incorrect', 'plugin_mdm'));
}
},
@ -65,7 +65,7 @@ Zarafa.plugins.mdm.data.MDMResponseHandler = Ext.extend(Zarafa.core.data.Abstrac
*/
doResync : function(response) {
if (response.resync === true) {
container.getNotifier().notify('info.mdm', _('Mobile Device Manager'), _('Full resync in progress'));
container.getNotifier().notify('info.mdm', _('Mobile Device Manager'), _('Full resync in progress', 'plugin_mdm'));
}
}

View File

@ -51,15 +51,15 @@ Zarafa.plugins.mdm.data.ProvisioningStatus = Zarafa.core.Enum.create({
{
switch (provisioningStatus) {
case Zarafa.plugins.mdm.data.ProvisioningStatus.NOT_APPLICABLE:
return _('Not Applicable');
return _('Not Applicable', 'plugin_mdm');
case Zarafa.plugins.mdm.data.ProvisioningStatus.OK:
return _('Ok');
return _('Ok', 'plugin_mdm');
case Zarafa.plugins.mdm.data.ProvisioningStatus.WIPE_PENDING:
return _('Wipe Pending');
return _('Wipe Pending', 'plugin_mdm');
case Zarafa.plugins.mdm.data.ProvisioningStatus.WIPE_REQUESTED:
return _('Wipe Requested');
return _('Wipe Requested', 'plugin_mdm');
case Zarafa.plugins.mdm.data.ProvisioningStatus.WIPE_EXECUTED:
return _('Wipe Executed');
return _('Wipe Executed', 'plugin_mdm');
}
return '';
}

View File

@ -21,7 +21,7 @@ Zarafa.plugins.mdm.settings.MDMSettingsCategory = Ext.extend(Zarafa.settings.ui.
config = config || {};
Ext.applyIf(config, {
title : _('MDM'),
title : _('MDM', 'plugin_mdm'),
iconCls : 'icon_mdm_settings',
items : [{
xtype : 'Zarafa.plugins.mdm.mdmsettingswidget'

View File

@ -16,74 +16,74 @@ Zarafa.plugins.mdm.settings.MDMSettingsWidget = Ext.extend(Zarafa.settings.ui.Se
var store = new Zarafa.plugins.mdm.data.MDMDeviceStore();
Ext.applyIf(config, {
title : _('Mobile Devices'),
title : _('Mobile Devices', 'plugin_mdm'),
items : [{
xtype : 'container',
layout : 'column',
items : [{
xtype : 'grid',
name : _('Devices'),
name : _('Devices', 'plugin_mdm'),
ref : '../deviceGrid',
height : 400,
store : store,
viewConfig : {
forceFit : true,
deferEmptyText: false,
emptyText: '<div class="emptytext">' + _('No devices connected to your account') + '</div>'
emptyText: '<div class="emptytext">' + _('No devices connected to your account', 'plugin_mdm') + '</div>'
},
columns : [{
dataIndex : 'devicetype',
header : _('Device'),
header : _('Device', 'plugin_mdm'),
renderer : Ext.util.Format.htmlEncode
},{
dataIndex : 'useragent',
header : _('User Agent'),
header : _('User Agent', 'plugin_mdm'),
renderer : Ext.util.Format.htmlEncode
},{
dataIndex : 'wipestatus',
header : _('Provisioning Status'),
header : _('Provisioning Status', 'plugin_mdm'),
renderer : Zarafa.plugins.mdm.ui.Renderers.provisioningStatus
},{
dataIndex : 'lastupdatetime',
header : _('Last Update'),
header : _('Last Update', 'plugin_mdm'),
renderer : Ext.util.Format.htmlEncode
},{
dataIndex : 'entryid',
header : _('Device ID'),
header : _('Device ID', 'plugin_mdm'),
renderer : Ext.util.Format.htmlEncode
},{
dataIndex : 'deviceos',
header : _('Device OS'),
header : _('Device OS', 'plugin_mdm'),
hidden : true,
renderer : Ext.util.Format.htmlEncode
},{
dataIndex : 'devicefriendlyname',
header : _('Device Info'),
header : _('Device Info', 'plugin_mdm'),
hidden : true,
renderer : Ext.util.Format.htmlEncode
},{
dataIndex : 'firstsynctime',
header : _('First Sync time'),
header : _('First Sync time', 'plugin_mdm'),
hidden : true,
renderer : Ext.util.Format.htmlEncode
}],
buttons : [{
text : _('Wipe Device'),
text : _('Wipe Device', 'plugin_mdm'),
ref : '../../../wipeBtn',
handler : this.onWipeBtn,
scope : this
},{
text : _('Full resync'),
text : _('Full resync', 'plugin_mdm'),
ref : '../../../resyncBtn',
handler : this.onFullResync,
scope : this
},{
text : _('Remove device'),
text : _('Remove device', 'plugin_mdm'),
ref : '../../../removeBtn',
handler : this.onRemoveDevice,
scope : this
},{
text : _('Refresh'),
text : _('Refresh', 'plugin_mdm'),
ref : '../../../refresh',
handler : this.onRefresh,
scope : this
@ -102,8 +102,8 @@ Zarafa.plugins.mdm.settings.MDMSettingsWidget = Ext.extend(Zarafa.settings.ui.Se
onWipeBtn : function()
{
var msgbox = Ext.MessageBox.show({
title: _('Kopano WebApp'),
msg: _('Do you really want to wipe your device?\n Enter your password to confirm.'),
title: _('Kopano WebApp', 'plugin_mdm'),
msg: _('Do you really want to wipe your device?\n Enter your password to confirm.', 'plugin_mdm'),
inputType :'password',
icon: Ext.MessageBox.WARNING,
buttons: Ext.MessageBox.YESNO,