Added french translations

This commit is contained in:
Nicolas Lœuillet
2016-01-05 22:38:09 +01:00
parent 8eedc8cfac
commit d1af8ad4db
7 changed files with 28 additions and 8 deletions

View File

@ -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 <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->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.");
}
/**

View File

@ -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.');
}
/**

View File

@ -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:

View File

@ -11,7 +11,7 @@
<li>
<h5>{{ import.name }}</h5>
<blockquote>{{ import.description|raw }}</blockquote>
<p><a class="waves-effect waves-light btn" href="{{ path(import.url) }}">Import contents</a></p>
<p><a class="waves-effect waves-light btn" href="{{ path(import.url) }}">{% trans %}Import contents{% endtrans %}</a></p>
</li>
{% endfor %}
</ul>

View File

@ -9,7 +9,7 @@
<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">
Connect to Pocket and import data
{% trans %}Connect to Pocket and import data{% endtrans %}
</button>
</form>
</div>

View File

@ -15,7 +15,7 @@
<div class="file-field input-field col s12">
{{ form_errors(form.file) }}
<div class="btn">
<span>File</span>
<span>{% trans %}File{% endtrans %}</span>
{{ form_widget(form.file) }}
</div>
<div class="file-path-wrapper">