From e24e467b60e263a8ca38949a9e9b211df88de6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Gaulin?= Date: Wed, 27 Jan 2016 18:43:10 +0100 Subject: [PATCH] Externalized keys + French translation --- modules/backend/lang/en/lang.php | 2 ++ modules/backend/lang/fr/lang.php | 44 +++++++++++++++++++++++++- modules/backend/models/ExportModel.php | 6 ++-- 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/modules/backend/lang/en/lang.php b/modules/backend/lang/en/lang.php index 837137278..2752375b8 100644 --- a/modules/backend/lang/en/lang.php +++ b/modules/backend/lang/en/lang.php @@ -369,5 +369,7 @@ return [ 'export_progress' => 'Export progress', 'export_error' => 'Export error', 'column_preview' => 'Column preview', + 'file_not_found_error' => 'File not found', + 'empty_error' => 'There was no data supplied to export', ], ]; diff --git a/modules/backend/lang/fr/lang.php b/modules/backend/lang/fr/lang.php index 3fde1d150..94b3c770b 100644 --- a/modules/backend/lang/fr/lang.php +++ b/modules/backend/lang/fr/lang.php @@ -189,7 +189,7 @@ return [ 'close' => 'Fermer', 'confirm' => 'Confirmer', 'reload' => 'Recharger', - 'complete' => 'Complet', + 'complete' => 'Terminé', 'ok' => 'OK', 'or' => 'ou', 'confirm_tab_close' => 'Confirmer la fermeture de cet onglet ? Les modifications réalisées seront perdues.', @@ -317,4 +317,46 @@ return [ 'filter' => [ 'all' => 'tous' ], + 'import_export' => [ + 'upload_csv_file' => '1. Envoyer un fichier CSV', + 'import_file' => 'Importer un fichier', + 'first_row_contains_titles' => 'La première ligne contient les titres des colonnes', + 'first_row_contains_titles_desc' => 'Laissez coché si la première ligne du fichier CSV contient les titres des colonnes.', + 'match_columns' => '2. Faire correspondre les colonnes du fichier avec les champs du modèle de données', + 'file_columns' => 'Colonnes du fichier', + 'database_fields' => 'Champs de la base de données', + 'set_import_options' => '3. Fixer les options d’importation', + 'export_output_format' => '1. Format de sortie de l’export', + 'file_format' => 'Format du fichier', + 'standard_format' => 'Format Standard', + 'custom_format' => 'Format Personnalisé', + 'delimiter_char' => 'Caractère séparateur', + 'enclosure_char' => 'Caractère d’encadrement', + 'escape_char' => 'Caractère d’échappement', + 'select_columns' => '2. Choisissez les colonnes à exporter', + 'column' => 'Colonne', + 'columns' => 'Colonnes', + 'set_export_options' => '3. Fixer les options d’exportation', + 'show_ignored_columns' => 'Voir les colonnes ignorées', + 'auto_match_columns' => 'Correspondance automatique des colonnes', + 'created' => 'Créés', + 'updated' => 'Mis à jour', + 'skipped' => 'Ignorés', + 'warnings' => 'Alertes', + 'errors' => 'Erreurs', + 'skipped_rows' => 'Lignes ignorées', + 'import_progress' => 'Progression de l’import', + 'processing' => 'Traitement', + 'import_error' => 'Erreur d’import', + 'upload_valid_csv' => 'Veuillez envoyer un fichier CSV valide.', + 'drop_column_here' => 'Déposez les colonnes ici...', + 'ignore_this_column' => 'Ignorer cette colonne', + 'processing_successful_line1' => 'Le processus d’export du fichier s’est terminé avec succès !', + 'processing_successful_line2' => 'Le navigateur devrait automatiquement vous rediriger vers le téléchargement du fichier.', + 'export_progress' => 'Progression de l’export', + 'export_error' => 'Erreur d’export', + 'column_preview' => 'Prévisualisation des colonnes', + 'file_not_found_error' => 'Fichier non trouvé', + 'empty_error' => 'Il n‘y a aucune donnée à exporter', + ], ]; diff --git a/modules/backend/models/ExportModel.php b/modules/backend/models/ExportModel.php index 84b0d43d8..f10b6829d 100644 --- a/modules/backend/models/ExportModel.php +++ b/modules/backend/models/ExportModel.php @@ -55,12 +55,12 @@ abstract class ExportModel extends Model public function download($name, $outputName = null) { if (!preg_match('/^oc[0-9a-z]*$/i', $name)) { - throw new ApplicationException('File not found'); + throw new ApplicationException(Lang::get('backend::lang.import_export.file_not_found_error')); } $csvPath = temp_path() . '/' . $name; if (!file_exists($csvPath)) { - throw new ApplicationException('File not found'); + throw new ApplicationException(Lang::get('backend::lang.import_export.file_not_found_error')); } $headers = Response::download($csvPath, $outputName)->headers->all(); @@ -80,7 +80,7 @@ abstract class ExportModel extends Model * Validate */ if (!$results) { - throw new ApplicationException('There was no data supplied to export'); + throw new ApplicationException(Lang::get('backend::lang.import_export.empty_error')); } /*