From d1af8ad4dbf7f3ce5170655c2fa8403406283039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 5 Jan 2016 22:38:09 +0100 Subject: Added french translations --- src/Wallabag/ImportBundle/Import/PocketImport.php | 7 +++++-- src/Wallabag/ImportBundle/Import/WallabagV1Import.php | 9 ++++++--- src/Wallabag/ImportBundle/Resources/config/services.yml | 2 ++ src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig | 2 +- src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig | 2 +- .../ImportBundle/Resources/views/WallabagV1/index.html.twig | 2 +- 6 files changed, 16 insertions(+), 8 deletions(-) (limited to 'src/Wallabag/ImportBundle') diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 267c4af5..9b82720a 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -11,6 +11,7 @@ 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 { @@ -23,14 +24,16 @@ class PocketImport implements ImportInterface private $skippedEntries = 0; private $importedEntries = 0; protected $accessToken; + private $translator; - public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, $consumerKey) + public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, $consumerKey, TranslatorInterface $translator) { $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) @@ -59,7 +62,7 @@ class PocketImport implements ImportInterface */ public function getDescription() { - 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.'; + return $this->translator->trans("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."); } /** diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index 0866ebe9..68f0574f 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php @@ -5,6 +5,7 @@ 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; @@ -17,11 +18,13 @@ class WallabagV1Import implements ImportInterface private $skippedEntries = 0; private $importedEntries = 0; private $filepath; + private $translator; - public function __construct(EntityManager $em) + public function __construct(EntityManager $em, TranslatorInterface $translator) { $this->em = $em; $this->logger = new NullLogger(); + $this->translator = $translator; } public function setLogger(LoggerInterface $logger) @@ -47,7 +50,7 @@ class WallabagV1Import implements ImportInterface */ public function getName() { - return 'Wallabag v1'; + return 'wallabag v1'; } /** @@ -63,7 +66,7 @@ class WallabagV1Import implements ImportInterface */ public function getDescription() { - 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.'; + 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.'); } /** diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml index e4dde100..55348ce7 100644 --- a/src/Wallabag/ImportBundle/Resources/config/services.yml +++ b/src/Wallabag/ImportBundle/Resources/config/services.yml @@ -18,6 +18,7 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_core.content_proxy" - %pocket_consumer_key% + - "@translator" calls: - [ setClient, [ "@wallabag_import.pocket.client" ] ] - [ setLogger, [ "@logger" ]] @@ -28,6 +29,7 @@ services: class: Wallabag\ImportBundle\Import\WallabagV1Import arguments: - "@doctrine.orm.entity_manager" + - "@translator" calls: - [ setLogger, [ "@logger" ]] tags: diff --git a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig index 27baa1e3..1f0addca 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig @@ -11,7 +11,7 @@
  • {{ import.name }}
    {{ import.description|raw }}
    -

    Import contents

    +

    {% trans %}Import contents{% endtrans %}

  • {% endfor %} diff --git a/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig index 9803896c..58053780 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig @@ -9,7 +9,7 @@

    {% 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 %}

    diff --git a/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig index 23d3e146..afc57226 100644 --- a/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig @@ -15,7 +15,7 @@
    {{ form_errors(form.file) }}
    - File + {% trans %}File{% endtrans %} {{ form_widget(form.file) }}
    -- cgit v1.2.3