diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-10-31 13:29:33 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-10-31 13:29:33 +0100 |
commit | aedd6ca0fd212abd07ec59c5fd58ea2ca99198c5 (patch) | |
tree | a004084e19819175502be86d80a1b4f691295aed | |
parent | d1495dd0a456f0e35a09fb68679ee51f8d17bfe4 (diff) | |
download | wallabag-aedd6ca0fd212abd07ec59c5fd58ea2ca99198c5.tar.gz wallabag-aedd6ca0fd212abd07ec59c5fd58ea2ca99198c5.tar.zst wallabag-aedd6ca0fd212abd07ec59c5fd58ea2ca99198c5.zip |
Add translations & migration
15 files changed, 62 insertions, 35 deletions
diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php new file mode 100644 index 00000000..c7364428 --- /dev/null +++ b/app/DoctrineMigrations/Version20161031132655.php | |||
@@ -0,0 +1,44 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Application\Migrations; | ||
4 | |||
5 | use Doctrine\DBAL\Migrations\AbstractMigration; | ||
6 | use Doctrine\DBAL\Schema\Schema; | ||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | ||
9 | |||
10 | class Version20161031132655 extends AbstractMigration implements ContainerAwareInterface | ||
11 | { | ||
12 | /** | ||
13 | * @var ContainerInterface | ||
14 | */ | ||
15 | private $container; | ||
16 | |||
17 | public function setContainer(ContainerInterface $container = null) | ||
18 | { | ||
19 | $this->container = $container; | ||
20 | } | ||
21 | |||
22 | private function getTable($tableName) | ||
23 | { | ||
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @param Schema $schema | ||
29 | */ | ||
30 | public function up(Schema $schema) | ||
31 | { | ||
32 | $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); | ||
33 | } | ||
34 | |||
35 | /** | ||
36 | * @param Schema $schema | ||
37 | */ | ||
38 | public function down(Schema $schema) | ||
39 | { | ||
40 | $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); | ||
41 | |||
42 | $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';"); | ||
43 | } | ||
44 | } | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml index 3e11d675..7c323783 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml | |||
@@ -29,3 +29,4 @@ piwik_enabled: Aktiver Piwik | |||
29 | demo_mode_enabled: "Aktiver demo-indstilling? (anvendes kun til wallabags offentlige demo)" | 29 | demo_mode_enabled: "Aktiver demo-indstilling? (anvendes kun til wallabags offentlige demo)" |
30 | demo_mode_username: "Demobruger" | 30 | demo_mode_username: "Demobruger" |
31 | # share_public: Allow public url for entries | 31 | # share_public: Allow public url for entries |
32 | # download_images_enabled: Download images locally | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml index c74b5c1f..438eb74a 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml | |||
@@ -29,3 +29,4 @@ piwik_enabled: Piwik aktivieren | |||
29 | demo_mode_enabled: "Test-Modus aktivieren? (nur für die öffentliche wallabag-Demo genutzt)" | 29 | demo_mode_enabled: "Test-Modus aktivieren? (nur für die öffentliche wallabag-Demo genutzt)" |
30 | demo_mode_username: "Test-Benutzer" | 30 | demo_mode_username: "Test-Benutzer" |
31 | share_public: Erlaube eine öffentliche URL für Einträge | 31 | share_public: Erlaube eine öffentliche URL für Einträge |
32 | # download_images_enabled: Download images locally | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index 77c09db4..c2f2b3fb 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml | |||
@@ -29,3 +29,4 @@ piwik_enabled: Enable Piwik | |||
29 | demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" | 29 | demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" |
30 | demo_mode_username: "Demo user" | 30 | demo_mode_username: "Demo user" |
31 | share_public: Allow public url for entries | 31 | share_public: Allow public url for entries |
32 | download_images_enabled: Download images locally | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml index baa83849..76feea50 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml | |||
@@ -29,3 +29,4 @@ piwik_enabled: Activar Piwik | |||
29 | demo_mode_enabled: "Activar modo demo (sólo usado para la demo de wallabag)" | 29 | demo_mode_enabled: "Activar modo demo (sólo usado para la demo de wallabag)" |
30 | demo_mode_username: "Nombre de usuario demo" | 30 | demo_mode_username: "Nombre de usuario demo" |
31 | # share_public: Allow public url for entries | 31 | # share_public: Allow public url for entries |
32 | # download_images_enabled: Download images locally | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml index b394977e..30df0086 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml | |||
@@ -29,3 +29,4 @@ modify_settings: "اعمال" | |||
29 | # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" | 29 | # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" |
30 | # demo_mode_username: "Demo user" | 30 | # demo_mode_username: "Demo user" |
31 | # share_public: Allow public url for entries | 31 | # share_public: Allow public url for entries |
32 | # download_images_enabled: Download images locally | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index 31a80880..a60341b3 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml | |||
@@ -29,3 +29,4 @@ piwik_enabled: Activer Piwik | |||
29 | demo_mode_enabled: "Activer le mode démo ? (utiliser uniquement pour la démo publique de wallabag)" | 29 | demo_mode_enabled: "Activer le mode démo ? (utiliser uniquement pour la démo publique de wallabag)" |
30 | demo_mode_username: "Utilisateur de la démo" | 30 | demo_mode_username: "Utilisateur de la démo" |
31 | share_public: Autoriser une URL publique pour les articles | 31 | share_public: Autoriser une URL publique pour les articles |
32 | download_images_enabled: Télécharger les images en local | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml index ba038556..3ad5f7d0 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml | |||
@@ -29,3 +29,4 @@ piwik_enabled: Abilita Piwik | |||
29 | demo_mode_enabled: "Abilita modalità demo ? (usato solo per la demo pubblica di wallabag)" | 29 | demo_mode_enabled: "Abilita modalità demo ? (usato solo per la demo pubblica di wallabag)" |
30 | demo_mode_username: "Utente Demo" | 30 | demo_mode_username: "Utente Demo" |
31 | # share_public: Allow public url for entries | 31 | # share_public: Allow public url for entries |
32 | # download_images_enabled: Download images locally | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index 55249e33..fd83b437 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml | |||
@@ -29,3 +29,4 @@ piwik_enabled: Activar Piwik | |||
29 | demo_mode_enabled: "Activar lo mode demostracion ? (utilizar solament per la demostracion publica de wallabag)" | 29 | demo_mode_enabled: "Activar lo mode demostracion ? (utilizar solament per la demostracion publica de wallabag)" |
30 | demo_mode_username: "Utilizaire de la demostracion" | 30 | demo_mode_username: "Utilizaire de la demostracion" |
31 | # share_public: Allow public url for entries | 31 | # share_public: Allow public url for entries |
32 | # download_images_enabled: Download images locally | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml index 42cc5b52..3a63eebb 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml | |||
@@ -29,3 +29,4 @@ piwik_enabled: Włacz Piwik | |||
29 | demo_mode_enabled: "Włacz tryb demo? (używany wyłącznie dla publicznej demonstracji Wallabag)" | 29 | demo_mode_enabled: "Włacz tryb demo? (używany wyłącznie dla publicznej demonstracji Wallabag)" |
30 | demo_mode_username: "Użytkownik Demonstracyjny" | 30 | demo_mode_username: "Użytkownik Demonstracyjny" |
31 | share_public: Zezwalaj na publiczny adres url dla wpisow | 31 | share_public: Zezwalaj na publiczny adres url dla wpisow |
32 | # download_images_enabled: Download images locally | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml index 8e72b955..4fb42e98 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml | |||
@@ -29,3 +29,4 @@ modify_settings: "aplică" | |||
29 | # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" | 29 | # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" |
30 | # demo_mode_username: "Demo user" | 30 | # demo_mode_username: "Demo user" |
31 | # share_public: Allow public url for entries | 31 | # share_public: Allow public url for entries |
32 | # download_images_enabled: Download images locally | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml index 55f70843..ebfadf29 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml | |||
@@ -29,3 +29,4 @@ | |||
29 | # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" | 29 | # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" |
30 | # demo_mode_username: "Demo user" | 30 | # demo_mode_username: "Demo user" |
31 | # share_public: Allow public url for entries | 31 | # share_public: Allow public url for entries |
32 | # download_images_enabled: Download images locally | ||
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index aedccfe4..9fe90357 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php | |||
@@ -370,7 +370,7 @@ class InstallCommand extends ContainerAwareCommand | |||
370 | ], | 370 | ], |
371 | [ | 371 | [ |
372 | 'name' => 'wallabag_url', | 372 | 'name' => 'wallabag_url', |
373 | 'value' => 'http://v2.wallabag.org', | 373 | 'value' => '', |
374 | 'section' => 'misc', | 374 | 'section' => 'misc', |
375 | ], | 375 | ], |
376 | [ | 376 | [ |
@@ -401,17 +401,7 @@ class InstallCommand extends ContainerAwareCommand | |||
401 | [ | 401 | [ |
402 | 'name' => 'download_images_enabled', | 402 | 'name' => 'download_images_enabled', |
403 | 'value' => '0', | 403 | 'value' => '0', |
404 | 'section' => 'image', | 404 | 'section' => 'misc', |
405 | ], | ||
406 | [ | ||
407 | 'name' => 'download_images_with_rabbitmq', | ||
408 | 'value' => '0', | ||
409 | 'section' => 'image', | ||
410 | ], | ||
411 | [ | ||
412 | 'name' => 'download_images_with_redis', | ||
413 | 'value' => '0', | ||
414 | 'section' => 'image', | ||
415 | ], | 405 | ], |
416 | ]; | 406 | ]; |
417 | 407 | ||
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php index 70a7a4ac..d0085660 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php | |||
@@ -143,17 +143,7 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface | |||
143 | [ | 143 | [ |
144 | 'name' => 'download_images_enabled', | 144 | 'name' => 'download_images_enabled', |
145 | 'value' => '0', | 145 | 'value' => '0', |
146 | 'section' => 'image', | 146 | 'section' => 'misc', |
147 | ], | ||
148 | [ | ||
149 | 'name' => 'download_images_with_rabbitmq', | ||
150 | 'value' => '0', | ||
151 | 'section' => 'image', | ||
152 | ], | ||
153 | [ | ||
154 | 'name' => 'download_images_with_redis', | ||
155 | 'value' => '0', | ||
156 | 'section' => 'image', | ||
157 | ], | 147 | ], |
158 | ]; | 148 | ]; |
159 | 149 | ||
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php index 3f2d460c..6fddcea9 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php | |||
@@ -111,6 +111,8 @@ class DownloadImagesSubscriber implements EventSubscriber | |||
111 | /** | 111 | /** |
112 | * Download all images from the html. | 112 | * Download all images from the html. |
113 | * | 113 | * |
114 | * @todo If we want to add async download, it should be done in that method | ||
115 | * | ||
114 | * @param Config $config | 116 | * @param Config $config |
115 | * @param Entry $entry | 117 | * @param Entry $entry |
116 | * | 118 | * |
@@ -120,12 +122,6 @@ class DownloadImagesSubscriber implements EventSubscriber | |||
120 | { | 122 | { |
121 | $this->downloadImages->setWallabagUrl($config->get('wallabag_url')); | 123 | $this->downloadImages->setWallabagUrl($config->get('wallabag_url')); |
122 | 124 | ||
123 | // if ($config->get('download_images_with_rabbitmq')) { | ||
124 | |||
125 | // } else if ($config->get('download_images_with_redis')) { | ||
126 | |||
127 | // } | ||
128 | |||
129 | return $this->downloadImages->processHtml( | 125 | return $this->downloadImages->processHtml( |
130 | $entry->getContent(), | 126 | $entry->getContent(), |
131 | $entry->getUrl() | 127 | $entry->getUrl() |
@@ -135,6 +131,8 @@ class DownloadImagesSubscriber implements EventSubscriber | |||
135 | /** | 131 | /** |
136 | * Download the preview picture. | 132 | * Download the preview picture. |
137 | * | 133 | * |
134 | * @todo If we want to add async download, it should be done in that method | ||
135 | * | ||
138 | * @param Config $config | 136 | * @param Config $config |
139 | * @param Entry $entry | 137 | * @param Entry $entry |
140 | * | 138 | * |
@@ -144,12 +142,6 @@ class DownloadImagesSubscriber implements EventSubscriber | |||
144 | { | 142 | { |
145 | $this->downloadImages->setWallabagUrl($config->get('wallabag_url')); | 143 | $this->downloadImages->setWallabagUrl($config->get('wallabag_url')); |
146 | 144 | ||
147 | // if ($config->get('download_images_with_rabbitmq')) { | ||
148 | |||
149 | // } else if ($config->get('download_images_with_redis')) { | ||
150 | |||
151 | // } | ||
152 | |||
153 | return $this->downloadImages->processSingleImage( | 145 | return $this->downloadImages->processSingleImage( |
154 | $entry->getPreviewPicture(), | 146 | $entry->getPreviewPicture(), |
155 | $entry->getUrl() | 147 | $entry->getUrl() |