diff --git a/bin/developer b/bin/developer
index d52174170c..4962c3bf63 100755
--- a/bin/developer
+++ b/bin/developer
@@ -20,6 +20,7 @@ use Alchemy\Phrasea\Command\Developer\LessCompiler;
use Alchemy\Phrasea\Command\Developer\RegenerateSqliteDb;
use Alchemy\Phrasea\Command\Developer\RoutesDumper;
use Alchemy\Phrasea\Command\Developer\Uninstaller;
+use Alchemy\Phrasea\Command\Developer\TranslationDumper;
use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper;
use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper;
@@ -75,7 +76,7 @@ if ($cli['configuration.store']->isSetup()) {
}
}
-$cli->command(new \Alchemy\Phrasea\Command\Developer\TranslationDumper());
+$cli->command(new TranslationDumper());
$cli->command(new InstallAll());
$cli->command(new BowerInstall());
diff --git a/hudson/fixtures.sql b/hudson/fixtures.sql
index a33ce86ec9..749c3ed21c 100644
--- a/hudson/fixtures.sql
+++ b/hudson/fixtures.sql
@@ -1642,7 +1642,7 @@ CREATE TABLE `pref` (
LOCK TABLES `pref` WRITE;
/*!40000 ALTER TABLE `pref` DISABLE KEYS */;
-INSERT INTO `pref` VALUES (1,'thesaurus','','','0000-00-00 00:00:00','2012-04-27 02:06:31'),(2,'structure','\n";
if ($result->getTotal() != $result->getAvailable()) {
- $explain .= $app->trans('reponses:: %available% Resultats rappatries sur un total de %total% trouves', array('available' => $result->getAvailable(), '%total%' => $result->getTotal()));
+ $explain .= $app->trans('reponses:: %available% Resultats rappatries sur un total de %total% trouves', ['available' => $result->getAvailable(), '%total%' => $result->getTotal()]);
} else {
- $explain .= $app->trans('reponses:: %total% Resultats', array('%total%' => $result->getTotal()));
+ $explain .= $app->trans('reponses:: %total% Resultats', ['%total%' => $result->getTotal()]);
}
$explain .= " ";
$explain .= '
' . $term['terms'] . ''; diff --git a/lib/classes/eventsmanager/notify/autoregister.php b/lib/classes/eventsmanager/notify/autoregister.php index 9701e70cb9..5941caba1b 100644 --- a/lib/classes/eventsmanager/notify/autoregister.php +++ b/lib/classes/eventsmanager/notify/autoregister.php @@ -149,7 +149,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract $sender = User_Adapter::getInstance($usr_id, $this->app)->get_display_name(); $ret = [ - 'text' => $this->app->trans('%user% s\'est enregistre sur une ou plusieurs %before_link% scollections %after_link%', array('%user%' => $sender, '%before_link%' => '', '%after_link%' => '')) + 'text' => $this->app->trans('%user% s\'est enregistre sur une ou plusieurs %before_link% scollections %after_link%', ['%user%' => $sender, '%before_link%' => '', '%after_link%' => '']) , 'class' => '' ]; diff --git a/lib/classes/eventsmanager/notify/bridgeuploadfail.php b/lib/classes/eventsmanager/notify/bridgeuploadfail.php index 63ac8a265d..1e566bb083 100644 --- a/lib/classes/eventsmanager/notify/bridgeuploadfail.php +++ b/lib/classes/eventsmanager/notify/bridgeuploadfail.php @@ -125,11 +125,11 @@ class eventsmanager_notify_bridgeuploadfail extends eventsmanager_notifyAbstract } $ret = [ - 'text' => $this->app->trans("L'upload concernant le record %title% sur le compte %bridge_name% a echoue pour les raisons suivantes : %reason%", array( + 'text' => $this->app->trans("L'upload concernant le record %title% sur le compte %bridge_name% a echoue pour les raisons suivantes : %reason%", [ '%title%' => $record->get_title(), '%bridge_name%' => $account->get_api()->get_connector()->get_name(), '%reason%' => $reason - )) + ]) , 'class' => '' ]; diff --git a/lib/classes/eventsmanager/notify/downloadmailfail.php b/lib/classes/eventsmanager/notify/downloadmailfail.php index 57368cd58f..89bacf4d85 100644 --- a/lib/classes/eventsmanager/notify/downloadmailfail.php +++ b/lib/classes/eventsmanager/notify/downloadmailfail.php @@ -105,7 +105,7 @@ class eventsmanager_notify_downloadmailfail extends eventsmanager_notifyAbstract $reason = $this->app->trans('an error occured while exporting records'); } - $text = $this->app->trans("The delivery to %email% failed for the following reason : %reason%", array('%email%' => $dest, '%reason%' => $reason)); + $text = $this->app->trans("The delivery to %email% failed for the following reason : %reason%", ['%email%' => $dest, '%reason%' => $reason]); $ret = [ 'text' => $text diff --git a/lib/classes/eventsmanager/notify/feed.php b/lib/classes/eventsmanager/notify/feed.php index fe72e29933..f7ee8f5aa5 100644 --- a/lib/classes/eventsmanager/notify/feed.php +++ b/lib/classes/eventsmanager/notify/feed.php @@ -140,7 +140,7 @@ class eventsmanager_notify_feed extends eventsmanager_notifyAbstract } $ret = [ - 'text' => $this->app->trans('%user% has published %title%', array('%user%' => $entry->getAuthorName(), '%title%' => '' . $entry->getTitle() . '')) + 'text' => $this->app->trans('%user% has published %title%', ['%user%' => $entry->getAuthorName(), '%title%' => '' . $entry->getTitle() . '']) , 'class' => ($unread == 1 ? 'reload_baskets' : '') ]; diff --git a/lib/classes/eventsmanager/notify/order.php b/lib/classes/eventsmanager/notify/order.php index 564950bf89..1f0d33d7b4 100644 --- a/lib/classes/eventsmanager/notify/order.php +++ b/lib/classes/eventsmanager/notify/order.php @@ -147,10 +147,10 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract $sender = User_Adapter::getInstance($usr_id, $this->app)->get_display_name(); $ret = [ - 'text' => $this->app->trans('%user% a passe une %opening_link% commande %end_link%', array( + 'text' => $this->app->trans('%user% a passe une %opening_link% commande %end_link%', [ '%user%' => $sender, '%opening_link%' => '', - '%end_link%' => '',)) + '%end_link%' => '',]) , 'class' => '' ]; diff --git a/lib/classes/eventsmanager/notify/orderdeliver.php b/lib/classes/eventsmanager/notify/orderdeliver.php index 7d1c8cf301..f3f3df5d5f 100644 --- a/lib/classes/eventsmanager/notify/orderdeliver.php +++ b/lib/classes/eventsmanager/notify/orderdeliver.php @@ -158,9 +158,9 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract return []; } $ret = [ - 'text' => $this->app->trans('%user% vous a delivre %quantity% document(s) pour votre commande %title%', array('%user%' => $sender, '%quantity%' => $n, '%title%' => 'ssel_id . '/" target="_blank">' - . $basket->getName() . '')) + . $basket->getName() . '']) , 'class' => '' ]; diff --git a/lib/classes/eventsmanager/notify/ordernotdelivered.php b/lib/classes/eventsmanager/notify/ordernotdelivered.php index 9662f3f4c2..23afc20ed2 100644 --- a/lib/classes/eventsmanager/notify/ordernotdelivered.php +++ b/lib/classes/eventsmanager/notify/ordernotdelivered.php @@ -116,7 +116,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac $sender = User_Adapter::getInstance($from, $this->app)->get_display_name(); $ret = [ - 'text' => $this->app->trans('%user% a refuse la livraison de %quantity% document(s) pour votre commande', array('%user%' => $sender, '%quantity%' => $n)) + 'text' => $this->app->trans('%user% a refuse la livraison de %quantity% document(s) pour votre commande', ['%user%' => $sender, '%quantity%' => $n]) , 'class' => '' ]; diff --git a/lib/classes/eventsmanager/notify/push.php b/lib/classes/eventsmanager/notify/push.php index 73ae675930..294f24284e 100644 --- a/lib/classes/eventsmanager/notify/push.php +++ b/lib/classes/eventsmanager/notify/push.php @@ -128,8 +128,8 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract $sender = User_Adapter::getInstance($from, $this->app)->get_display_name(); $ret = [ - 'text' => $this->app->trans('%user% vous a envoye un %before_link% panier %after_link%', array('%user%' => $sender, '%before_link%' => '', '%after_link%' => '')) + 'text' => $this->app->trans('%user% vous a envoye un %before_link% panier %after_link%', ['%user%' => $sender, '%before_link%' => '', '%after_link%' => '']) , 'class' => ($unread == 1 ? 'reload_baskets' : '') ]; diff --git a/lib/classes/eventsmanager/notify/register.php b/lib/classes/eventsmanager/notify/register.php index 485b1cbd0d..8a121fc8d2 100644 --- a/lib/classes/eventsmanager/notify/register.php +++ b/lib/classes/eventsmanager/notify/register.php @@ -159,7 +159,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract $sender = User_Adapter::getInstance($usr_id, $this->app)->get_display_name(); $ret = [ - 'text' => $this->app->trans('%user% demande votre approbation sur une ou plusieurs %before_link% collections %after_link%', array('%user%' => $sender, '%before_link%' => '', '%after_link%' => '')) + 'text' => $this->app->trans('%user% demande votre approbation sur une ou plusieurs %before_link% collections %after_link%', ['%user%' => $sender, '%before_link%' => '', '%after_link%' => '']) , 'class' => '' ]; diff --git a/lib/classes/eventsmanager/notify/uploadquarantine.php b/lib/classes/eventsmanager/notify/uploadquarantine.php index b4510341d5..354661e5a7 100644 --- a/lib/classes/eventsmanager/notify/uploadquarantine.php +++ b/lib/classes/eventsmanager/notify/uploadquarantine.php @@ -146,10 +146,10 @@ class eventsmanager_notify_uploadquarantine extends eventsmanager_notifyAbstract $filename = (string) $sx->filename; - $text = $this->app->trans('The document %name% has been quarantined', array('%name%' => $filename)); + $text = $this->app->trans('The document %name% has been quarantined', ['%name%' => $filename]); if ( ! ! count($reasons)) { - $text .= ' ' . $this->app->trans('for the following reasons : %reasons%', array('%reasons%' => implode(', ', $reasons))); + $text .= ' ' . $this->app->trans('for the following reasons : %reasons%', ['%reasons%' => implode(', ', $reasons)]); } $ret = ['text' => $text, 'class' => '']; diff --git a/lib/classes/eventsmanager/notify/validate.php b/lib/classes/eventsmanager/notify/validate.php index 0dc8975d95..f6e41c0b23 100644 --- a/lib/classes/eventsmanager/notify/validate.php +++ b/lib/classes/eventsmanager/notify/validate.php @@ -158,10 +158,10 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract . $basket_name . ''; $ret = [ - 'text' => $this->app->trans('%user% vous demande de valider %title%', array( + 'text' => $this->app->trans('%user% vous demande de valider %title%', [ '%user%' => $sender, '%title%' => $bask_link, - )) + ]) , 'class' => ($unread == 1 ? 'reload_baskets' : '') ]; diff --git a/lib/classes/eventsmanager/notify/validationdone.php b/lib/classes/eventsmanager/notify/validationdone.php index 7efb8ec5cb..1dbfd8ca49 100644 --- a/lib/classes/eventsmanager/notify/validationdone.php +++ b/lib/classes/eventsmanager/notify/validationdone.php @@ -146,10 +146,10 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract } $ret = [ - 'text' => $this->app->trans('%user% a envoye son rapport de validation de %title%', array('%user%' => $sender, '%title%' => 'ssel_id . '/" target="_blank">' . $basket->getName() . '' - )) + ]) , 'class' => '' ]; diff --git a/lib/classes/eventsmanager/notify/validationreminder.php b/lib/classes/eventsmanager/notify/validationreminder.php index 26ae1ad42d..224bb5ce4f 100644 --- a/lib/classes/eventsmanager/notify/validationreminder.php +++ b/lib/classes/eventsmanager/notify/validationreminder.php @@ -156,7 +156,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra . $basket_name . ''; $ret = [ - 'text' => $this->app->trans('Rappel : Il vous reste %number% jours pour valider %title% de %user%', array('%number%' => $this->app['phraseanet.registry']->get('GV_validation_reminder'), '%title%' => $bask_link, '%user%' => $sender)) + 'text' => $this->app->trans('Rappel : Il vous reste %number% jours pour valider %title% de %user%', ['%number%' => $this->app['phraseanet.registry']->get('GV_validation_reminder'), '%title%' => $bask_link, '%user%' => $sender]) , 'class' => ($unread == 1 ? 'reload_baskets' : '') ]; diff --git a/lib/classes/module/report/activity.php b/lib/classes/module/report/activity.php index 5801c4036d..f7bd006238 100644 --- a/lib/classes/module/report/activity.php +++ b/lib/classes/module/report/activity.php @@ -313,7 +313,7 @@ class module_report_activity extends module_report $i ++; } - $this->title = $this->app->trans('report:: Telechargement effectue par l\'utilisateur %name%', array('%name%' => $login)); + $this->title = $this->app->trans('report:: Telechargement effectue par l\'utilisateur %name%', ['%name%' => $login]); $this->setResult($result); diff --git a/lib/classes/module/report/nav.php b/lib/classes/module/report/nav.php index 921889e6c8..f6ac2079db 100644 --- a/lib/classes/module/report/nav.php +++ b/lib/classes/module/report/nav.php @@ -415,7 +415,7 @@ class module_report_nav extends module_report $filter_id_apbox = $filter_id_datbox = []; $conn = $this->app['phraseanet.appbox']->get_connection(); - $this->title = $this->app->trans('report:: Information sur les utilisateurs correspondant a %critere%', array('%critere%' => $val)); + $this->title = $this->app->trans('report:: Information sur les utilisateurs correspondant a %critere%', ['%critere%' => $val]); if ($on) { if ( ! empty($req)) { @@ -471,7 +471,7 @@ class module_report_nav extends module_report $this->app->trans('phraseanet::utilisateur inconnu') : $this->result[0]['identifiant']; - $this->title = $this->app->trans('report:: Information sur l\'utilisateur %name%', array('%name%' => $login)); + $this->title = $this->app->trans('report:: Information sur l\'utilisateur %name%', ['%name%' => $login]); } $this->calculatePages(); $this->setDisplayNav(); @@ -511,7 +511,7 @@ class module_report_nav extends module_report ]; $document = $record->get_subdef('document'); - $this->title = $this->app->trans('report:: Information sur l\'enregistrement numero %number%', array('%number%' => (int) $rid)); + $this->title = $this->app->trans('report:: Information sur l\'enregistrement numero %number%', ['%number%' => (int) $rid]); $x = $record->get_thumbnail(); $this->result[] = [ @@ -534,7 +534,7 @@ class module_report_nav extends module_report public function buildTabInfoNav($tab = false, $navigator) { $conn = connection::getPDOConnection($this->app, $this->sbas_id); - $this->title = $this->app->trans('report:: Information sur le navigateur %name%', array('%name%' => $navigator)); + $this->title = $this->app->trans('report:: Information sur le navigateur %name%', ['%name%' => $navigator]); $sqlBuilder = new module_report_sql($this->app, $this); $filter = $sqlBuilder->getFilters(); $report_filter = $filter->getReportFilter(); diff --git a/lib/classes/phraseadate.php b/lib/classes/phraseadate.php index c1f154c28f..a26691d410 100644 --- a/lib/classes/phraseadate.php +++ b/lib/classes/phraseadate.php @@ -104,11 +104,11 @@ class phraseadate } elseif ($diff < 120) { return $this->app->trans('phraseanet::temps:: il y a une minute'); } elseif ($diff < 3600) { - return $this->app->trans('phraseanet::temps:: il y a %quantity% minutes', array('%quantity%' => floor($diff / 60))); + return $this->app->trans('phraseanet::temps:: il y a %quantity% minutes', ['%quantity%' => floor($diff / 60)]); } elseif ($diff < 7200) { return $this->app->trans('phraseanet::temps:: il y a une heure'); } elseif ($diff < 86400) { - return $this->app->trans('phraseanet::temps:: il y a %quantity% heures', array('%quantity%' => floor($diff / 3600))); + return $this->app->trans('phraseanet::temps:: il y a %quantity% heures', ['%quantity%' => floor($diff / 3600)]); } } elseif ($dayDiff == 1) { return $this->app->trans('phraseanet::temps:: hier'); diff --git a/lib/classes/record/exportElement.php b/lib/classes/record/exportElement.php index 8af4057c30..7ee14a6e1d 100644 --- a/lib/classes/record/exportElement.php +++ b/lib/classes/record/exportElement.php @@ -130,16 +130,22 @@ class record_exportElement extends record_adapter if ($go_dl['document'] === true) { if ($this->app['acl']->get($this->app['authentication']->getUser())->is_restricted_download($this->base_id)) { $this->remain_hd --; - if ($this->remain_hd >= 0) + if ($this->remain_hd >= 0) { + $localizedLabel = $this->app->trans('document original'); $downloadable['document'] = [ 'class' => 'document', - 'label' => 'document original' + /** @Ignore */ + 'label' => $localizedLabel, ]; - } else + } + } else { + $localizedLabel = $this->app->trans('document original'); $downloadable['document'] = [ 'class' => 'document', - 'label' => 'document original' + /** @Ignore */ + 'label' => $localizedLabel ]; + } } if ($go_cmd === true) { $orderable['document'] = true; @@ -206,14 +212,19 @@ class record_exportElement extends record_adapter $xml = $this->get_caption()->serialize(caption_record::SERIALIZE_XML); if ($xml) { + $localizedLabel = $this->app->trans('caption XML'); $downloadable['caption'] = [ 'class' => 'caption', - 'label' => 'caption XML' + /** @Ignore */ + 'label' => $localizedLabel, ]; $this->add_count('caption', strlen($xml)); + + $localizedLabel = $this->app->trans('caption YAML'); $downloadable['caption-yaml'] = [ 'class' => 'caption', - 'label' => 'caption YAML' + /** @Ignore */ + 'label' => $localizedLabel, ]; $this->add_count('caption-yaml', strlen(strip_tags($xml))); } diff --git a/lib/classes/record/preview.php b/lib/classes/record/preview.php index ccd5804cf2..9ab63fa872 100644 --- a/lib/classes/record/preview.php +++ b/lib/classes/record/preview.php @@ -279,7 +279,7 @@ class record_preview extends record_adapter switch ($this->env) { case "RESULT": - $this->title .= $this->app->trans('preview:: resultat numero %number%', array('%number%' => '' . ($this->number + 1) . ' : ')); + $this->title .= $this->app->trans('preview:: resultat numero %number%', ['%number%' => '' . ($this->number + 1) . ' : ']); $this->title .= parent::get_title($highlight, $search_engine); break; case "BASK": diff --git a/lib/conf.d/_GV_template.inc b/lib/conf.d/_GV_template.inc index 6e3b7f88c8..39adc1dd6a 100644 --- a/lib/conf.d/_GV_template.inc +++ b/lib/conf.d/_GV_template.inc @@ -99,7 +99,7 @@ return call_user_func_array(function(Application $app) { 'type' => \registry::TYPE_BOOLEAN, 'name' => 'GV_captchas', 'comment' => $app->trans('Use recaptcha API'), - 'help' => $app->trans('See documentation at %website%', array('%website%' => $recaptchaDoc)), + 'help' => $app->trans('See documentation at %website%', ['%website%' => $recaptchaDoc]), 'default' => false, 'required' => true ], @@ -123,7 +123,7 @@ return call_user_func_array(function(Application $app) { 'type' => \registry::TYPE_BOOLEAN, 'name' => 'GV_youtube_api', 'comment' => $app->trans('Use youtube API'), - 'help' => $app->trans('Create API account at %website_url%, then use %callback_url% as callback URL value', array('%website_url%' => $youtube_console_url, '%callback_url%' => $youtube_callback)), + 'help' => $app->trans('Create API account at %website_url%, then use %callback_url% as callback URL value', ['%website_url%' => $youtube_console_url, '%callback_url%' => $youtube_callback]), 'default' => false, 'required' => true ], @@ -143,7 +143,7 @@ return call_user_func_array(function(Application $app) { 'type' => \registry::TYPE_STRING, 'name' => 'GV_youtube_dev_key', 'comment' => $app->trans('Youtube developer key'), - 'help' => $app->trans('See %url%', array('%url%' => $dashboard_youtube)), + 'help' => $app->trans('See %url%', ['%url%' => $dashboard_youtube]), 'default' => '' ] ] @@ -154,7 +154,7 @@ return call_user_func_array(function(Application $app) { 'type' => \registry::TYPE_BOOLEAN, 'name' => 'GV_flickr_api', 'comment' => $app->trans('Use Flickr API'), - 'help' => $app->trans('Create API account at %website_url%, then use %callback_url% as callback URL value', array('%website_url%' => $create_api_flickr, '%callback_url%' => $flickr_callback)), + 'help' => $app->trans('Create API account at %website_url%, then use %callback_url% as callback URL value', ['%website_url%' => $create_api_flickr, '%callback_url%' => $flickr_callback]), 'default' => false, 'required' => true ], @@ -178,7 +178,7 @@ return call_user_func_array(function(Application $app) { 'type' => \registry::TYPE_BOOLEAN, 'name' => 'GV_dailymotion_api', 'comment' => $app->trans('Use Dailymotion API'), - 'help' => $app->trans('Create API account at %website_url%, then use %callback_url% as callback URL value', array('%website_url%' => $create_api_dailymotion, '%callback_url%' => $dailymotion_callback)), + 'help' => $app->trans('Create API account at %website_url%, then use %callback_url% as callback URL value', ['%website_url%' => $create_api_dailymotion, '%callback_url%' => $dailymotion_callback]), 'default' => false, 'required' => true ], @@ -269,7 +269,7 @@ return call_user_func_array(function(Application $app) { 'name' => 'GV_imagine_driver', 'default' => '', 'comment' => $app->trans('Imagine driver'), - 'help' => $app->trans('See documentation at %website%', array('%website%' => $imagineDoc)), + 'help' => $app->trans('See documentation at %website%', ['%website%' => $imagineDoc]), 'available' => [ '' => 'Auto', 'gmagick' => 'GraphicsMagick', diff --git a/lib/conf.d/bases_structure.xml b/lib/conf.d/bases_structure.xml index 4a798ccbed..ee944adb23 100644 --- a/lib/conf.d/bases_structure.xml +++ b/lib/conf.d/bases_structure.xml @@ -4648,7 +4648,7 @@
- {{ 'Problèmes de connexion ?' | trans }} + {{ 'Problemes de connexion ?' | trans }}
- {{ 'Problèmes de connexion ?' | trans }} + {{ 'Problemes de connexion ?' | trans }}