]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
updated tests 1493/head
authorNicolas Lœuillet <nicolas@loeuillet.org>
Wed, 6 Jan 2016 05:34:57 +0000 (06:34 +0100)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Thu, 7 Jan 2016 20:00:04 +0000 (21:00 +0100)
src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
src/Wallabag/ImportBundle/Import/PocketImport.php
src/Wallabag/ImportBundle/Import/WallabagV1Import.php
src/Wallabag/ImportBundle/Resources/config/services.yml
src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig
src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig
src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig
src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php
src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php

index 3140091ca25572718c9c08804d35d4c19d9491b6..067465842d4906a5cddd650d808db3aafd8e5677 100644 (file)
@@ -132,7 +132,7 @@ Edit title: "Modifier le titre"
 
 # Import
 Welcome on wallabag importer. Please select your previous service that you want to migrate.: "Bienvenue dans l'outil de migration de wallabag. Choisissez ci-dessous le service depuis lequel vous souhaitez migrer."
-"This importer will import all your <a href=\"https://getpocket.com\">Pocket</a> data. Pocket doesn't allow us to retrieve content from their service, so the readable content of each article will be re-fetched by wallabag.": "Cet outil va importer toutes vos données de <a href=\"https://getpocket.com\">Pocket</a>. Pocket ne nous autorise pas à récupérer le contenu depuis leur service, donc wallabag doit reparcourir chaque article pour récupérer son contenu."
+"This importer will import all your Pocket data. Pocket doesn't allow us to retrieve content from their service, so the readable content of each article will be re-fetched by wallabag.": "Cet outil va importer toutes vos données de Pocket. Pocket ne nous autorise pas à récupérer le contenu depuis leur service, donc wallabag doit reparcourir chaque article pour récupérer son contenu."
 "This importer will import all your wallabag v1 articles. On your config page, click on \"JSON export\" in the \"Export your wallabag data\" section. You will have a \"wallabag-export-1-xxxx-xx-xx.json\" file.": "Cet outil va importer toutes vos données de wallabag v1. Sur votre page de configuration de wallabag v1, cliquez sur \"Export JSON\" dans la section \"Exporter vos données de wallabag\". Vous allez récupérer un fichier \"wallabag-export-1-xxxx-xx-xx.json\"."
 "You can import your data from your Pocket account. You just have to click on the below button and authorize the application to connect to getpocket.com.": "Vous pouvez importer vos données depuis votre compte Pocket. Vous n'avez qu'à cliquer sur le bouton ci-dessous et à autoriser wallabag à se connecter à getpocket.com."
 Connect to Pocket and import data: Se connecter à Pocket et importer les données.
index 9b82720a9a0eb7aa3c14a992e34d9aa122db1fa3..cdcec1e283b279badc2eacbf662ef56272238d93 100644 (file)
@@ -11,7 +11,6 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
 use Wallabag\CoreBundle\Entity\Entry;
 use Wallabag\CoreBundle\Entity\Tag;
 use Wallabag\CoreBundle\Helper\ContentProxy;
-use Symfony\Component\Translation\TranslatorInterface;
 
 class PocketImport implements ImportInterface
 {
@@ -26,14 +25,13 @@ class PocketImport implements ImportInterface
     protected $accessToken;
     private $translator;
 
-    public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, $consumerKey, TranslatorInterface $translator)
+    public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, $consumerKey)
     {
         $this->user = $tokenStorage->getToken()->getUser();
         $this->em = $em;
         $this->contentProxy = $contentProxy;
         $this->consumerKey = $consumerKey;
         $this->logger = new NullLogger();
-        $this->translator = $translator;
     }
 
     public function setLogger(LoggerInterface $logger)
@@ -62,7 +60,7 @@ class PocketImport implements ImportInterface
      */
     public function getDescription()
     {
-        return $this->translator->trans("This importer will import all your <a href=\"https://getpocket.com\">Pocket</a> data. Pocket doesn't allow us to retrieve content from their service, so the readable content of each article will be re-fetched by wallabag.");
+        return 'This importer will import all your Pocket data. Pocket doesn\'t allow us to retrieve content from their service, so the readable content of each article will be re-fetched by wallabag.';
     }
 
     /**
index 68f0574fb2005963053539d0c339290efe720601..393089d63f1e6f6c4ad3ff9d305ad44b575498a0 100644 (file)
@@ -5,7 +5,6 @@ namespace Wallabag\ImportBundle\Import;
 use Psr\Log\LoggerInterface;
 use Psr\Log\NullLogger;
 use Doctrine\ORM\EntityManager;
-use Symfony\Component\Translation\TranslatorInterface;
 use Wallabag\CoreBundle\Entity\Entry;
 use Wallabag\UserBundle\Entity\User;
 use Wallabag\CoreBundle\Tools\Utils;
@@ -18,13 +17,11 @@ class WallabagV1Import implements ImportInterface
     private $skippedEntries = 0;
     private $importedEntries = 0;
     private $filepath;
-    private $translator;
 
-    public function __construct(EntityManager $em, TranslatorInterface $translator)
+    public function __construct(EntityManager $em)
     {
         $this->em = $em;
         $this->logger = new NullLogger();
-        $this->translator = $translator;
     }
 
     public function setLogger(LoggerInterface $logger)
@@ -66,7 +63,7 @@ class WallabagV1Import implements ImportInterface
      */
     public function getDescription()
     {
-        return $this->translator->trans('This importer will import all your wallabag v1 articles. On your config page, click on "JSON export" in the "Export your wallabag data" section. You will have a "wallabag-export-1-xxxx-xx-xx.json" file.');
+        return 'This importer will import all your wallabag v1 articles. On your config page, click on "JSON export" in the "Export your wallabag data" section. You will have a "wallabag-export-1-xxxx-xx-xx.json" file.';
     }
 
     /**
index 55348ce7b524c18d097143587567fe03428ced04..e4dde1003b07087ea33e4154833096fc4c737faf 100644 (file)
@@ -18,7 +18,6 @@ services:
             - "@doctrine.orm.entity_manager"
             - "@wallabag_core.content_proxy"
             - %pocket_consumer_key%
-            - "@translator"
         calls:
             - [ setClient, [ "@wallabag_import.pocket.client" ] ]
             - [ setLogger, [ "@logger" ]]
@@ -29,7 +28,6 @@ services:
         class: Wallabag\ImportBundle\Import\WallabagV1Import
         arguments:
             - "@doctrine.orm.entity_manager"
-            - "@translator"
         calls:
             - [ setLogger, [ "@logger" ]]
         tags:
index 1f0addca907dc8044b7fda5b2a6723da6f1cfe7a..303e6cbfbd80689b0501acd6c54f3d969f84ed9c 100644 (file)
@@ -10,7 +10,7 @@
                 {% for import in imports %}
                     <li>
                         <h5>{{ import.name }}</h5>
-                        <blockquote>{{ import.description|raw }}</blockquote>
+                        <blockquote>{{ import.description|trans }}</blockquote>
                         <p><a class="waves-effect waves-light btn" href="{{ path(import.url) }}">{% trans %}Import contents{% endtrans %}</a></p>
                     </li>
                 {% endfor %}
index 58053780cba81c7924bce2b6e09bb29752fc7b7c..643ad77548f698848f3b61faf0163184a807f570 100644 (file)
@@ -5,7 +5,7 @@
 <div class="row">
     <div class="col s12">
         <div class="card-panel settings">
-            <blockquote>{{ import.description|raw }}</blockquote>
+            <blockquote>{{ import.description|trans }}</blockquote>
             <p>{% trans %}You can import your data from your Pocket account. You just have to click on the below button and authorize the application to connect to getpocket.com.{% endtrans %}</p>
             <form method="post" action="{{ path('import_pocket_auth') }}">
                 <button class="btn waves-effect waves-light" type="submit" name="action">
index afc5722662f8f2bc4788d63f02122aa36307fb57..1359f2e40b2c8577970d234f6c2c22f69aee154c 100644 (file)
@@ -6,7 +6,7 @@
     <div class="col s12">
         <div class="card-panel settings">
             <div class="row">
-                <blockquote>{{ import.description|raw }}</blockquote>
+                <blockquote>{{ import.description|trans }}</blockquote>
                 <p>{% trans %}Please select your wallabag export and click on the below button to upload and import it.{% endtrans %}</p>
                 <div class="col s12">
                     {{ form_start(form, {'method': 'POST'}) }}
index 1fc2dfa6c76237c57905ca24da6a553ee63eefe3..043b2114e802711e46666c8e6df42fa4e0333921 100644 (file)
@@ -75,7 +75,7 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
 
         $this->assertEquals('Pocket', $pocketImport->getName());
         $this->assertNotEmpty($pocketImport->getUrl());
-        $this->assertContains('This importer will import all your <a href="https://getpocket.com">Pocket</a> data.', $pocketImport->getDescription());
+        $this->assertContains('This importer will import all your Pocket data.', $pocketImport->getDescription());
     }
 
     public function testOAuthRequest()
index 8a8eb3fa8005fb50a4c3ebdfa697340d7f7307bb..d5b41777caf041f0f6b46b5571bf2f2eb21fd1e9 100644 (file)
@@ -38,7 +38,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
     {
         $wallabagV1Import = $this->getWallabagV1Import();
 
-        $this->assertEquals('Wallabag v1', $wallabagV1Import->getName());
+        $this->assertEquals('wallabag v1', $wallabagV1Import->getName());
         $this->assertNotEmpty($wallabagV1Import->getUrl());
         $this->assertContains('This importer will import all your wallabag v1 articles.', $wallabagV1Import->getDescription());
     }