Externalized import/export errors strings + french translation
This commit is contained in:
parent
fd27a3df91
commit
8debdf023a
|
|
@ -209,12 +209,12 @@ class ImportExportController extends ControllerBehavior
|
||||||
public function onImportLoadColumnSampleForm()
|
public function onImportLoadColumnSampleForm()
|
||||||
{
|
{
|
||||||
if (($columnId = post('file_column_id', false)) === false) {
|
if (($columnId = post('file_column_id', false)) === false) {
|
||||||
throw new ApplicationException('Missing column identifier');
|
throw new ApplicationException(Lang::get('backend::lang.import_export.missing_column_id_error'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$columns = $this->getImportFileColumns();
|
$columns = $this->getImportFileColumns();
|
||||||
if (!array_key_exists($columnId, $columns)) {
|
if (!array_key_exists($columnId, $columns)) {
|
||||||
throw new ApplicationException('Unknown column');
|
throw new ApplicationException(Lang::get('backend::lang.import_export.unknown_column_error'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = $this->getImportFilePath();
|
$path = $this->getImportFilePath();
|
||||||
|
|
@ -281,7 +281,7 @@ class ImportExportController extends ControllerBehavior
|
||||||
$columns = $this->makeListColumns($columnConfig);
|
$columns = $this->makeListColumns($columnConfig);
|
||||||
|
|
||||||
if (empty($columns)) {
|
if (empty($columns)) {
|
||||||
throw new ApplicationException('Please specify some columns to import.');
|
throw new ApplicationException(Lang::get('backend::lang.import_export.empty_import_columns_error'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->importColumns = $columns;
|
return $this->importColumns = $columns;
|
||||||
|
|
@ -352,7 +352,7 @@ class ImportExportController extends ControllerBehavior
|
||||||
protected function checkRequiredImportColumns()
|
protected function checkRequiredImportColumns()
|
||||||
{
|
{
|
||||||
if (!$matches = post('column_match', [])) {
|
if (!$matches = post('column_match', [])) {
|
||||||
throw new ApplicationException('Please match some columns first.');
|
throw new ApplicationException(Lang::get('backend::lang.import_export.match_some_column_error'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$dbColumns = $this->getImportDbColumns();
|
$dbColumns = $this->getImportDbColumns();
|
||||||
|
|
@ -368,7 +368,9 @@ class ImportExportController extends ControllerBehavior
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$found) {
|
if (!$found) {
|
||||||
throw new ApplicationException('Please specify a match for the required field '.$label.'.');
|
throw new ApplicationException(Lang::get('backend::lang.import_export.required_match_column_error', [
|
||||||
|
'label' => Lang::get($label)
|
||||||
|
]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -455,7 +457,7 @@ class ImportExportController extends ControllerBehavior
|
||||||
$columns = $this->makeListColumns($columnConfig);
|
$columns = $this->makeListColumns($columnConfig);
|
||||||
|
|
||||||
if (empty($columns)) {
|
if (empty($columns)) {
|
||||||
throw new ApplicationException('Please specify some columns to export.');
|
throw new ApplicationException(Lang::get('backend::lang.import_export.empty_export_columns_error'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->exportColumns = $columns;
|
return $this->exportColumns = $columns;
|
||||||
|
|
@ -524,7 +526,7 @@ class ImportExportController extends ControllerBehavior
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->controller->isClassExtendedWith('Backend.Behaviors.ListController')) {
|
if (!$this->controller->isClassExtendedWith('Backend.Behaviors.ListController')) {
|
||||||
throw new ApplicationException('You must implement the controller behavior ListController with the export "useList" option enabled.');
|
throw new ApplicationException(Lang::get('backend::lang.import_export.behavior_missing_uselist_error'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->exportFromList($listDefinition);
|
$this->exportFromList($listDefinition);
|
||||||
|
|
@ -656,7 +658,9 @@ class ImportExportController extends ControllerBehavior
|
||||||
|
|
||||||
$modelClass = $this->getConfig($type.'[modelClass]');
|
$modelClass = $this->getConfig($type.'[modelClass]');
|
||||||
if (!$modelClass) {
|
if (!$modelClass) {
|
||||||
throw new ApplicationException('Please specify the modelClass property for '.$type);
|
throw new ApplicationException(Lang::get('backend::lang.import_export.missing_model_class_error', [
|
||||||
|
'type' => $type
|
||||||
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->{$cacheProperty} = new $modelClass;
|
return $this->{$cacheProperty} = new $modelClass;
|
||||||
|
|
|
||||||
|
|
@ -371,5 +371,13 @@ return [
|
||||||
'column_preview' => 'Column preview',
|
'column_preview' => 'Column preview',
|
||||||
'file_not_found_error' => 'File not found',
|
'file_not_found_error' => 'File not found',
|
||||||
'empty_error' => 'There was no data supplied to export',
|
'empty_error' => 'There was no data supplied to export',
|
||||||
|
'empty_import_columns_error' => 'Please specify some columns to import.',
|
||||||
|
'match_some_column_error' => 'Please match some columns first.',
|
||||||
|
'required_match_column_error' => 'Please specify a match for the required field :label.',
|
||||||
|
'empty_export_columns_error' => 'Please specify some columns to export.',
|
||||||
|
'behavior_missing_uselist_error' => 'You must implement the controller behavior ListController with the export "useList" option enabled.',
|
||||||
|
'missing_model_class_error' => 'Please specify the modelClass property for :type',
|
||||||
|
'missing_column_id_error' => 'Missing column identifier',
|
||||||
|
'unknown_column_error' => 'Unknown column',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -358,5 +358,13 @@ return [
|
||||||
'column_preview' => 'Prévisualisation des colonnes',
|
'column_preview' => 'Prévisualisation des colonnes',
|
||||||
'file_not_found_error' => 'Fichier non trouvé',
|
'file_not_found_error' => 'Fichier non trouvé',
|
||||||
'empty_error' => 'Il n‘y a aucune donnée à exporter',
|
'empty_error' => 'Il n‘y a aucune donnée à exporter',
|
||||||
|
'empty_import_columns_error' => 'Veuillez indiquer quelques colonnes à importer.',
|
||||||
|
'match_some_column_error' => 'Veuillez d’abord faire correspondre quelques colonnes.',
|
||||||
|
'required_match_column_error' => 'Veuillez faire correspondre la colonne obligatoire :label.',
|
||||||
|
'empty_export_columns_error' => 'Veuillez indiquer quelques colonnes à exporter.',
|
||||||
|
'behavior_missing_uselist_error' => 'Vous devez implémenter le behavior ListController avec l’option d’export "useList" activée.',
|
||||||
|
'missing_model_class_error' => 'Veuillez préciser la propriété modelClass pour :type',
|
||||||
|
'missing_column_id_error' => 'Identifiant de colonne manquant',
|
||||||
|
'unknown_column_error' => 'Colonne inconnue',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue