From 0d42217e4e8210dd2cf86f35ba9662ca02c8a2dc Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 9 Mar 2016 08:59:08 +0100 Subject: Convert english translation file - convert english translation to translate key - remove baggy template for login (never used since user isn't logged in and it'll use the default theme: material) - fix tests about text in response (now checking translation key instead of translated text) - remove all ugly `` --- .../ImportBundle/Controller/PocketController.php | 10 ++++---- .../ImportBundle/Form/Type/UploadImportType.php | 10 +++++--- src/Wallabag/ImportBundle/Import/PocketImport.php | 4 ++-- .../ImportBundle/Import/WallabagV1Import.php | 2 +- .../ImportBundle/Import/WallabagV2Import.php | 2 +- .../Resources/views/Import/index.html.twig | 7 +++--- .../Resources/views/Pocket/index.html.twig | 27 ++++++++++++---------- .../Resources/views/WallabagV1/index.html.twig | 20 ++++++++-------- .../Resources/views/WallabagV2/index.html.twig | 3 ++- .../Tests/Controller/WallabagV1ControllerTest.php | 11 +++++---- .../Tests/Controller/WallabagV2ControllerTest.php | 8 +++---- .../ImportBundle/Tests/Import/PocketImportTest.php | 2 +- .../Tests/Import/WallabagV1ImportTest.php | 2 +- .../Tests/Import/WallabagV2ImportTest.php | 2 +- 14 files changed, 61 insertions(+), 49 deletions(-) (limited to 'src/Wallabag/ImportBundle') diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php index c88e115e..7a35514b 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketController.php +++ b/src/Wallabag/ImportBundle/Controller/PocketController.php @@ -17,8 +17,8 @@ class PocketController extends Controller { $pocket = $this->get('wallabag_import.pocket.import'); $form = $this->createFormBuilder($pocket) - ->add('read', CheckboxType::class, array( - 'label' => 'Mark all as read', + ->add('mark_as_read', CheckboxType::class, array( + 'label' => 'import.form.mark_as_read_label', 'required' => false, )) ->getForm(); @@ -39,7 +39,7 @@ class PocketController extends Controller ->getRequestToken($this->generateUrl('import', array(), UrlGeneratorInterface::ABSOLUTE_URL)); $this->get('session')->set('import.pocket.code', $requestToken); - $this->get('session')->set('read', $request->request->get('form')['read']); + $this->get('session')->set('mark_as_read', $request->request->get('form')['mark_as_read']); return $this->redirect( 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', array(), UrlGeneratorInterface::ABSOLUTE_URL), @@ -54,8 +54,8 @@ class PocketController extends Controller { $message = 'Import failed, please try again.'; $pocket = $this->get('wallabag_import.pocket.import'); - $markAsRead = $this->get('session')->get('read'); - $this->get('session')->remove('read'); + $markAsRead = $this->get('session')->get('mark_as_read'); + $this->get('session')->remove('mark_as_read'); // something bad happend on pocket side if (false === $pocket->authorize($this->get('session')->get('import.pocket.code'))) { diff --git a/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php b/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php index 38670379..e0a44c36 100644 --- a/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php +++ b/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php @@ -13,12 +13,16 @@ class UploadImportType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('file', FileType::class) + ->add('file', FileType::class, array( + 'label' => 'import.form.file_label', + )) ->add('mark_as_read', CheckboxType::class, array( - 'label' => 'Mark all as read', + 'label' => 'import.form.mark_as_read_label', 'required' => false, )) - ->add('save', SubmitType::class) + ->add('save', SubmitType::class, array( + 'label' => 'import.form.save_label', + )) ; } diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 238ddbd1..4499ce69 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -60,7 +60,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 'import.pocket.description'; } /** @@ -139,7 +139,7 @@ class PocketImport implements ImportInterface /** * Get whether articles must be all marked as read. */ - public function getRead() + public function getMarkAsRead() { return $this->markAsRead; } diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index 1d773d3b..173a587f 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php @@ -67,7 +67,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 'import.wallabag_v1.description'; } /** diff --git a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php index c4bac561..0a32864e 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php @@ -27,7 +27,7 @@ class WallabagV2Import extends WallabagV1Import implements ImportInterface */ public function getDescription() { - return 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.'; + return 'import.wallabag_v2.description'; } /** diff --git a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig index 8c300624..aebbfa20 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig @@ -1,17 +1,18 @@ {% extends "WallabagCoreBundle::layout.html.twig" %} -{% block title %}{% trans %}Import{% endtrans %}{% endblock %} + +{% block title %}{{ 'import.page_title'|trans }}{% endblock %} {% block content %}
- {% trans %}Welcome to wallabag importer. Please select your previous service that you want to migrate.{% endtrans %} + {{ 'import.page_description'|trans }} diff --git a/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig index 3365fc6a..401dbd33 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig @@ -1,5 +1,6 @@ {% extends "WallabagCoreBundle::layout.html.twig" %} -{% block title %}{% trans %}Import > Pocket{% endtrans %}{% endblock %} + +{% block title %}{{ 'import.pocket.page_title'|trans }}{% endblock %} {% block content %}
@@ -7,27 +8,29 @@
{% if not has_consumer_key %}
- {% trans %}Pocket import isn't configured.{% endtrans %} + {{ 'import.pocket.config_missing.description'|trans }} + {% if is_granted('ROLE_SUPER_ADMIN') %} - {% trans with {'%keyurls%': '', '%keyurle%':''} %}You need to define %keyurls% a pocket_consumer_key %keyurle%.{% endtrans %} + {{ 'import.pocket.config_missing.admin_message'|trans({'%keyurls%': '', '%keyurle%':''})|raw }} {% else %} - {% trans %}Your server admin needs to define an API Key for Pocket.{% endtrans %} + {{ 'import.pocket.config_missing.user_message'|trans }} {% endif %}
{% endif %}
{{ import.description|trans }}
-

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

+

{{ 'import.pocket.authorize_message'|trans }}

+
-
-
-
{% trans %}Mark all as read ?{% endtrans %}
- {{ form_widget(form.read) }} - +
+
+
{{ 'import.form.mark_as_read_title'|trans }}
+ {{ form_widget(form.mark_as_read) }} + {{ form_label(form.mark_as_read) }} +
-
diff --git a/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig index a418ed1c..13e24c8c 100644 --- a/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig @@ -1,5 +1,6 @@ {% extends "WallabagCoreBundle::layout.html.twig" %} -{% block title %}{% trans %}Import > Wallabag v1{% endtrans %}{% endblock %} + +{% block title %}{{ 'import.wallabag_v1.page_title'|trans }}{% endblock %} {% block content %}
@@ -7,7 +8,8 @@
{{ import.description|trans }}
-

{% trans %}Please select your wallabag export and click on the below button to upload and import it.{% endtrans %}

+

{{ 'import.wallabag_v1.how_to'|trans }}

+
{{ form_start(form, {'method': 'POST'}) }} {{ form_errors(form) }} @@ -15,7 +17,7 @@
{{ form_errors(form.file) }}
- {% trans %}File{% endtrans %} + {{ form.file.vars.label|trans }} {{ form_widget(form.file) }}
@@ -23,15 +25,15 @@
-
{% trans %}Mark all as read ?{% endtrans %}
+
{{ 'import.form.mark_as_read_title'|trans }}
{{ form_widget(form.mark_as_read) }} - + {{ form_label(form.mark_as_read) }}
- - + + {{ form_widget(form.save, { 'attr': {'class': 'btn waves-effect waves-light'} }) }} + + {{ form_rest(form) }}
diff --git a/src/Wallabag/ImportBundle/Resources/views/WallabagV2/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/WallabagV2/index.html.twig index 78fe67e4..c2905fc6 100644 --- a/src/Wallabag/ImportBundle/Resources/views/WallabagV2/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/WallabagV2/index.html.twig @@ -1,2 +1,3 @@ {% extends "WallabagImportBundle:WallabagV1:index.html.twig" %} -{% block title %}{% trans %}Import > Wallabag v2{% endtrans %}{% endblock %} + +{% block title %}{{ 'import.wallabag_v2.page_title'|trans }}{% endblock %} diff --git a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php index 7f97b0f5..6c876b3b 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php @@ -54,8 +54,8 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $this->assertTrue($content->getTags()->contains($tag)); - $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); - $this->assertContains('Import summary', $alert[0]); + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); + $this->assertContains('Import summary', $body[0]); } public function testImportWallabagWithFileAndMarkAllAsRead() @@ -99,7 +99,8 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $this->assertTrue($content2->isArchived()); - $this->assertContains('Import summary', $client->getResponse()->getContent()); + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); + $this->assertContains('Import summary', $body[0]); } public function testImportWallabagWithEmptyFile() @@ -122,7 +123,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $crawler = $client->followRedirect(); - $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); - $this->assertContains('Import failed, please try again', $alert[0]); + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); + $this->assertContains('Import failed, please try again', $body[0]); } } diff --git a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php index 617c0517..58baa836 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php @@ -39,8 +39,8 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $crawler = $client->followRedirect(); - $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); - $this->assertContains('Import summary', $alert[0]); + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); + $this->assertContains('Import summary', $body[0]); $content = $client->getContainer() ->get('doctrine.orm.entity_manager') @@ -87,7 +87,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $crawler = $client->followRedirect(); - $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); - $this->assertContains('Import failed, please try again', $alert[0]); + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); + $this->assertContains('Import failed, please try again', $body[0]); } } diff --git a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php index 450cdc95..43b60ec3 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php @@ -85,7 +85,7 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase $this->assertEquals('Pocket', $pocketImport->getName()); $this->assertNotEmpty($pocketImport->getUrl()); - $this->assertContains('This importer will import all your Pocket data.', $pocketImport->getDescription()); + $this->assertEquals('import.pocket.description', $pocketImport->getDescription()); } public function testOAuthRequest() diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php index 8ab7e830..496cf2d3 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php @@ -45,7 +45,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase $this->assertEquals('wallabag v1', $wallabagV1Import->getName()); $this->assertNotEmpty($wallabagV1Import->getUrl()); - $this->assertContains('This importer will import all your wallabag v1 articles.', $wallabagV1Import->getDescription()); + $this->assertEquals('import.wallabag_v1.description', $wallabagV1Import->getDescription()); } public function testImport() diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php index 2b642d27..341b1076 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php @@ -45,7 +45,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase $this->assertEquals('wallabag v2', $wallabagV2Import->getName()); $this->assertNotEmpty($wallabagV2Import->getUrl()); - $this->assertContains('This importer will import all your wallabag v2 articles.', $wallabagV2Import->getDescription()); + $this->assertEquals('import.wallabag_v2.description', $wallabagV2Import->getDescription()); } public function testImport() -- cgit v1.2.3 From 4204a06b7726597dc84fe34b39c53f1534a86140 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 11 Mar 2016 14:48:46 +0100 Subject: Add flashes messages --- src/Wallabag/ImportBundle/Controller/PocketController.php | 8 ++++++-- src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php | 9 ++++++--- src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php | 9 ++++++--- .../ImportBundle/Tests/Controller/PocketControllerTest.php | 2 +- .../ImportBundle/Tests/Controller/WallabagV1ControllerTest.php | 6 +++--- .../ImportBundle/Tests/Controller/WallabagV2ControllerTest.php | 4 ++-- 6 files changed, 24 insertions(+), 14 deletions(-) (limited to 'src/Wallabag/ImportBundle') diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php index 7a35514b..1d804219 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketController.php +++ b/src/Wallabag/ImportBundle/Controller/PocketController.php @@ -52,8 +52,9 @@ class PocketController extends Controller */ public function callbackAction() { - $message = 'Import failed, please try again.'; + $message = 'flashes.import.notice.failed'; $pocket = $this->get('wallabag_import.pocket.import'); + $markAsRead = $this->get('session')->get('mark_as_read'); $this->get('session')->remove('mark_as_read'); @@ -69,7 +70,10 @@ class PocketController extends Controller if (true === $pocket->setMarkAsRead($markAsRead)->import()) { $summary = $pocket->getSummary(); - $message = 'Import summary: '.$summary['imported'].' imported, '.$summary['skipped'].' already saved.'; + $message = $this->get('translator')->trans('flashes.import.notice.summary', array( + '%imported%' => $summary['imported'], + '%skipped%' => $summary['skipped'], + )); } $this->get('session')->getFlashBag()->add( diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php index 154a0769..1bc9696d 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php @@ -31,11 +31,14 @@ class WallabagV1Controller extends Controller ->setMarkAsRead($markAsRead) ->import(); - $message = 'Import failed, please try again.'; + $message = 'flashes.import.notice.failed'; if (true === $res) { $summary = $wallabag->getSummary(); - $message = 'Import summary: '.$summary['imported'].' imported, '.$summary['skipped'].' already saved.'; + $message = $this->get('translator')->trans('flashes.import.notice.summary', array( + '%imported%' => $summary['imported'], + '%skipped%' => $summary['skipped'], + )); unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); } @@ -49,7 +52,7 @@ class WallabagV1Controller extends Controller } else { $this->get('session')->getFlashBag()->add( 'notice', - 'Error while processing import. Please verify your import file.' + 'flashes.import.notice.failed_on_file' ); } } diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php index 6dcd204a..3e6428a0 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php @@ -31,11 +31,14 @@ class WallabagV2Controller extends Controller ->setMarkAsRead($markAsRead) ->import(); - $message = 'Import failed, please try again.'; + $message = 'flashes.import.notice.failed'; if (true === $res) { $summary = $wallabag->getSummary(); - $message = 'Import summary: '.$summary['imported'].' imported, '.$summary['skipped'].' already saved.'; + $message = $this->get('translator')->trans('flashes.import.notice.summary', array( + '%imported%' => $summary['imported'], + '%skipped%' => $summary['skipped'], + )); unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); } @@ -49,7 +52,7 @@ class WallabagV2Controller extends Controller } else { $this->get('session')->getFlashBag()->add( 'notice', - 'Error while processing import. Please verify your import file.' + 'flashes.import.notice.failed_on_file' ); } } diff --git a/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php index c2acd68c..174641fd 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php @@ -37,6 +37,6 @@ class PocketControllerTest extends WallabagCoreTestCase $this->assertEquals(302, $client->getResponse()->getStatusCode()); $this->assertContains('import/pocket', $client->getResponse()->headers->get('location')); - $this->assertEquals('Import failed, please try again.', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]); + $this->assertEquals('flashes.import.notice.failed', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]); } } diff --git a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php index 6c876b3b..8d353a71 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php @@ -55,7 +55,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $this->assertTrue($content->getTags()->contains($tag)); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); - $this->assertContains('Import summary', $body[0]); + $this->assertContains('flashes.import.notice.summary', $body[0]); } public function testImportWallabagWithFileAndMarkAllAsRead() @@ -100,7 +100,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $this->assertTrue($content2->isArchived()); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); - $this->assertContains('Import summary', $body[0]); + $this->assertContains('flashes.import.notice.summary', $body[0]); } public function testImportWallabagWithEmptyFile() @@ -124,6 +124,6 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $crawler = $client->followRedirect(); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); - $this->assertContains('Import failed, please try again', $body[0]); + $this->assertContains('flashes.import.notice.failed', $body[0]); } } diff --git a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php index 58baa836..bcbd6305 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php @@ -40,7 +40,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $crawler = $client->followRedirect(); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); - $this->assertContains('Import summary', $body[0]); + $this->assertContains('flashes.import.notice.summary', $body[0]); $content = $client->getContainer() ->get('doctrine.orm.entity_manager') @@ -88,6 +88,6 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $crawler = $client->followRedirect(); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); - $this->assertContains('Import failed, please try again', $body[0]); + $this->assertContains('flashes.import.notice.failed', $body[0]); } } -- cgit v1.2.3