Added translations (en+fr)
This commit is contained in:
parent
9bc46687b1
commit
88cf826322
|
@ -166,8 +166,7 @@ class GridFieldBulkImageUpload implements GridField_HTMLProvider, GridField_URLH
|
||||||
}
|
}
|
||||||
|
|
||||||
$bulkUploadBtn = new ArrayData(array(
|
$bulkUploadBtn = new ArrayData(array(
|
||||||
'Link' => $gridField->Link('bulkimageupload'),
|
'Link' => $gridField->Link('bulkimageupload')
|
||||||
'Label' => 'Bulk Upload',
|
|
||||||
));
|
));
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|
|
@ -190,7 +190,7 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
|
||||||
$actions = new FieldList();
|
$actions = new FieldList();
|
||||||
|
|
||||||
$actions->push(
|
$actions->push(
|
||||||
FormAction::create('Finish', 'Finish')
|
FormAction::create('Finish', _t('GridFieldBulkTools.FINISH_BTN_LABEL', 'Finish'))
|
||||||
->setAttribute('id', 'bulkImageUploadFinishBtn')
|
->setAttribute('id', 'bulkImageUploadFinishBtn')
|
||||||
->addExtraClass('cms-panel-link')
|
->addExtraClass('cms-panel-link')
|
||||||
->setAttribute('data-icon', 'accept')
|
->setAttribute('data-icon', 'accept')
|
||||||
|
@ -200,7 +200,7 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
|
||||||
);
|
);
|
||||||
|
|
||||||
$actions->push(
|
$actions->push(
|
||||||
FormAction::create('SaveAll', 'Save All')
|
FormAction::create('SaveAll', _t('GridFieldBulkTools.SAVE_BTN_LABEL', 'Save All'))
|
||||||
->setAttribute('id', 'bulkImageUploadUpdateBtn')
|
->setAttribute('id', 'bulkImageUploadUpdateBtn')
|
||||||
->addExtraClass('ss-ui-action-constructive')
|
->addExtraClass('ss-ui-action-constructive')
|
||||||
->setAttribute('data-icon', 'accept')
|
->setAttribute('data-icon', 'accept')
|
||||||
|
@ -210,7 +210,7 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
|
||||||
);
|
);
|
||||||
|
|
||||||
$actions->push(
|
$actions->push(
|
||||||
FormAction::create('Cancel', 'Cancel & Delete All')
|
FormAction::create('Cancel', _t('GridFieldBulkTools.CANCEL_BTN_LABEL', 'Cancel & Delete All'))
|
||||||
->setAttribute('id', 'bulkImageUploadUpdateCancelBtn')
|
->setAttribute('id', 'bulkImageUploadUpdateCancelBtn')
|
||||||
->addExtraClass('ss-ui-action-destructive')
|
->addExtraClass('ss-ui-action-destructive')
|
||||||
->setAttribute('data-icon', 'decline')
|
->setAttribute('data-icon', 'decline')
|
||||||
|
@ -297,6 +297,7 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
|
||||||
Requirements::javascript(BULK_EDIT_TOOLS_PATH . '/javascript/GridFieldBulkImageUpload.js');
|
Requirements::javascript(BULK_EDIT_TOOLS_PATH . '/javascript/GridFieldBulkImageUpload.js');
|
||||||
Requirements::css(BULK_EDIT_TOOLS_PATH . '/css/GridFieldBulkImageUpload.css');
|
Requirements::css(BULK_EDIT_TOOLS_PATH . '/css/GridFieldBulkImageUpload.css');
|
||||||
Requirements::javascript(BULK_EDIT_TOOLS_PATH . '/javascript/GridFieldBulkImageUpload_downloadtemplate.js');
|
Requirements::javascript(BULK_EDIT_TOOLS_PATH . '/javascript/GridFieldBulkImageUpload_downloadtemplate.js');
|
||||||
|
Requirements::add_i18n_javascript(BULK_EDIT_TOOLS_PATH . '/javascript/lang');
|
||||||
|
|
||||||
if($request->isAjax())
|
if($request->isAjax())
|
||||||
{
|
{
|
||||||
|
|
|
@ -170,19 +170,23 @@ class GridFieldBulkManager implements GridField_HTMLProvider, GridField_ColumnPr
|
||||||
Requirements::javascript(BULK_EDIT_TOOLS_PATH . '/javascript/GridFieldBulkManager.js');
|
Requirements::javascript(BULK_EDIT_TOOLS_PATH . '/javascript/GridFieldBulkManager.js');
|
||||||
|
|
||||||
$dropDownActionList = DropdownField::create('bulkActionName', '')
|
$dropDownActionList = DropdownField::create('bulkActionName', '')
|
||||||
->setSource( array('edit' => 'Edit','unlink' => 'UnLink','delete' => 'Delete') )
|
->setSource( array(
|
||||||
|
'edit' => _t('GridFieldBulkTools.EDIT_SELECT_LABEL', 'Edit'),
|
||||||
|
'unlink' => _t('GridFieldBulkTools.UNLINK_SELECT_LABEL', 'UnLink'),
|
||||||
|
'delete' => _t('GridFieldBulkTools.DELETE_SELECT_LABEL', 'Delete')
|
||||||
|
))
|
||||||
->setAttribute('class', 'bulkActionName')
|
->setAttribute('class', 'bulkActionName')
|
||||||
->setAttribute('id', '');
|
->setAttribute('id', '');
|
||||||
|
|
||||||
$templateData = new ArrayData(array(
|
$templateData = new ArrayData(array(
|
||||||
'Menu' => $dropDownActionList->FieldHolder(),
|
'Menu' => $dropDownActionList->FieldHolder(),
|
||||||
'Button' => array(
|
'Button' => array(
|
||||||
'Label' => 'Go',
|
'Label' => _t('GridFieldBulkTools.ACTION_BTN_LABEL', 'Go'),
|
||||||
'Link' => $gridField->Link('bulkediting').'/edit',
|
'Link' => $gridField->Link('bulkediting').'/edit',
|
||||||
'DataURL' => $gridField->Link('bulkediting')
|
'DataURL' => $gridField->Link('bulkediting')
|
||||||
),
|
),
|
||||||
'Select' => array(
|
'Select' => array(
|
||||||
'Label' => 'Select all'
|
'Label' => _t('GridFieldBulkTools.SELECT_ALL_LABEL', 'Select all')
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ class GridFieldBulkManager_Request extends RequestHandler {
|
||||||
$actions = new FieldList();
|
$actions = new FieldList();
|
||||||
|
|
||||||
$actions->push(
|
$actions->push(
|
||||||
FormAction::create('SaveAll', 'Save All')
|
FormAction::create('SaveAll', _t('GridFieldBulkTools.SAVE_BTN_LABEL', 'Save All'))
|
||||||
->setAttribute('id', 'bulkEditingUpdateBtn')
|
->setAttribute('id', 'bulkEditingUpdateBtn')
|
||||||
->addExtraClass('ss-ui-action-constructive cms-panel-link')
|
->addExtraClass('ss-ui-action-constructive cms-panel-link')
|
||||||
->setAttribute('data-icon', 'accept')
|
->setAttribute('data-icon', 'accept')
|
||||||
|
@ -90,7 +90,7 @@ class GridFieldBulkManager_Request extends RequestHandler {
|
||||||
} */
|
} */
|
||||||
|
|
||||||
$actions->push(
|
$actions->push(
|
||||||
FormAction::create('Cancel', 'Cancel & Delete All')
|
FormAction::create('Cancel', _t('GridFieldBulkTools.CANCEL_BTN_LABEL', 'Cancel & Delete All'))
|
||||||
->setAttribute('id', 'bulkEditingUpdateCancelBtn')
|
->setAttribute('id', 'bulkEditingUpdateCancelBtn')
|
||||||
->addExtraClass('ss-ui-action-destructive cms-panel-link')
|
->addExtraClass('ss-ui-action-destructive cms-panel-link')
|
||||||
->setAttribute('data-icon', 'decline')
|
->setAttribute('data-icon', 'decline')
|
||||||
|
|
|
@ -95,10 +95,7 @@
|
||||||
|
|
||||||
if ( formsWithUpadtes > 0 )
|
if ( formsWithUpadtes > 0 )
|
||||||
{
|
{
|
||||||
confirmed = confirm(
|
confirmed = confirm( ss.i18n._t('GridFieldBulkTools.FINISH_CONFIRM') );
|
||||||
"You have unsaved changes. Continuing will loose all unsaved data.\n\n" +
|
|
||||||
"Do your really want to continue?"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (confirmed)
|
if (confirmed)
|
||||||
|
@ -139,7 +136,7 @@
|
||||||
$(this).addClass('hasUpdate');
|
$(this).addClass('hasUpdate');
|
||||||
}
|
}
|
||||||
|
|
||||||
$(itemStatus).removeClass('updated').addClass('dirty').html('Changed');
|
$(itemStatus).removeClass('updated').addClass('dirty').html(ss.i18n._t('GridFieldBulkTools.EDIT_CHANGED'));
|
||||||
if ( $(itemInfo).hasClass('updated') ) $(itemInfo).removeClass('updated');
|
if ( $(itemInfo).hasClass('updated') ) $(itemInfo).removeClass('updated');
|
||||||
if ( !$(itemInfo).hasClass('dirty') ) $(itemInfo).addClass('dirty');
|
if ( !$(itemInfo).hasClass('dirty') ) $(itemInfo).addClass('dirty');
|
||||||
|
|
||||||
|
@ -228,7 +225,7 @@
|
||||||
$(btn).data('completedForms', counter);
|
$(btn).data('completedForms', counter);
|
||||||
|
|
||||||
$(this).removeClass('hasUpdate');
|
$(this).removeClass('hasUpdate');
|
||||||
$(this).parents('li').find('.ss-uploadfield-item-status').removeClass('dirty').addClass('updated').html('Updated');
|
$(this).parents('li').find('.ss-uploadfield-item-status').removeClass('dirty').addClass('updated').html(ss.i18n._t('GridFieldBulkTools.EDIT_UPDATED'));
|
||||||
$(this).parents('li').find('.ss-uploadfield-item-info').removeClass('dirty').addClass('updated');
|
$(this).parents('li').find('.ss-uploadfield-item-info').removeClass('dirty').addClass('updated');
|
||||||
$(this).parents('li').find('.ss-uploadfield-item-editform').css('display', 'none');
|
$(this).parents('li').find('.ss-uploadfield-item-editform').css('display', 'none');
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
||||||
|
console.error('Class ss.i18n not defined');
|
||||||
|
} else {
|
||||||
|
ss.i18n.addDictionary('en_US', {
|
||||||
|
'GridFieldBulkTools.FINISH_CONFIRM': "You have unsaved changes. Continuing will loose all unsaved data.\n\nDo your really want to continue?",
|
||||||
|
'GridFieldBulkTools.EDIT_CHANGED': 'Modified',
|
||||||
|
'GridFieldBulkTools.EDIT_UPDATED': 'Saved'
|
||||||
|
});
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
||||||
|
console.error('Class ss.i18n not defined');
|
||||||
|
} else {
|
||||||
|
ss.i18n.addDictionary('fr_FR', {
|
||||||
|
'GridFieldBulkTools.FINISH_CONFIRM': "Vous avez des changements non enregistrés. En continuant vous allez perdre toutes vos données non enregistrées.\n\nVoulez-vous vraiment continuer?",
|
||||||
|
'GridFieldBulkTools.EDIT_CHANGED': 'Changé',
|
||||||
|
'GridFieldBulkTools.EDIT_UPDATED': 'Enregisté'
|
||||||
|
});
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
en:
|
||||||
|
GridFieldBulkTools:
|
||||||
|
BULK_UPLOAD_BTN_LABEL: Bulk Upload
|
||||||
|
FINISH_BTN_LABEL: Finish
|
||||||
|
SAVE_BTN_LABEL: Save All
|
||||||
|
CANCEL_BTN_LABEL: Cancel & Delete All
|
||||||
|
EDIT_SELECT_LABEL: Edit
|
||||||
|
UNLINK_SELECT_LABEL: Unlink
|
||||||
|
DELETE_SELECT_LABEL: Delete
|
||||||
|
ACTION_BTN_LABEL: Go
|
||||||
|
SELECT_ALL_LABEL: Select all
|
|
@ -0,0 +1,11 @@
|
||||||
|
fr:
|
||||||
|
GridFieldBulkTools:
|
||||||
|
BULK_UPLOAD_BTN_LABEL: Upload groupé
|
||||||
|
FINISH_BTN_LABEL: Terminer
|
||||||
|
SAVE_BTN_LABEL: Enregistrer tout
|
||||||
|
CANCEL_BTN_LABEL: Annuler & supprimer tout
|
||||||
|
EDIT_SELECT_LABEL: Editer
|
||||||
|
UNLINK_SELECT_LABEL: Retirer
|
||||||
|
DELETE_SELECT_LABEL: Supprimer
|
||||||
|
ACTION_BTN_LABEL: Go
|
||||||
|
SELECT_ALL_LABEL: Sélectionner tout
|
|
@ -1,3 +1,3 @@
|
||||||
<a id="bulkImageUploadGFButton" href="$Link" class="cms-panel-link ss-ui-action-constructive ss-ui-button" data-icon="drive-upload">
|
<a id="bulkImageUploadGFButton" href="$Link" class="cms-panel-link ss-ui-action-constructive ss-ui-button" data-icon="drive-upload">
|
||||||
$Label
|
<%t GridFieldBulkTools.BULK_UPLOAD_BTN_LABEL "Bulk Upload" %>
|
||||||
</a>
|
</a>
|
Loading…
Reference in New Issue