Quellcode durchsuchen

Fix i18n for import/export

Marien Fressinaud vor 11 Jahren
Ursprung
Commit
0ee16a7d6a

+ 12 - 12
app/Controllers/importExportController.php

@@ -26,7 +26,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
 	 */
 	public function indexAction() {
 		$this->view->feeds = $this->feedDAO->listFeeds();
-		Minz_View::prependTitle(_t('import_export') . ' · ');
+		Minz_View::prependTitle(_t('sub.import_export.title') . ' · ');
 	}
 
 	/**
@@ -48,7 +48,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
 
 		if ($status_file !== 0) {
 			Minz_Log::error('File cannot be uploaded. Error code: ' . $status_file);
-			Minz_Request::bad(_t('file_cannot_be_uploaded'),
+			Minz_Request::bad(_t('feedback.import_export.file_cannot_be_uploaded'),
 			                  array('c' => 'importExport', 'a' => 'index'));
 		}
 
@@ -70,7 +70,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
 			if (!is_resource($zip)) {
 				// zip_open cannot open file: something is wrong
 				Minz_Log::error('Zip archive cannot be imported. Error code: ' . $zip);
-				Minz_Request::bad(_t('zip_error'),
+				Minz_Request::bad(_t('feedback.import_export.zip_error'),
 				                  array('c' => 'importExport', 'a' => 'index'));
 			}
 
@@ -92,7 +92,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
 			zip_close($zip);
 		} elseif ($type_file === 'zip') {
 			// Zip extension is not loaded
-			Minz_Request::bad(_t('no_zip_extension'),
+			Minz_Request::bad(_t('feedback.import_export.no_zip_extension'),
 			                  array('c' => 'importExport', 'a' => 'index'));
 		} elseif ($type_file !== 'unknown') {
 			$list_files[$type_file][] = file_get_contents($file['tmp_name']);
@@ -115,8 +115,8 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
 
 		// And finally, we get import status and redirect to the home page
 		Minz_Session::_param('actualize_feeds', true);
-		$content_notif = $error === true ? _t('feeds_imported_with_errors') :
-		                                   _t('feeds_imported');
+		$content_notif = $error === true ? _t('feedback.import_export.feeds_imported_with_errors') :
+		                                   _t('feedback.import_export.feeds_imported');
 		Minz_Request::good($content_notif);
 	}
 
@@ -183,7 +183,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
 			if (isset($elt['xmlUrl'])) {
 				// If xmlUrl exists, it means it is a feed
 				if ($nb_feeds >= $limits['max_feeds']) {
-					Minz_Log::warning(_t('sub.feeds.over_max',
+					Minz_Log::warning(_t('sub.feed.over_max',
 					                  $limits['max_feeds']));
 					$is_error = true;
 					continue;
@@ -197,7 +197,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
 				// No xmlUrl? It should be a category!
 				$limit_reached = ($nb_cats >= $limits['max_categories']);
 				if ($limit_reached) {
-					Minz_Log::warning(_t('sub.categories.over_max',
+					Minz_Log::warning(_t('sub.category.over_max',
 					                  $limits['max_categories']));
 				}
 
@@ -337,7 +337,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
 				// Feed does not exist in DB,we should to try to add it.
 				if ($nb_feeds >= $limits['max_feeds']) {
 					// Oops, no more place!
-					Minz_Log::warning(_t('sub.feeds.over_max', $limits['max_feeds']));
+					Minz_Log::warning(_t('sub.feed.over_max', $limits['max_feeds']));
 				} else {
 					$feed = $this->addFeedJson($item['origin'], $google_compliant);
 				}
@@ -482,7 +482,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
 				$this->exportZip($export_files);
 			} catch (Exception $e) {
 				# Oops, there is no Zip extension!
-				Minz_Request::bad(_t('export_no_zip_extension'),
+				Minz_Request::bad(_t('feedback.import_export.export_no_zip_extension'),
 				                  array('c' => 'importExport', 'a' => 'index'));
 			}
 		} elseif ($nb_files === 1) {
@@ -523,14 +523,14 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
 		$this->view->categories = $this->catDAO->listCategories();
 
 		if ($type == 'starred') {
-			$this->view->list_title = _t('starred_list');
+			$this->view->list_title = _t('sub.import_export.starred_list');
 			$this->view->type = 'starred';
 			$unread_fav = $this->entryDAO->countUnreadReadFavorites();
 			$this->view->entries = $this->entryDAO->listWhere(
 				's', '', FreshRSS_Entry::STATE_ALL, 'ASC', $unread_fav['all']
 			);
 		} elseif ($type == 'feed' && !is_null($feed)) {
-			$this->view->list_title = _t('feed_list', $feed->name());
+			$this->view->list_title = _t('sub.import_export.feed_list', $feed->name());
 			$this->view->type = 'feed/' . $feed->id();
 			$this->view->entries = $this->entryDAO->listWhere(
 				'f', $feed->id(), FreshRSS_Entry::STATE_ALL, 'ASC',

+ 8 - 0
app/i18n/en/feedback.php

@@ -1,6 +1,14 @@
 <?php
 
 return array(
+	'import_export' => array(
+		'export_no_zip_extension' => 'Zip extension is not present on your server. Please try to export files one by one.',
+		'feeds_imported' => 'Your feeds have been imported and will now be updated',
+		'feeds_imported_with_errors' => 'Your feeds have been imported but some errors occurred',
+		'file_cannot_be_uploaded' => 'File cannot be uploaded!',
+		'no_zip_extension' => 'Zip extension is not present on your server.',
+		'zip_error' => 'An error occured during Zip import.',
+	),
 	'login' => array(
 		'error' => 'Login is invalid',
 		'success' => 'You are connected',

+ 2 - 14
app/i18n/en/gen.php

@@ -8,7 +8,9 @@ return array(
 		'disable' => 'Disable',
 		'empty' => 'Empty',
 		'enable' => 'Enable',
+		'export' => 'Export',
 		'filter' => 'Filtrer',
+		'import' => 'Import',
 		'manage' => 'Manage',
 		'mark_read' => 'Mark as read',
 		'remove' => 'Remove',
@@ -216,26 +218,16 @@ return array(
 	'dom_is_ok' => 'You have the required library to browse the DOM',
 	'error_occurred' => 'An error occurred',
 	'explain_token' => 'Allows to access RSS output of the default user without authentication.<br /><kbd>%s?output=rss&token=%s</kbd>',
-	'export' => 'Export',
-	'export_no_zip_extension' => 'Zip extension is not present on your server. Please try to export files one by one.',
-	'export_opml' => 'Export list of feeds (OPML)',
-	'export_starred' => 'Export your favourites',
 	'favicons_is_ok' => 'Permissions on favicons directory are good',
 	'feed' => 'Feed',
 	'feed_actualized' => '<em>%s</em> has been updated',
 	'feed_added' => 'RSS feed <em>%s</em> has been added',
 	'feed_deleted' => 'Feed has been deleted',
-	'feed_list' => 'List of %s articles',
 	'feed_not_added' => '<em>%s</em> could not be added',
 	'feeds' => 'Feeds',
 	'feeds_actualized' => 'RSS feeds have been updated',
-	'feeds_imported' => 'Your feeds have been imported and will now be updated',
-	'feeds_imported_with_errors' => 'Your feeds have been imported but some errors occurred',
 	'feeds_marked_read' => 'Feeds have been marked as read',
-	'file_cannot_be_uploaded' => 'File cannot be uploaded!',
 	'file_is_nok' => 'Check permissions on <em>%s</em> directory. HTTP server must have rights to write into',
-	'file_to_import' => 'File to import<br />(OPML, Json or Zip)',
-	'file_to_import_no_zip' => 'File to import<br />(OPML or Json)',
 	'finish_installation' => 'Complete installation',
 	'first_article' => 'Skip to the first article',
 	'fix_errors_before' => 'Fix errors before skip to the next step.',
@@ -251,7 +243,6 @@ return array(
 	'http_referer_is_nok' => 'Please check that you are not altering your HTTP REFERER.',
 	'http_referer_is_ok' => 'Your HTTP REFERER is known and corresponds to your server.',
 	'img_with_lazyload' => 'Use "lazy load" mode to load pictures',
-	'import' => 'Import',
 	'install_not_deleted' => 'Something went wrong; you must delete the file <em>%s</em> manually.',
 	'installation_is_ok' => 'The installation process was successful.<br />The final step will now attempt to delete any file and database backup created during the update process.<br />You may choose to skip this step by deleting <kbd>./data/do-install.txt</kbd> manually.',
 	'installation_step' => 'Installation — step %d · FreshRSS',
@@ -290,7 +281,6 @@ return array(
 	'no_rss_feed' => 'No RSS feed',
 	'no_selected_feed' => 'No feed selected.',
 	'no_update' => 'No update to apply',
-	'no_zip_extension' => 'Zip extension is not present on your server.',
 	'not_read' => '%d unread',
 	'not_reads' => '%d unread',
 	'not_yet_implemented' => 'Not yet implemented',
@@ -362,7 +352,6 @@ return array(
 	'show_adaptive' => 'Adjust showing',
 	'show_all_articles' => 'Show all articles',
 	'sort_order' => 'Sort order',
-	'starred_list' => 'List of favourite articles',
 	'steps' => 'Steps',
 	'sticky_post' => 'Stick the article to the top when opened',
 	'theme' => 'Theme',
@@ -398,5 +387,4 @@ return array(
 	'your_diaspora_pod' => 'Your Diaspora* pod',
 	'your_shaarli' => 'Your Shaarli',
 	'your_wallabag' => 'Your wallabag',
-	'zip_error' => 'An error occured during Zip import.',
 );

+ 11 - 0
app/i18n/en/sub.php

@@ -37,6 +37,17 @@ return array(
 		'validator' => 'Check the validity of the feed',
 		'website' => 'Website URL',
 	),
+	'import_export' => array(
+		'export' => 'Export',
+		'export_opml' => 'Export list of feeds (OPML)',
+		'export_starred' => 'Export your favourites',
+		'feed_list' => 'List of %s articles',
+		'file_to_import' => 'File to import<br />(OPML, Json or Zip)',
+		'file_to_import_no_zip' => 'File to import<br />(OPML or Json)',
+		'import' => 'Import',
+		'starred_list' => 'List of favourite articles',
+		'title' => 'Import / export',
+	),
 	'menu' => array(
 		'bookmark' => 'Subscribe (FreshRSS bookmark)',
 		'import_export' => 'Import / export',

+ 8 - 0
app/i18n/fr/feedback.php

@@ -1,6 +1,14 @@
 <?php
 
 return array(
+	'import_export' => array(
+		'export_no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur. Veuillez essayer d’exporter les fichiers un par un.',
+		'feeds_imported' => 'Vos flux ont été importés et vont maintenant être actualisés.',
+		'feeds_imported_with_errors' => 'Vos flux ont été importés mais des erreurs sont survenues.',
+		'file_cannot_be_uploaded' => 'Le fichier ne peut pas être téléchargé !',
+		'no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur.',
+		'zip_error' => 'Une erreur est survenue durant l’import du fichier Zip.',
+	),
 	'login' => array(
 		'error' => 'L’identifiant est invalide',
 		'success' => 'Vous êtes désormais connecté',

+ 2 - 14
app/i18n/fr/gen.php

@@ -8,7 +8,9 @@ return array(
 		'disable' => 'Désactiver',
 		'empty' => 'Vider',
 		'enable' => 'Activer',
+		'export' => 'Exporter',
 		'filter' => 'Filtrer',
+		'import' => 'Importer',
 		'manage' => 'Gérer',
 		'mark_read' => 'Marquer comme lu',
 		'remove' => 'Supprimer',
@@ -216,26 +218,16 @@ return array(
 	'dom_is_ok' => 'Vous disposez du nécessaire pour parcourir le DOM',
 	'error_occurred' => 'Une erreur est survenue !',
 	'explain_token' => 'Permet d’accéder à la sortie RSS de l’utilisateur par défaut sans besoin de s’authentifier.<br /><kbd>%s?output=rss&token=%s</kbd>',
-	'export' => 'Exporter',
-	'export_no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur. Veuillez essayer d’exporter les fichiers un par un.',
-	'export_opml' => 'Exporter la liste des flux (OPML)',
-	'export_starred' => 'Exporter les favoris',
 	'favicons_is_ok' => 'Les droits sur le répertoire des favicons sont bons',
 	'feed' => 'Flux',
 	'feed_actualized' => '<em>%s</em> a été mis à jour.',
 	'feed_added' => 'Le flux <em>%s</em> a bien été ajouté.',
 	'feed_deleted' => 'Le flux a été supprimé.',
-	'feed_list' => 'Liste des articles de %s',
 	'feed_not_added' => '<em>%s</em> n’a pas pu être ajouté.',
 	'feeds' => 'Flux',
 	'feeds_actualized' => 'Les flux ont été mis à jour.',
-	'feeds_imported' => 'Vos flux ont été importés et vont maintenant être actualisés.',
-	'feeds_imported_with_errors' => 'Vos flux ont été importés mais des erreurs sont survenues.',
 	'feeds_marked_read' => 'Les flux ont été marqués comme lus.',
-	'file_cannot_be_uploaded' => 'Le fichier ne peut pas être téléchargé !',
 	'file_is_nok' => 'Veuillez vérifier les droits sur le répertoire <em>%s</em>. Le serveur HTTP doit être capable d’écrire dedans',
-	'file_to_import' => 'Fichier à importer<br />(OPML, Json ou Zip)',
-	'file_to_import_no_zip' => 'Fichier à importer<br />(OPML ou Json)',
 	'finish_installation' => 'Terminer l’installation',
 	'first_article' => 'Passer au premier article',
 	'fix_errors_before' => 'Veuillez corriger les erreurs avant de passer à l’étape suivante.',
@@ -251,7 +243,6 @@ return array(
 	'http_referer_is_nok' => 'Veuillez vérifier que vous ne modifiez pas votre HTTP REFERER.',
 	'http_referer_is_ok' => 'Le HTTP REFERER est connu et semble correspondre à votre serveur.',
 	'img_with_lazyload' => 'Utiliser le mode “chargement différé” pour les images',
-	'import' => 'Importer',
 	'install_not_deleted' => 'Quelque chose s’est mal passé, vous devez supprimer le fichier <em>%s</em> à la main.',
 	'installation_is_ok' => 'L’installation s’est bien passée.<br />La dernière étape va maintenant tenter de supprimer les fichiers ainsi que d’éventuelles copies de base de données créés durant le processus de mise à jour.<br />Vous pouvez choisir de sauter cette étape en supprimant <kbd>./data/do-install.txt</kbd> manuellement.',
 	'installation_step' => 'Installation — étape %d · FreshRSS',
@@ -290,7 +281,6 @@ return array(
 	'no_rss_feed' => 'Aucun flux RSS',
 	'no_selected_feed' => 'Aucun flux sélectionné.',
 	'no_update' => 'Aucune mise à jour à appliquer',
-	'no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur.',
 	'not_read' => '%d non lu',
 	'not_reads' => '%d non lus',
 	'not_yet_implemented' => 'Pas encore implémenté',
@@ -362,7 +352,6 @@ return array(
 	'show_adaptive' => 'Adapter l’affichage',
 	'show_all_articles' => 'Afficher tous les articles',
 	'sort_order' => 'Ordre de tri',
-	'starred_list' => 'Liste des articles favoris',
 	'steps' => 'Étapes',
 	'sticky_post' => 'Aligner l’article en haut quand il est ouvert',
 	'theme' => 'Thème',
@@ -398,5 +387,4 @@ return array(
 	'your_diaspora_pod' => 'Votre pod Diaspora*',
 	'your_shaarli' => 'Votre Shaarli',
 	'your_wallabag' => 'Votre wallabag',
-	'zip_error' => 'Une erreur est survenue durant l’import du fichier Zip.',
 );

+ 11 - 0
app/i18n/fr/sub.php

@@ -37,6 +37,17 @@ return array(
 		'validator' => 'Vérifier la valididé du flux',
 		'website' => 'URL du site',
 	),
+	'import_export' => array(
+		'export' => 'Exporter',
+		'export_opml' => 'Exporter la liste des flux (OPML)',
+		'export_starred' => 'Exporter les favoris',
+		'feed_list' => 'Liste des articles de %s',
+		'file_to_import' => 'Fichier à importer<br />(OPML, Json ou Zip)',
+		'file_to_import_no_zip' => 'Fichier à importer<br />(OPML ou Json)',
+		'import' => 'Importer',
+		'starred_list' => 'Liste des articles favoris',
+		'title' => 'Importer / exporter',
+	),
 	'menu' => array(
 		'bookmark' => 'S’abonner (bookmark FreshRSS)',
 		'import_export' => 'Importer / exporter',

+ 8 - 8
app/views/importExport/index.phtml

@@ -1,13 +1,13 @@
 <?php $this->partial('aside_subscription'); ?>
 
 <div class="post ">
-	<a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a>
+	<a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a>
 
 	<form method="post" action="<?php echo _url('importExport', 'import'); ?>" enctype="multipart/form-data">
-		<legend><?php echo _t('import'); ?></legend>
+		<legend><?php echo _t('sub.import_export.import'); ?></legend>
 		<div class="form-group">
 			<label class="group-name" for="file">
-				<?php echo extension_loaded('zip') ? _t('file_to_import') : _t('file_to_import_no_zip'); ?>
+				<?php echo extension_loaded('zip') ? _t('sub.import_export.file_to_import') : _t('sub.import_export.file_to_import_no_zip'); ?>
 			</label>
 			<div class="group-controls">
 				<input type="file" name="file" id="file" />
@@ -16,24 +16,24 @@
 
 		<div class="form-group form-actions">
 			<div class="group-controls">
-				<button type="submit" class="btn btn-important"><?php echo _t('import'); ?></button>
+				<button type="submit" class="btn btn-important"><?php echo _t('gen.action.import'); ?></button>
 			</div>
 		</div>
 	</form>
 
 	<?php if (count($this->feeds) > 0) { ?>
 	<form method="post" action="<?php echo _url('importExport', 'export'); ?>">
-		<legend><?php echo _t('export'); ?></legend>
+		<legend><?php echo _t('sub.import_export.export'); ?></legend>
 		<div class="form-group">
 			<div class="group-controls">
 				<label class="checkbox" for="export_opml">
 					<input type="checkbox" name="export_opml" id="export_opml" value="1" checked="checked" />
-					<?php echo _t('export_opml'); ?>
+					<?php echo _t('sub.import_export.export_opml'); ?>
 				</label>
 
 				<label class="checkbox" for="export_starred">
 					<input type="checkbox" name="export_starred" id="export_starred" value="1" <?php echo extension_loaded('zip') ? 'checked="checked"' : ''; ?> />
-					<?php echo _t('export_starred'); ?>
+					<?php echo _t('sub.import_export.export_starred'); ?>
 				</label>
 
 				<?php
@@ -53,7 +53,7 @@
 
 		<div class="form-group form-actions">
 			<div class="group-controls">
-				<button type="submit" class="btn btn-important"><?php echo _t('export'); ?></button>
+				<button type="submit" class="btn btn-important"><?php echo _t('gen.action.export'); ?></button>
 			</div>
 		</div>
 	</form>