]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Add translations & migration
authorJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 31 Oct 2016 12:29:33 +0000 (13:29 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 31 Oct 2016 12:29:33 +0000 (13:29 +0100)
15 files changed:
app/DoctrineMigrations/Version20161031132655.php [new file with mode: 0644]
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml
src/Wallabag/CoreBundle/Command/InstallCommand.php
src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php

diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php
new file mode 100644 (file)
index 0000000..c736442
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+
+namespace Application\Migrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Schema\Schema;
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+class Version20161031132655 extends AbstractMigration implements ContainerAwareInterface
+{
+    /**
+     * @var ContainerInterface
+     */
+    private $container;
+
+    public function setContainer(ContainerInterface $container = null)
+    {
+        $this->container = $container;
+    }
+
+    private function getTable($tableName)
+    {
+        return $this->container->getParameter('database_table_prefix') . $tableName;
+    }
+
+    /**
+     * @param Schema $schema
+     */
+    public function up(Schema $schema)
+    {
+        $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')");
+    }
+
+    /**
+     * @param Schema $schema
+     */
+    public function down(Schema $schema)
+    {
+        $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
+
+        $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';");
+    }
+}
index 3e11d675c35a7534ec85e4ef54443cd59cabe0f2..7c32378333a63651548b7c0cc3b49f3289dcc4ff 100644 (file)
@@ -29,3 +29,4 @@ piwik_enabled: Aktiver Piwik
 demo_mode_enabled: "Aktiver demo-indstilling? (anvendes kun til wallabags offentlige demo)"
 demo_mode_username: "Demobruger"
 # share_public: Allow public url for entries
+# download_images_enabled: Download images locally
index c74b5c1ff1f7eb4ea99d981d37aac2710a6c1e28..438eb74a209c6f0a0945340c4132c3df1dce49b6 100644 (file)
@@ -29,3 +29,4 @@ piwik_enabled: Piwik aktivieren
 demo_mode_enabled: "Test-Modus aktivieren? (nur für die öffentliche wallabag-Demo genutzt)"
 demo_mode_username: "Test-Benutzer"
 share_public: Erlaube eine öffentliche URL für Einträge
+# download_images_enabled: Download images locally
index 77c09db4333fabcaab863979aa1e3ee3c9a36efa..c2f2b3fbb34014ce3d1693134d7c85a1f6e5f265 100644 (file)
@@ -29,3 +29,4 @@ piwik_enabled: Enable Piwik
 demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)"
 demo_mode_username: "Demo user"
 share_public: Allow public url for entries
+download_images_enabled: Download images locally
index baa838493d62190678426479e016b904dae9470e..76feea50de8276d5013255e94a801ad348c642bd 100644 (file)
@@ -29,3 +29,4 @@ piwik_enabled: Activar Piwik
 demo_mode_enabled: "Activar modo demo (sólo usado para la demo de wallabag)"
 demo_mode_username: "Nombre de usuario demo"
 # share_public: Allow public url for entries
+# download_images_enabled: Download images locally
index b394977e2e2c9b00de9684c60fb757cafa7ce073..30df00863838d3ddfa124bccc7e1add668c1ebfd 100644 (file)
@@ -29,3 +29,4 @@ modify_settings: "اعمال"
 # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)"
 # demo_mode_username: "Demo user"
 # share_public: Allow public url for entries
+# download_images_enabled: Download images locally
index 31a80880440a379f8d9f6805626d65cfdecf36d7..a60341b345715168db9b84ea72c1a864fb36725d 100644 (file)
@@ -29,3 +29,4 @@ piwik_enabled: Activer Piwik
 demo_mode_enabled: "Activer le mode démo ? (utiliser uniquement pour la démo publique de wallabag)"
 demo_mode_username: "Utilisateur de la démo"
 share_public: Autoriser une URL publique pour les articles
+download_images_enabled: Télécharger les images en local
index ba038556159a9ff4bdef8e9a4b5f41c49895317a..3ad5f7d0910a879af8ae2e9ba468a16d35aec70a 100644 (file)
@@ -29,3 +29,4 @@ piwik_enabled: Abilita Piwik
 demo_mode_enabled: "Abilita modalità demo ? (usato solo per la demo pubblica di wallabag)"
 demo_mode_username: "Utente Demo"
 # share_public: Allow public url for entries
+# download_images_enabled: Download images locally
index 55249e33b529e696131bba1db8d8322aeac17d88..fd83b43725fa69f0e3b3c85eaa9b5991bdf8fa26 100644 (file)
@@ -29,3 +29,4 @@ piwik_enabled: Activar Piwik
 demo_mode_enabled: "Activar lo mode demostracion ? (utilizar solament per la demostracion publica de wallabag)"
 demo_mode_username: "Utilizaire de la demostracion"
 # share_public: Allow public url for entries
+# download_images_enabled: Download images locally
index 42cc5b5253ba1e381fc89f29c158a72fbd14601c..3a63eebb00048919be6bc0c2bc13a4c649c74e37 100644 (file)
@@ -29,3 +29,4 @@ piwik_enabled: Włacz Piwik
 demo_mode_enabled: "Włacz tryb demo? (używany wyłącznie dla publicznej demonstracji Wallabag)"
 demo_mode_username: "Użytkownik Demonstracyjny"
 share_public: Zezwalaj na publiczny adres url dla wpisow
+# download_images_enabled: Download images locally
index 8e72b95555c161950a55d4475592e630a097273e..4fb42e984c167fe0c0a6f4f640d502f6994c8ae0 100644 (file)
@@ -29,3 +29,4 @@ modify_settings: "aplică"
 # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)"
 # demo_mode_username: "Demo user"
 # share_public: Allow public url for entries
+# download_images_enabled: Download images locally
index 55f70843397c754843bf061b9aadbed247f2891a..ebfadf29b5b43cb01e3d693715e5a369537a9cf9 100644 (file)
@@ -29,3 +29,4 @@
 # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)"
 # demo_mode_username: "Demo user"
 # share_public: Allow public url for entries
+# download_images_enabled: Download images locally
index aedccfe4c8fcdbabda5da78d7d92c208618d7c81..9fe903577b3e122f1ef6dbff706047ac0eb4b10c 100644 (file)
@@ -370,7 +370,7 @@ class InstallCommand extends ContainerAwareCommand
             ],
             [
                 'name' => 'wallabag_url',
-                'value' => 'http://v2.wallabag.org',
+                'value' => '',
                 'section' => 'misc',
             ],
             [
@@ -401,17 +401,7 @@ class InstallCommand extends ContainerAwareCommand
             [
                 'name' => 'download_images_enabled',
                 'value' => '0',
-                'section' => 'image',
-            ],
-            [
-                'name' => 'download_images_with_rabbitmq',
-                'value' => '0',
-                'section' => 'image',
-            ],
-            [
-                'name' => 'download_images_with_redis',
-                'value' => '0',
-                'section' => 'image',
+                'section' => 'misc',
             ],
         ];
 
index 70a7a4ac0e37d7406e3b00a586a6fbdc275ca2c7..d0085660f4ec5270cc623713b6a78c65fc062a10 100644 (file)
@@ -143,17 +143,7 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface
             [
                 'name' => 'download_images_enabled',
                 'value' => '0',
-                'section' => 'image',
-            ],
-            [
-                'name' => 'download_images_with_rabbitmq',
-                'value' => '0',
-                'section' => 'image',
-            ],
-            [
-                'name' => 'download_images_with_redis',
-                'value' => '0',
-                'section' => 'image',
+                'section' => 'misc',
             ],
         ];
 
index 3f2d460c1ef7a3684f4e513336b881068070b77f..6fddcea9eb923ccca5b306ed4192ad86739ad5e5 100644 (file)
@@ -111,6 +111,8 @@ class DownloadImagesSubscriber implements EventSubscriber
     /**
      * Download all images from the html.
      *
+     * @todo If we want to add async download, it should be done in that method
+     *
      * @param Config $config
      * @param Entry  $entry
      *
@@ -120,12 +122,6 @@ class DownloadImagesSubscriber implements EventSubscriber
     {
         $this->downloadImages->setWallabagUrl($config->get('wallabag_url'));
 
-        // if ($config->get('download_images_with_rabbitmq')) {
-
-        // } else if ($config->get('download_images_with_redis')) {
-
-        // }
-
         return $this->downloadImages->processHtml(
             $entry->getContent(),
             $entry->getUrl()
@@ -135,6 +131,8 @@ class DownloadImagesSubscriber implements EventSubscriber
     /**
      * Download the preview picture.
      *
+     * @todo If we want to add async download, it should be done in that method
+     *
      * @param Config $config
      * @param Entry  $entry
      *
@@ -144,12 +142,6 @@ class DownloadImagesSubscriber implements EventSubscriber
     {
         $this->downloadImages->setWallabagUrl($config->get('wallabag_url'));
 
-        // if ($config->get('download_images_with_rabbitmq')) {
-
-        // } else if ($config->get('download_images_with_redis')) {
-
-        // }
-
         return $this->downloadImages->processSingleImage(
             $entry->getPreviewPicture(),
             $entry->getUrl()