Add translations & migration

This commit is contained in:
Jeremy Benoist 2016-10-31 13:29:33 +01:00
parent d1495dd0a4
commit aedd6ca0fd
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
15 changed files with 62 additions and 35 deletions

View file

@ -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';");
}
}

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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',
],
];

View 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',
],
];

View 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()