' . _('publication::Voici votre fil RSS personnel. Il vous permettra d\'etre tenu au courrant des publications.')
- . '
' . _('publications::Ne le partagez pas, il est strictement confidentiel') . '
+ 'texte' => '
' . $app->trans('publication::Voici votre fil RSS personnel. Il vous permettra d\'etre tenu au courrant des publications.')
+ . '
' . $app->trans('publications::Ne le partagez pas, il est strictement confidentiel') . '
',
- 'titre' => _('publications::votre rss personnel')
+ 'titre' => $app->trans('publications::votre rss personnel')
];
return $app->json($output);
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Language.php b/lib/Alchemy/Phrasea/Controller/Prod/Language.php
index c7cee2c7e1..7395ec4c62 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Language.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Language.php
@@ -25,88 +25,88 @@ class Language implements ControllerProviderInterface
$controller->get("/", function (Application $app) {
$out = [];
- $out['thesaurusBasesChanged'] = _('prod::recherche: Attention : la liste des bases selectionnees pour la recherche a ete changee.');
- $out['confirmDel'] = _('paniers::Vous etes sur le point de supprimer ce panier. Cette action est irreversible. Souhaitez-vous continuer ?');
- $out['serverError'] = _('phraseanet::erreur: Une erreur est survenue, si ce probleme persiste, contactez le support technique');
+ $out['thesaurusBasesChanged'] = $app->trans('prod::recherche: Attention : la liste des bases selectionnees pour la recherche a ete changee.');
+ $out['confirmDel'] = $app->trans('paniers::Vous etes sur le point de supprimer ce panier. Cette action est irreversible. Souhaitez-vous continuer ?');
+ $out['serverError'] = $app->trans('phraseanet::erreur: Une erreur est survenue, si ce probleme persiste, contactez le support technique');
$out['serverName'] = $app['phraseanet.registry']->get('GV_ServerName');
- $out['serverTimeout'] = _('phraseanet::erreur: La connection au serveur Phraseanet semble etre indisponible');
- $out['serverDisconnected'] = _('phraseanet::erreur: Votre session est fermee, veuillez vous re-authentifier');
- $out['hideMessage'] = _('phraseanet::Ne plus afficher ce message');
- $out['confirmGroup'] = _('Supprimer egalement les documents rattaches a ces regroupements');
- $out['confirmDelete'] = _('reponses:: Ces enregistrements vont etre definitivement supprimes et ne pourront etre recuperes. Etes vous sur ?');
- $out['cancel'] = _('boutton::annuler');
- $out['deleteTitle'] = _('boutton::supprimer');
- $out['deleteRecords'] = _('Delete records');
- $out['edit_hetero'] = _('prod::editing valeurs heterogenes, choisir \'remplacer\', \'ajouter\' ou \'annuler\'');
- $out['confirm_abandon'] = _('prod::editing::annulation: abandonner les modification ?');
- $out['loading'] = _('phraseanet::chargement');
- $out['valider'] = _('boutton::valider');
- $out['annuler'] = _('boutton::annuler');
- $out['create'] = _('boutton::creer');
- $out['rechercher'] = _('boutton::rechercher');
- $out['renewRss'] = _('boutton::renouveller');
- $out['candeletesome'] = _('Vous n\'avez pas les droits pour supprimer certains documents');
- $out['candeletedocuments'] = _('Vous n\'avez pas les droits pour supprimer ces documents');
- $out['needTitle'] = _('Vous devez donner un titre');
- $out['newPreset'] = _('Nouveau modele');
- $out['fermer'] = _('boutton::fermer');
- $out['feed_require_fields'] = _('Vous n\'avez pas rempli tous les champ requis');
- $out['feed_require_feed'] = _('Vous n\'avez pas selectionne de fil de publication');
- $out['removeTitle'] = _('panier::Supression d\'un element d\'un reportage');
- $out['confirmRemoveReg'] = _('panier::Attention, vous etes sur le point de supprimer un element du reportage. Merci de confirmer votre action.');
- $out['advsearch_title'] = _('phraseanet::recherche avancee');
- $out['bask_rename'] = _('panier:: renommer le panier');
- $out['reg_wrong_sbas'] = _('panier:: Un reportage ne peux recevoir que des elements provenants de la base ou il est enregistre');
- $out['error'] = _('phraseanet:: Erreur');
- $out['warningDenyCgus'] = _('cgus :: Attention, si vous refuser les CGUs de cette base, vous n\'y aures plus acces');
- $out['cgusRelog'] = _('cgus :: Vous devez vous reauthentifier pour que vos parametres soient pris en compte.');
- $out['editDelMulti'] = _('edit:: Supprimer %s du champ dans les records selectionnes');
- $out['editAddMulti'] = _('edit:: Ajouter %s au champ courrant pour les records selectionnes');
- $out['editDelSimple'] = _('edit:: Supprimer %s du champ courrant');
- $out['editAddSimple'] = _('edit:: Ajouter %s au champ courrant');
- $out['cantDeletePublicOne'] = _('panier:: vous ne pouvez pas supprimer un panier public');
- $out['wrongsbas'] = _('panier:: Un reportage ne peux recevoir que des elements provenants de la base ou il est enregistre');
- $out['max_record_selected'] = _('Vous ne pouvez pas selectionner plus de 800 enregistrements');
- $out['confirmRedirectAuth'] = _('invite:: Redirection vers la zone d\'authentification, cliquez sur OK pour continuer ou annulez');
- $out['error_test_publi'] = _('Erreur : soit les parametres sont incorrects, soit le serveur distant ne repond pas');
- $out['test_publi_ok'] = _('Les parametres sont corrects, le serveur distant est operationnel');
- $out['some_not_published'] = _('Certaines publications n\'ont pu etre effectuees, verifiez vos parametres');
- $out['error_not_published'] = _('Aucune publication effectuee, verifiez vos parametres');
- $out['warning_delete_publi'] = _('Attention, en supprimant ce preregalge, vous ne pourrez plus modifier ou supprimer de publications prealablement effectues avec celui-ci');
- $out['some_required_fields'] = _('edit::certains documents possedent des champs requis non remplis. Merci de les remplir pour valider votre editing');
- $out['nodocselected'] = _('Aucun document selectionne');
- $out['sureToRemoveList'] = _('Are you sure you want to delete this list ?');
- $out['newListName'] = _('New list name ?');
- $out['listNameCannotBeEmpty'] = _('List name can not be empty');
- $out['FeedBackName'] = _('Name');
- $out['FeedBackMessage'] = _('Message');
- $out['FeedBackDuration'] = _('Time for feedback (days)');
- $out['FeedBackNameMandatory'] = _('Please provide a name for this selection.');
- $out['send'] = _('Send');
- $out['Recept'] = _('Accuse de reception');
- $out['nFieldsChanged'] = _('%d fields have been updated');
- $out['FeedBackNoUsersSelected'] = _('No users selected');
- $out['errorFileApi'] = _('An error occurred reading this file');
- $out['errorFileApiTooBig'] = _('This file is too big');
- $out['selectOneRecord'] = _('Please select one record');
- $out['onlyOneRecord'] = _('You can choose only one record');
- $out['errorAjaxRequest'] = _('An error occured, please retry');
- $out['fileBeingDownloaded'] = _('Some files are being downloaded');
- $out['warning'] = _('Attention');
- $out['browserFeatureSupport'] = _('This feature is not supported by your browser');
- $out['noActiveBasket'] = _('No active basket');
- $out['pushUserCanDownload'] = _('User can download HD');
- $out['feedbackCanContribute'] = _('User contribute to the feedback');
- $out['feedbackCanSeeOthers'] = _('User can see others choices');
- $out['forceSendDocument'] = _('Force sending of the document ?');
- $out['export'] = _('Export');
- $out['share'] = _('Share');
- $out['move'] = _('Move');
- $out['push'] = _('Push');
- $out['feedback'] = _('Feedback');
- $out['toolbox'] = _('Tool box');
- $out['print'] = _('Print');
- $out['attention'] = _('Attention !');
+ $out['serverTimeout'] = $app->trans('phraseanet::erreur: La connection au serveur Phraseanet semble etre indisponible');
+ $out['serverDisconnected'] = $app->trans('phraseanet::erreur: Votre session est fermee, veuillez vous re-authentifier');
+ $out['hideMessage'] = $app->trans('phraseanet::Ne plus afficher ce message');
+ $out['confirmGroup'] = $app->trans('Supprimer egalement les documents rattaches a ces regroupements');
+ $out['confirmDelete'] = $app->trans('reponses:: Ces enregistrements vont etre definitivement supprimes et ne pourront etre recuperes. Etes vous sur ?');
+ $out['cancel'] = $app->trans('boutton::annuler');
+ $out['deleteTitle'] = $app->trans('boutton::supprimer');
+ $out['deleteRecords'] = $app->trans('Delete records');
+ $out['edit_hetero'] = $app->trans('prod::editing valeurs heterogenes, choisir \'remplacer\', \'ajouter\' ou \'annuler\'');
+ $out['confirm_abandon'] = $app->trans('prod::editing::annulation: abandonner les modification ?');
+ $out['loading'] = $app->trans('phraseanet::chargement');
+ $out['valider'] = $app->trans('boutton::valider');
+ $out['annuler'] = $app->trans('boutton::annuler');
+ $out['create'] = $app->trans('boutton::creer');
+ $out['rechercher'] = $app->trans('boutton::rechercher');
+ $out['renewRss'] = $app->trans('boutton::renouveller');
+ $out['candeletesome'] = $app->trans('Vous n\'avez pas les droits pour supprimer certains documents');
+ $out['candeletedocuments'] = $app->trans('Vous n\'avez pas les droits pour supprimer ces documents');
+ $out['needTitle'] = $app->trans('Vous devez donner un titre');
+ $out['newPreset'] = $app->trans('Nouveau modele');
+ $out['fermer'] = $app->trans('boutton::fermer');
+ $out['feed_require_fields'] = $app->trans('Vous n\'avez pas rempli tous les champ requis');
+ $out['feed_require_feed'] = $app->trans('Vous n\'avez pas selectionne de fil de publication');
+ $out['removeTitle'] = $app->trans('panier::Supression d\'un element d\'un reportage');
+ $out['confirmRemoveReg'] = $app->trans('panier::Attention, vous etes sur le point de supprimer un element du reportage. Merci de confirmer votre action.');
+ $out['advsearch_title'] = $app->trans('phraseanet::recherche avancee');
+ $out['bask_rename'] = $app->trans('panier:: renommer le panier');
+ $out['reg_wrong_sbas'] = $app->trans('panier:: Un reportage ne peux recevoir que des elements provenants de la base ou il est enregistre');
+ $out['error'] = $app->trans('phraseanet:: Erreur');
+ $out['warningDenyCgus'] = $app->trans('cgus :: Attention, si vous refuser les CGUs de cette base, vous n\'y aures plus acces');
+ $out['cgusRelog'] = $app->trans('cgus :: Vous devez vous reauthentifier pour que vos parametres soient pris en compte.');
+ $out['editDelMulti'] = $app->trans('edit:: Supprimer %s du champ dans les records selectionnes');
+ $out['editAddMulti'] = $app->trans('edit:: Ajouter %s au champ courrant pour les records selectionnes');
+ $out['editDelSimple'] = $app->trans('edit:: Supprimer %s du champ courrant');
+ $out['editAddSimple'] = $app->trans('edit:: Ajouter %s au champ courrant');
+ $out['cantDeletePublicOne'] = $app->trans('panier:: vous ne pouvez pas supprimer un panier public');
+ $out['wrongsbas'] = $app->trans('panier:: Un reportage ne peux recevoir que des elements provenants de la base ou il est enregistre');
+ $out['max_record_selected'] = $app->trans('Vous ne pouvez pas selectionner plus de 800 enregistrements');
+ $out['confirmRedirectAuth'] = $app->trans('invite:: Redirection vers la zone d\'authentification, cliquez sur OK pour continuer ou annulez');
+ $out['error_test_publi'] = $app->trans('Erreur : soit les parametres sont incorrects, soit le serveur distant ne repond pas');
+ $out['test_publi_ok'] = $app->trans('Les parametres sont corrects, le serveur distant est operationnel');
+ $out['some_not_published'] = $app->trans('Certaines publications n\'ont pu etre effectuees, verifiez vos parametres');
+ $out['error_not_published'] = $app->trans('Aucune publication effectuee, verifiez vos parametres');
+ $out['warning_delete_publi'] = $app->trans('Attention, en supprimant ce preregalge, vous ne pourrez plus modifier ou supprimer de publications prealablement effectues avec celui-ci');
+ $out['some_required_fields'] = $app->trans('edit::certains documents possedent des champs requis non remplis. Merci de les remplir pour valider votre editing');
+ $out['nodocselected'] = $app->trans('Aucun document selectionne');
+ $out['sureToRemoveList'] = $app->trans('Are you sure you want to delete this list ?');
+ $out['newListName'] = $app->trans('New list name ?');
+ $out['listNameCannotBeEmpty'] = $app->trans('List name can not be empty');
+ $out['FeedBackName'] = $app->trans('Name');
+ $out['FeedBackMessage'] = $app->trans('Message');
+ $out['FeedBackDuration'] = $app->trans('Time for feedback (days)');
+ $out['FeedBackNameMandatory'] = $app->trans('Please provide a name for this selection.');
+ $out['send'] = $app->trans('Send');
+ $out['Recept'] = $app->trans('Accuse de reception');
+ $out['nFieldsChanged'] = $app->trans('%d fields have been updated');
+ $out['FeedBackNoUsersSelected'] = $app->trans('No users selected');
+ $out['errorFileApi'] = $app->trans('An error occurred reading this file');
+ $out['errorFileApiTooBig'] = $app->trans('This file is too big');
+ $out['selectOneRecord'] = $app->trans('Please select one record');
+ $out['onlyOneRecord'] = $app->trans('You can choose only one record');
+ $out['errorAjaxRequest'] = $app->trans('An error occured, please retry');
+ $out['fileBeingDownloaded'] = $app->trans('Some files are being downloaded');
+ $out['warning'] = $app->trans('Attention');
+ $out['browserFeatureSupport'] = $app->trans('This feature is not supported by your browser');
+ $out['noActiveBasket'] = $app->trans('No active basket');
+ $out['pushUserCanDownload'] = $app->trans('User can download HD');
+ $out['feedbackCanContribute'] = $app->trans('User contribute to the feedback');
+ $out['feedbackCanSeeOthers'] = $app->trans('User can see others choices');
+ $out['forceSendDocument'] = $app->trans('Force sending of the document ?');
+ $out['export'] = $app->trans('Export');
+ $out['share'] = $app->trans('Share');
+ $out['move'] = $app->trans('Move');
+ $out['push'] = $app->trans('Push');
+ $out['feedback'] = $app->trans('Feedback');
+ $out['toolbox'] = $app->trans('Tool box');
+ $out['print'] = $app->trans('Print');
+ $out['attention'] = $app->trans('Attention !');
return $app->json($out);
});
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php
index 1c0f709e90..4ca3427a87 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php
@@ -113,7 +113,7 @@ class Lazaret implements ControllerProviderInterface
/* @var $lazaretFile LazaretFile */
if (null === $lazaretFile) {
- $ret['message'] = _('File is not present in quarantine anymore, please refresh');
+ $ret['message'] = $app->trans('File is not present in quarantine anymore, please refresh');
return $app->json($ret);
}
@@ -157,7 +157,7 @@ class Lazaret implements ControllerProviderInterface
//Mandatory parameter
if (null === $request->request->get('bas_id')) {
- $ret['message'] = _('You must give a destination collection');
+ $ret['message'] = $app->trans('You must give a destination collection');
return $app->json($ret);
}
@@ -166,7 +166,7 @@ class Lazaret implements ControllerProviderInterface
/* @var $lazaretFile LazaretFile */
if (null === $lazaretFile) {
- $ret['message'] = _('File is not present in quarantine anymore, please refresh');
+ $ret['message'] = $app->trans('File is not present in quarantine anymore, please refresh');
return $app->json($ret);
}
@@ -246,7 +246,7 @@ class Lazaret implements ControllerProviderInterface
$ret['success'] = true;
} catch (\Exception $e) {
- $ret['message'] = _('An error occured');
+ $ret['message'] = $app->trans('An error occured');
}
try {
@@ -274,7 +274,7 @@ class Lazaret implements ControllerProviderInterface
$lazaretFile = $app['EM']->find('Alchemy\Phrasea\Model\Entities\LazaretFile', $file_id);
/* @var $lazaretFile LazaretFile */
if (null === $lazaretFile) {
- $ret['message'] = _('File is not present in quarantine anymore, please refresh');
+ $ret['message'] = $app->trans('File is not present in quarantine anymore, please refresh');
return $app->json($ret);
}
@@ -330,7 +330,7 @@ class Lazaret implements ControllerProviderInterface
$ret['success'] = true;
} catch (\Exception $e) {
$app['EM']->rollback();
- $ret['message'] = _('An error occured');
+ $ret['message'] = $app->trans('An error occured');
}
return $app->json($ret);
@@ -351,7 +351,7 @@ class Lazaret implements ControllerProviderInterface
//Mandatory parameter
if (null === $recordId = $request->request->get('record_id')) {
- $ret['message'] = _('You must give a destination record');
+ $ret['message'] = $app->trans('You must give a destination record');
return $app->json($ret);
}
@@ -360,7 +360,7 @@ class Lazaret implements ControllerProviderInterface
/* @var $lazaretFile LazaretFile */
if (null === $lazaretFile) {
- $ret['message'] = _('File is not present in quarantine anymore, please refresh');
+ $ret['message'] = $app->trans('File is not present in quarantine anymore, please refresh');
return $app->json($ret);
}
@@ -378,7 +378,7 @@ class Lazaret implements ControllerProviderInterface
}
if (!$found) {
- $ret['message'] = _('The destination record provided is not allowed');
+ $ret['message'] = $app->trans('The destination record provided is not allowed');
return $app->json($ret);
}
@@ -404,7 +404,7 @@ class Lazaret implements ControllerProviderInterface
$ret['success'] = true;
} catch (\Exception $e) {
- $ret['message'] = _('An error occured');
+ $ret['message'] = $app->trans('An error occured');
}
try {
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php
index c30b57173d..3740d109c7 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php
@@ -70,13 +70,13 @@ class MoveCollection implements ControllerProviderInterface
try {
if (null === $request->request->get('base_id')) {
- $datas['message'] = _('Missing target collection');
+ $datas['message'] = $app->trans('Missing target collection');
return $app->json($datas);
}
if (!$app['acl']->get($app['authentication']->getUser())->has_right_on_base($request->request->get('base_id'), 'canaddrecord')) {
- $datas['message'] = sprintf(_("You do not have the permission to move records to %s"), \phrasea::bas_labels($move->getBaseIdDestination(), $app));
+ $datas['message'] = $app->trans("You do not have the permission to move records to %collection%", array('%collection%', \phrasea::bas_labels($request->request->get('base_id'), $app)));
return $app->json($datas);
}
@@ -84,7 +84,7 @@ class MoveCollection implements ControllerProviderInterface
try {
$collection = \collection::get_from_base_id($app, $request->request->get('base_id'));
} catch (\Exception_Databox_CollectionNotFound $e) {
- $datas['message'] = _('Invalid target collection');
+ $datas['message'] = $app->trans('Invalid target collection');
return $app->json($datas);
}
@@ -103,12 +103,12 @@ class MoveCollection implements ControllerProviderInterface
$ret = [
'success' => true,
- 'message' => _('Records have been successfuly moved'),
+ 'message' => $app->trans('Records have been successfuly moved'),
];
} catch (\Exception $e) {
$ret = [
'success' => false,
- 'message' => _('An error occured'),
+ 'message' => $app->trans('An error occured'),
];
}
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Order.php b/lib/Alchemy/Phrasea/Controller/Prod/Order.php
index a5dc6c8694..4363669f83 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Order.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Order.php
@@ -135,7 +135,7 @@ class Order implements ControllerProviderInterface
});
if ($noAdmins) {
- $msg = _('There is no one to validate orders, please contact an administrator');
+ $msg = $app->trans('There is no one to validate orders, please contact an administrator');
}
$order->setTodo($order->getElements()->count());
@@ -154,12 +154,12 @@ class Order implements ControllerProviderInterface
}
if ($success) {
- $msg = _('The records have been properly ordered');
+ $msg = $app->trans('The records have been properly ordered');
} else {
- $msg = _('An error occured');
+ $msg = $app->trans('An error occured');
}
} else {
- $msg = _('There is no record eligible for an order');
+ $msg = $app->trans('There is no record eligible for an order');
}
if ('json' === $app['request']->getRequestFormat()) {
@@ -247,7 +247,7 @@ class Order implements ControllerProviderInterface
if (null === $basket) {
$basket = new Basket();
- $basket->setName(sprintf(_('Commande du %s'), $order->getCreatedOn()->format('Y-m-d')));
+ $basket->setName($app->trans('Commande du %date%', array('%date%' => $order->getCreatedOn()->format('Y-m-d'))));
$basket->setOwner($dest_user);
$basket->setPusher($app['authentication']->getUser());
@@ -301,7 +301,7 @@ class Order implements ControllerProviderInterface
if ('json' === $app['request']->getRequestFormat()) {
return $app->json([
'success' => $success,
- 'msg' => $success ? _('Order has been sent') : _('An error occured while sending, please retry or contact an admin if problem persists'),
+ 'msg' => $success ? $app->trans('Order has been sent') : $app->trans('An error occured while sending, please retry or contact an admin if problem persists'),
'order_id' => $order_id
]);
}
@@ -361,7 +361,7 @@ class Order implements ControllerProviderInterface
if ('json' === $app['request']->getRequestFormat()) {
return $app->json([
'success' => $success,
- 'msg' => $success ? _('Order has been denied') : _('An error occured while denying, please retry or contact an admin if problem persists'),
+ 'msg' => $success ? $app->trans('Order has been denied') : $app->trans('An error occured while denying, please retry or contact an admin if problem persists'),
'order_id' => $order_id
]);
}
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Push.php b/lib/Alchemy/Phrasea/Controller/Prod/Push.php
index fd90a1a9cc..ed389c9656 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Push.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Push.php
@@ -154,30 +154,30 @@ class Push implements ControllerProviderInterface
$ret = [
'success' => false,
- 'message' => _('Unable to send the documents')
+ 'message' => $app->trans('Unable to send the documents')
];
try {
$pusher = new RecordHelper\Push($app, $app['request']);
- $push_name = $request->request->get('name', sprintf(_('Push from %s'), $app['authentication']->getUser()->get_display_name()));
+ $push_name = $request->request->get('name', $app->trans('Push from %user%', array('%user%' => $app['authentication']->getUser()->get_display_name())));
$push_description = $request->request->get('push_description');
$receivers = $request->request->get('participants');
if (!is_array($receivers) || count($receivers) === 0) {
- throw new ControllerException(_('No receivers specified'));
+ throw new ControllerException($app->trans('No receivers specified'));
}
if (!is_array($pusher->get_elements()) || count($pusher->get_elements()) === 0) {
- throw new ControllerException(_('No elements to push'));
+ throw new ControllerException($app->trans('No elements to push'));
}
foreach ($receivers as $receiver) {
try {
$user_receiver = \User_Adapter::getInstance($receiver['usr_id'], $app);
} catch (\Exception $e) {
- throw new ControllerException(sprintf(_('Unknown user %d'), $receiver['usr_id']));
+ throw new ControllerException($app->trans('Unknown user %user_id%', array('%user_id%' => $receiver['usr_id'])));
}
$Basket = new Basket();
@@ -247,11 +247,10 @@ class Push implements ControllerProviderInterface
$app['EM']->flush();
- $message = sprintf(
- _('%1$d records have been sent to %2$d users')
- , count($pusher->get_elements())
- , count($receivers)
- );
+ $message = $app->trans('%quantity_records% records have been sent to %quantity_users% users', array(
+ '%quantity_records%' => count($pusher->get_elements()),
+ '%quantity_users%' => count($receivers),
+ ));
$ret = [
'success' => true,
@@ -269,7 +268,7 @@ class Push implements ControllerProviderInterface
$ret = [
'success' => false,
- 'message' => _('Unable to send the documents')
+ 'message' => $app->trans('Unable to send the documents')
];
$app['EM']->beginTransaction();
@@ -279,17 +278,17 @@ class Push implements ControllerProviderInterface
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
- $validation_name = $request->request->get('name', sprintf(_('Validation from %s'), $app['authentication']->getUser()->get_display_name()));
+ $validation_name = $request->request->get('name', $app->trans('Validation from %user%', array('%user%' => $app['authentication']->getUser()->get_display_name())));
$validation_description = $request->request->get('validation_description');
$participants = $request->request->get('participants');
if (!is_array($participants) || count($participants) === 0) {
- throw new ControllerException(_('No participants specified'));
+ throw new ControllerException($app->trans('No participants specified'));
}
if (!is_array($pusher->get_elements()) || count($pusher->get_elements()) === 0) {
- throw new ControllerException(_('No elements to validate'));
+ throw new ControllerException($app->trans('No elements to validate'));
}
if ($pusher->is_basket()) {
@@ -355,13 +354,13 @@ class Push implements ControllerProviderInterface
foreach ($participants as $key => $participant) {
foreach (['see_others', 'usr_id', 'agree', 'HD'] as $mandatoryparam) {
if (!array_key_exists($mandatoryparam, $participant))
- throw new ControllerException(sprintf(_('Missing mandatory parameter %s'), $mandatoryparam));
+ throw new ControllerException($app->trans('Missing mandatory parameter %parameter%', array('%parameter%' => $mandatoryparam)));
}
try {
$participant_user = \User_Adapter::getInstance($participant['usr_id'], $app);
} catch (\Exception $e) {
- throw new ControllerException(sprintf(_('Unknown user %d'), $receiver['usr_id']));
+ throw new ControllerException($app->trans('Unknown user %usr_id%', array('%usr_id%' => $participant['usr_id'])));
}
try {
@@ -446,11 +445,10 @@ class Push implements ControllerProviderInterface
$app['EM']->flush();
- $message = sprintf(
- _('%1$d records have been sent for validation to %2$d users')
- , count($pusher->get_elements())
- , count($request->request->get('participants'))
- );
+ $message = $app->trans('%quantity_records% records have been sent for validation to %quantity_users% users', array(
+ '%quantity_records%' => count($pusher->get_elements()),
+ '%quantity_users%' => count($request->request->get('participants')),
+ ));
$ret = [
'success' => true,
@@ -511,19 +509,19 @@ class Push implements ControllerProviderInterface
try {
if (!$app['acl']->get($app['authentication']->getUser())->has_right('manageusers'))
- throw new ControllerException(_('You are not allowed to add users'));
+ throw new ControllerException($app->trans('You are not allowed to add users'));
if (!$request->request->get('firstname'))
- throw new ControllerException(_('First name is required'));
+ throw new ControllerException($app->trans('First name is required'));
if (!$request->request->get('lastname'))
- throw new ControllerException(_('Last name is required'));
+ throw new ControllerException($app->trans('Last name is required'));
if (!$request->request->get('email'))
- throw new ControllerException(_('Email is required'));
+ throw new ControllerException($app->trans('Email is required'));
if (!\Swift_Validate::email($request->request->get('email')))
- throw new ControllerException(_('Email is invalid'));
+ throw new ControllerException($app->trans('Email is invalid'));
} catch (ControllerException $e) {
$result['message'] = $e->getMessage();
@@ -537,7 +535,7 @@ class Push implements ControllerProviderInterface
$usr_id = \User_Adapter::get_usr_id_from_email($app, $email);
$user = \User_Adapter::getInstance($usr_id, $app);
- $result['message'] = _('User already exists');
+ $result['message'] = $app->trans('User already exists');
$result['success'] = true;
$result['user'] = $userFormatter($user);
} catch (\Exception $e) {
@@ -560,11 +558,11 @@ class Push implements ControllerProviderInterface
if ($request->request->get('form_geonameid'))
$user->set_geonameid($request->request->get('form_geonameid'));
- $result['message'] = _('User successfully created');
+ $result['message'] = $app->trans('User successfully created');
$result['success'] = true;
$result['user'] = $userFormatter($user);
} catch (\Exception $e) {
- $result['message'] = _('Error while creating user');
+ $result['message'] = $app->trans('Error while creating user');
}
}
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Query.php b/lib/Alchemy/Phrasea/Controller/Prod/Query.php
index c49c8c8e2a..01c4cdb0b6 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Query.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Query.php
@@ -153,16 +153,16 @@ class Query implements ControllerProviderInterface
$explain .= "";
if ($result->getTotal() != $result->getAvailable()) {
- $explain .= sprintf(_('reponses:: %d Resultats rappatries sur un total de %d trouves'), $result->getAvailable(), $result->getTotal());
+ $explain .= $app->trans('reponses:: %available% Resultats rappatries sur un total de %total% trouves', array('available' => $result->getAvailable(), '%total%' => $result->getTotal()));
} else {
- $explain .= sprintf(_('reponses:: %d Resultats'), $result->getTotal());
+ $explain .= $app->trans('reponses:: %total% Resultats', array('%total%' => $result->getTotal()));
}
$explain .= " ";
$explain .= '
' . $result->getDuration() . ' s
dans index ' . $result->getIndexes();
$explain .= "";
- $infoResult = '' . sprintf(_('reponses:: %d reponses'), $result->getTotal()) . ' | ' . sprintf(_('reponses:: %s documents selectionnes'), '');
+ $infoResult = '' . $app->trans('reponses:: %total% reponses', array('%total%' => $result->getTotal())) . ' | ' . $app->trans('reponses:: %number% documents selectionnes', array('%number%' => ''));
$json['infos'] = $infoResult;
$json['navigation'] = $string;
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Root.php b/lib/Alchemy/Phrasea/Controller/Prod/Root.php
index 63cf73e046..f956336a56 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Root.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Root.php
@@ -77,7 +77,7 @@ class Root implements ControllerProviderInterface
$queries_topics = '';
if ($app['phraseanet.registry']->get('GV_client_render_topics') == 'popups') {
- $queries_topics = \queries::dropdown_topics($app['locale.I18n']);
+ $queries_topics = \queries::dropdown_topics($app['translator'], $app['locale.I18n']);
} elseif ($app['phraseanet.registry']->get('GV_client_render_topics') == 'tree') {
$queries_topics = \queries::tree_topics($app['locale.I18n']);
}
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Story.php b/lib/Alchemy/Phrasea/Controller/Prod/Story.php
index 33b008cf99..66b0ddfaed 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Story.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Story.php
@@ -87,7 +87,7 @@ class Story implements ControllerProviderInterface
if ($request->getRequestFormat() == 'json') {
$data = [
'success' => true
- , 'message' => _('Story created')
+ , 'message' => $app->trans('Story created')
, 'WorkZone' => $StoryWZ->getId()
, 'story' => [
'sbas_id' => $Story->get_sbas_id(),
@@ -136,7 +136,7 @@ class Story implements ControllerProviderInterface
$data = [
'success' => true
- , 'message' => sprintf(_('%d records added'), $n)
+ , 'message' => $app->trans('%quantity% records added', array('%quantity%' => $n))
];
if ($request->getRequestFormat() == 'json') {
@@ -158,7 +158,7 @@ class Story implements ControllerProviderInterface
$data = [
'success' => true
- , 'message' => _('Record removed from story')
+ , 'message' => $app->trans('Record removed from story')
];
if ($request->getRequestFormat() == 'json') {
@@ -195,7 +195,7 @@ class Story implements ControllerProviderInterface
->assert('record_id', '\d+');
$controllers->post('/{sbas_id}/{record_id}/reorder/', function (Application $app, $sbas_id, $record_id) {
- $ret = ['success' => false, 'message' => _('An error occured')];
+ $ret = ['success' => false, 'message' => $app->trans('An error occured')];
try {
$story = new \record_adapter($app, $sbas_id, $record_id);
@@ -205,7 +205,7 @@ class Story implements ControllerProviderInterface
}
if (!$app['acl']->get($app['authentication']->getUser())->has_right_on_base($story->get_base_id(), 'canmodifrecord')) {
- throw new ControllerException(_('You can not edit this story'));
+ throw new ControllerException($app->trans('You can not edit this story'));
}
$sql = 'UPDATE regroup SET ord = :ord
@@ -223,7 +223,7 @@ class Story implements ControllerProviderInterface
$stmt->closeCursor();
- $ret = ['success' => true, 'message' => _('Story updated')];
+ $ret = ['success' => true, 'message' => $app->trans('Story updated')];
} catch (ControllerException $e) {
$ret = ['success' => false, 'message' => $e->getMessage()];
} catch (\Exception $e) {
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/TOU.php b/lib/Alchemy/Phrasea/Controller/Prod/TOU.php
index 1ce737297a..cb4fbf994e 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/TOU.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/TOU.php
@@ -95,7 +95,7 @@ class TOU implements ControllerProviderInterface
return new Response($app['twig']->render('/prod/TOU.html.twig', [
'TOUs' => $data,
- 'local_title' => _('Terms of use')
+ 'local_title' => $app->trans('Terms of use')
]));
}
}
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php
index 81eb24243d..e67c51e741 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php
@@ -111,7 +111,7 @@ class Tools implements ControllerProviderInterface
$controllers->post('/hddoc/', function (Application $app, Request $request) {
$success = false;
- $message = _('An error occured');
+ $message = $app->trans('An error occured');
if ($file = $request->files->get('newHD')) {
@@ -153,12 +153,12 @@ class Tools implements ControllerProviderInterface
unlink($tempoFile);
rmdir($tempoDir);
$success = true;
- $message = _('Document has been successfully substitued');
+ $message = $app->trans('Document has been successfully substitued');
} catch (\Exception $e) {
- $message = _('file is not valid');
+ $message = $app->trans('file is not valid');
}
} else {
- $message = _('file is not valid');
+ $message = $app->trans('file is not valid');
}
} else {
$app->abort(400, 'Missing file parameter');
@@ -172,7 +172,7 @@ class Tools implements ControllerProviderInterface
$controllers->post('/chgthumb/', function (Application $app, Request $request) {
$success = false;
- $message = _('An error occured');
+ $message = $app->trans('An error occured');
if ($file = $request->files->get('newThumb')) {
@@ -207,12 +207,12 @@ class Tools implements ControllerProviderInterface
unlink($tempoFile);
rmdir($tempoDir);
$success = true;
- $message = _('Thumbnail has been successfully substitued');
+ $message = $app->trans('Thumbnail has been successfully substitued');
} catch (\Exception $e) {
- $message = _('file is not valid');
+ $message = $app->trans('file is not valid');
}
} else {
- $message = _('file is not valid');
+ $message = $app->trans('file is not valid');
}
} else {
$app->abort(400, 'Missing file parameter');
@@ -236,7 +236,7 @@ class Tools implements ControllerProviderInterface
];
$return['datas'] = $app['twig']->render($template, $var);
} catch (\Exception $e) {
- $return['datas'] = _('an error occured');
+ $return['datas'] = $app->trans('an error occured');
$return['error'] = true;
}
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Upload.php b/lib/Alchemy/Phrasea/Controller/Prod/Upload.php
index aeb1e6dd95..607ba7d6fb 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Upload.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Upload.php
@@ -180,10 +180,10 @@ class Upload implements ControllerProviderInterface
$reasons = [];
$elementCreated = null;
- $callback = function ($element, $visa, $code) use (&$reasons, &$elementCreated) {
+ $callback = function ($element, $visa, $code) use ($app, &$reasons, &$elementCreated) {
foreach ($visa->getResponses() as $response) {
if (!$response->isOk()) {
- $reasons[] = $response->getMessage();
+ $reasons[] = $response->getMessage($app['translator']);
}
}
@@ -203,7 +203,7 @@ class Upload implements ControllerProviderInterface
if ($elementCreated instanceof \record_adapter) {
$id = $elementCreated->get_serialize_key();
$element = 'record';
- $message = _('The record was successfully created');
+ $message = $app->trans('The record was successfully created');
$app['phraseanet.SE']->addRecord($elementCreated);
// try to create thumbnail from data URI
@@ -235,7 +235,7 @@ class Upload implements ControllerProviderInterface
$id = $elementCreated->getId();
$element = 'lazaret';
- $message = _('The file was moved to the quarantine');
+ $message = $app->trans('The file was moved to the quarantine');
}
$datas = [
@@ -247,7 +247,7 @@ class Upload implements ControllerProviderInterface
'id' => $id,
];
} catch (\Exception $e) {
- $datas['message'] = _('Unable to add file to Phraseanet');
+ $datas['message'] = $app->trans('Unable to add file to Phraseanet');
}
$response = $app->json($datas);
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php b/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php
index b1cff393ed..0df6380246 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php
@@ -153,13 +153,13 @@ class UsrLists implements ControllerProviderInterface
$datas = [
'success' => false
- , 'message' => sprintf(_('Unable to create list %s'), $list_name)
+ , 'message' => $app->trans('Unable to create list %name%', array('%name%' => $list_name))
, 'list_id' => null
];
try {
if (!$list_name) {
- throw new ControllerException(_('List name is required'));
+ throw new ControllerException($app->trans('List name is required'));
}
$List = new UsrList();
@@ -178,7 +178,7 @@ class UsrLists implements ControllerProviderInterface
$datas = [
'success' => true
- , 'message' => sprintf(_('List %s has been created'), $list_name)
+ , 'message' => $app->trans('List %name% has been created', array('%name%' => $list_name))
, 'list_id' => $List->getId()
];
} catch (ControllerException $e) {
@@ -243,14 +243,14 @@ class UsrLists implements ControllerProviderInterface
$datas = [
'success' => false
- , 'message' => _('Unable to update list')
+ , 'message' => $app->trans('Unable to update list')
];
try {
$list_name = $request->request->get('name');
if (!$list_name) {
- throw new ControllerException(_('List name is required'));
+ throw new ControllerException($app->trans('List name is required'));
}
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
@@ -258,7 +258,7 @@ class UsrLists implements ControllerProviderInterface
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
if ($list->getOwner($app['authentication']->getUser(), $app)->getRole() < UsrListOwner::ROLE_EDITOR) {
- throw new ControllerException(_('You are not authorized to do this'));
+ throw new ControllerException($app->trans('You are not authorized to do this'));
}
$list->setName($list_name);
@@ -267,7 +267,7 @@ class UsrLists implements ControllerProviderInterface
$datas = [
'success' => true
- , 'message' => _('List has been updated')
+ , 'message' => $app->trans('List has been updated')
];
} catch (ControllerException $e) {
$datas = [
@@ -289,7 +289,7 @@ class UsrLists implements ControllerProviderInterface
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
if ($list->getOwner($app['authentication']->getUser(), $app)->getRole() < UsrListOwner::ROLE_ADMIN) {
- throw new ControllerException(_('You are not authorized to do this'));
+ throw new ControllerException($app->trans('You are not authorized to do this'));
}
$app['EM']->remove($list);
@@ -297,7 +297,7 @@ class UsrLists implements ControllerProviderInterface
$datas = [
'success' => true
- , 'message' => sprintf(_('List has been deleted'))
+ , 'message' => $app->trans('List has been deleted')
];
} catch (ControllerException $e) {
$datas = [
@@ -308,7 +308,7 @@ class UsrLists implements ControllerProviderInterface
$datas = [
'success' => false
- , 'message' => sprintf(_('Unable to delete list'))
+ , 'message' => $app->trans('Unable to delete list')
];
}
@@ -324,7 +324,7 @@ class UsrLists implements ControllerProviderInterface
/* @var $list UsrList */
if ($list->getOwner($app['authentication']->getUser(), $app)->getRole() < UsrListOwner::ROLE_EDITOR) {
- throw new ControllerException(_('You are not authorized to do this'));
+ throw new ControllerException($app->trans('You are not authorized to do this'));
}
$entry_repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrListEntry');
@@ -336,7 +336,7 @@ class UsrLists implements ControllerProviderInterface
$datas = [
'success' => true
- , 'message' => _('Entry removed from list')
+ , 'message' => $app->trans('Entry removed from list')
];
} catch (ControllerException $e) {
$datas = [
@@ -344,10 +344,9 @@ class UsrLists implements ControllerProviderInterface
, 'message' => $e->getMessage()
];
} catch (\Exception $e) {
-
$datas = [
- 'success' => false
- , 'message' => _('Unable to remove entry from list ' . $e->getMessage())
+ 'success' => false,
+ 'message' => $app->trans('Unable to remove entry from list'),
];
}
@@ -367,7 +366,7 @@ class UsrLists implements ControllerProviderInterface
/* @var $list UsrList */
if ($list->getOwner($app['authentication']->getUser(), $app)->getRole() < UsrListOwner::ROLE_EDITOR) {
- throw new ControllerException(_('You are not authorized to do this'));
+ throw new ControllerException($app->trans('You are not authorized to do this'));
}
$inserted_usr_ids = [];
@@ -394,13 +393,13 @@ class UsrLists implements ControllerProviderInterface
if (count($inserted_usr_ids) > 1) {
$datas = [
'success' => true
- , 'message' => sprintf(_('%d Users added to list'), count($inserted_usr_ids))
+ , 'message' => $app->trans('%quantity% Users added to list', array('%quantity%' => count($inserted_usr_ids)))
, 'result' => $inserted_usr_ids
];
} else {
$datas = [
'success' => true
- , 'message' => sprintf(_('%d User added to list'), count($inserted_usr_ids))
+ , 'message' => $app->trans('%quantity% User added to list', array('%quantity%' => count($inserted_usr_ids)))
, 'result' => $inserted_usr_ids
];
}
@@ -413,7 +412,7 @@ class UsrLists implements ControllerProviderInterface
$datas = [
'success' => false
- , 'message' => _('Unable to add usr to list')
+ , 'message' => $app->trans('Unable to add usr to list')
];
}
@@ -432,7 +431,7 @@ class UsrLists implements ControllerProviderInterface
if ($list->getOwner($app['authentication']->getUser(), $app)->getRole() < UsrListOwner::ROLE_ADMIN) {
$list = null;
- throw new \Exception(_('You are not authorized to do this'));
+ throw new \Exception($app->trans('You are not authorized to do this'));
}
} catch (\Exception $e) {
@@ -461,7 +460,7 @@ class UsrLists implements ControllerProviderInterface
/* @var $list UsrList */
if ($list->getOwner($app['authentication']->getUser(), $app)->getRole() < UsrListOwner::ROLE_EDITOR) {
- throw new ControllerException(_('You are not authorized to do this'));
+ throw new ControllerException($app->trans('You are not authorized to do this'));
}
$new_owner = \User_Adapter::getInstance($usr_id, $app);
@@ -490,7 +489,7 @@ class UsrLists implements ControllerProviderInterface
$datas = [
'success' => true
- , 'message' => _('List shared to user')
+ , 'message' => $app->trans('List shared to user')
];
} catch (ControllerException $e) {
$datas = [
@@ -501,7 +500,7 @@ class UsrLists implements ControllerProviderInterface
$datas = [
'success' => false
- , 'message' => _('Unable to share the list with the usr')
+ , 'message' => $app->trans('Unable to share the list with the usr')
];
}
@@ -517,7 +516,7 @@ class UsrLists implements ControllerProviderInterface
/* @var $list UsrList */
if ($list->getOwner($app['authentication']->getUser(), $app)->getRole() < UsrListOwner::ROLE_ADMIN) {
- throw new \Exception(_('You are not authorized to do this'));
+ throw new \Exception($app->trans('You are not authorized to do this'));
}
$owners_repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrListOwner');
@@ -529,7 +528,7 @@ class UsrLists implements ControllerProviderInterface
$datas = [
'success' => true
- , 'message' => _('Owner removed from list')
+ , 'message' => $app->trans('Owner removed from list')
];
} catch (ControllerException $e) {
$datas = [
@@ -539,7 +538,7 @@ class UsrLists implements ControllerProviderInterface
} catch (\Exception $e) {
$datas = [
'success' => false
- , 'message' => _('Unable to remove usr from list')
+ , 'message' => $app->trans('Unable to remove usr from list')
];
}
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php b/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php
index 14cd04cc29..7c531c8e4c 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php
@@ -158,29 +158,15 @@ class WorkZone implements ControllerProviderInterface
if ($alreadyFixed === 0) {
if ($done <= 1) {
- $message = sprintf(
- _('%d Story attached to the WorkZone')
- , $done
- );
+ $message = $app->trans('%quantity% Story attached to the WorkZone', array('%quantity%' => $done));
} else {
- $message = sprintf(
- _('%d Stories attached to the WorkZone')
- , $done
- );
+ $message = $app->trans('%quantity% Stories attached to the WorkZone', array('%quantity%' => $done));
}
} else {
if ($done <= 1) {
- $message = sprintf(
- _('%1$d Story attached to the WorkZone, %2$d already attached')
- , $done
- , $alreadyFixed
- );
+ $message = $app->trans('%quantity% Story attached to the WorkZone, %quantity_already% already attached', array('%quantity%' => $done, '%quantity_already%' => $alreadyFixed));
} else {
- $message = sprintf(
- _('%1$d Stories attached to the WorkZone, %2$d already attached')
- , $done
- , $alreadyFixed
- );
+ $message = $app->trans('%quantity% Stories attached to the WorkZone, %quantity_already% already attached', array('%quantity%' => $done, '%quantity_already%' => $alreadyFixed));
}
}
@@ -200,7 +186,6 @@ class WorkZone implements ControllerProviderInterface
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\StoryWZ');
- /* @var $repository Alchemy\Phrasea\Model\Repositories\StoryWZRepository */
$StoryWZ = $repository->findUserStory($app, $app['authentication']->getUser(), $Story);
if (!$StoryWZ) {
@@ -213,7 +198,7 @@ class WorkZone implements ControllerProviderInterface
if ($request->getRequestFormat() == 'json') {
return $app->json([
'success' => true
- , 'message' => _('Story detached from the WorkZone')
+ , 'message' => $app->trans('Story detached from the WorkZone')
]);
}
diff --git a/lib/Alchemy/Phrasea/Controller/Report/Activity.php b/lib/Alchemy/Phrasea/Controller/Report/Activity.php
index d6ba29bd16..2260ec8d3f 100644
--- a/lib/Alchemy/Phrasea/Controller/Report/Activity.php
+++ b/lib/Alchemy/Phrasea/Controller/Report/Activity.php
@@ -134,11 +134,11 @@ class Activity implements ControllerProviderInterface
public function doReportDownloadsByUsers(Application $app, Request $request)
{
$conf = [
- 'user' => [_('report:: utilisateur'), 0, 1, 0, 0],
- 'nbdoc' => [_('report:: nombre de documents'), 0, 0, 0, 0],
- 'poiddoc' => [_('report:: poids des documents'), 0, 0, 0, 0],
- 'nbprev' => [_('report:: nombre de preview'), 0, 0, 0, 0],
- 'poidprev' => [_('report:: poids des previews'), 0, 0, 0, 0]
+ 'user' => [$app->trans('report:: utilisateur'), 0, 1, 0, 0],
+ 'nbdoc' => [$app->trans('report:: nombre de documents'), 0, 0, 0, 0],
+ 'poiddoc' => [$app->trans('report:: poids des documents'), 0, 0, 0, 0],
+ 'nbprev' => [$app->trans('report:: nombre de preview'), 0, 0, 0, 0],
+ 'poidprev' => [$app->trans('report:: poids des previews'), 0, 0, 0, 0]
];
$activity = new \module_report_activity(
@@ -198,9 +198,9 @@ class Activity implements ControllerProviderInterface
public function doReportBestOfQuestions(Application $app, Request $request)
{
$conf = [
- 'search' => [_('report:: question'), 0, 0, 0, 0],
- 'nb' => [_('report:: nombre'), 0, 0, 0, 0],
- 'nb_rep' => [_('report:: nombre de reponses'), 0, 0, 0, 0]
+ 'search' => [$app->trans('report:: question'), 0, 0, 0, 0],
+ 'nb' => [$app->trans('report:: nombre'), 0, 0, 0, 0],
+ 'nb_rep' => [$app->trans('report:: nombre de reponses'), 0, 0, 0, 0]
];
$activity = new \module_report_activity(
@@ -256,9 +256,9 @@ class Activity implements ControllerProviderInterface
public function doReportNoBestOfQuestions(Application $app, Request $request)
{
$conf = [
- 'search' => [_('report:: question'), 0, 0, 0, 0],
- 'nb' => [_('report:: nombre'), 0, 0, 0, 0],
- 'nb_rep' => [_('report:: nombre de reponses'), 0, 0, 0, 0]
+ 'search' => [$app->trans('report:: question'), 0, 0, 0, 0],
+ 'nb' => [$app->trans('report:: nombre'), 0, 0, 0, 0],
+ 'nb_rep' => [$app->trans('report:: nombre de reponses'), 0, 0, 0, 0]
];
$activity = new \module_report_activity(
@@ -369,10 +369,10 @@ class Activity implements ControllerProviderInterface
public function doReportSiteActiviyPerDays(Application $app, Request $request)
{
$conf = [
- 'ddate' => [_('report:: jour'), 0, 0, 0, 0],
- 'total' => [_('report:: total des telechargements'), 0, 0, 0, 0],
- 'preview' => [_('report:: preview'), 0, 0, 0, 0],
- 'document' => [_('report:: document original'), 0, 0, 0, 0]
+ 'ddate' => [$app->trans('report:: jour'), 0, 0, 0, 0],
+ 'total' => [$app->trans('report:: total des telechargements'), 0, 0, 0, 0],
+ 'preview' => [$app->trans('report:: preview'), 0, 0, 0, 0],
+ 'document' => [$app->trans('report:: document original'), 0, 0, 0, 0]
];
$activity = new \module_report_activity(
@@ -700,7 +700,7 @@ class Activity implements ControllerProviderInterface
'record_id' => ['', 1, 1, 1, 1],
'file' => ['', 1, 0, 1, 1],
'mime' => ['', 1, 0, 1, 1],
- 'comment' => [_('Receiver'), 1, 0, 1, 1],
+ 'comment' => [$app->trans('Receiver'), 1, 0, 1, 1],
];
$activity = new \module_report_sent(
@@ -792,7 +792,7 @@ class Activity implements ControllerProviderInterface
if ($request->request->get('conf') == 'on') {
return $app->json(['liste' => $app['twig']->render('report/listColumn.html.twig', [
'conf' => $base_conf
- ]), "title" => _("configuration")]);
+ ]), "title" => $app->trans("configuration")]);
}
//set order
@@ -819,7 +819,7 @@ class Activity implements ControllerProviderInterface
return $app->json(['diag' => $app['twig']->render('report/colFilter.html.twig', [
'result' => $report->colFilter($field),
'field' => $field
- ]), "title" => sprintf(_('filtrer les resultats sur la colonne %s'), $field)]);
+ ]), "title" => $app->trans('filtrer les resultats sur la colonne %colonne%', array('%colonne%' => $field))]);
}
if ($field === $value) {
@@ -864,7 +864,7 @@ class Activity implements ControllerProviderInterface
'is_doc' => false
]),
'display_nav' => false,
- 'title' => _(sprintf('Groupement des resultats sur le champ %s', $groupField))
+ 'title' => $app->trans('Groupement des resultats sur le champ %name%', array('%name%' => $groupField))
]);
}
diff --git a/lib/Alchemy/Phrasea/Controller/Report/Informations.php b/lib/Alchemy/Phrasea/Controller/Report/Informations.php
index 9a68ac4fa9..efd8ee88ca 100644
--- a/lib/Alchemy/Phrasea/Controller/Report/Informations.php
+++ b/lib/Alchemy/Phrasea/Controller/Report/Informations.php
@@ -52,34 +52,34 @@ class Informations implements ControllerProviderInterface
{
$conf = [
'config' => [
- 'photo' => [_('report:: document'), 0, 0, 0, 0],
- 'record_id' => [_('report:: record id'), 0, 0, 0, 0],
- 'date' => [_('report:: date'), 0, 0, 0, 0],
- 'type' => [_('phrseanet:: sous definition'), 0, 0, 0, 0],
- 'titre' => [_('report:: titre'), 0, 0, 0, 0],
- 'taille' => [_('report:: poids'), 0, 0, 0, 0]
+ 'photo' => [$app->trans('report:: document'), 0, 0, 0, 0],
+ 'record_id' => [$app->trans('report:: record id'), 0, 0, 0, 0],
+ 'date' => [$app->trans('report:: date'), 0, 0, 0, 0],
+ 'type' => [$app->trans('phrseanet:: sous definition'), 0, 0, 0, 0],
+ 'titre' => [$app->trans('report:: titre'), 0, 0, 0, 0],
+ 'taille' => [$app->trans('report:: poids'), 0, 0, 0, 0]
],
'conf' => [
- 'identifiant' => [_('report:: identifiant'), 0, 0, 0, 0],
- 'nom' => [_('report:: nom'), 0, 0, 0, 0],
- 'mail' => [_('report:: email'), 0, 0, 0, 0],
- 'adresse' => [_('report:: adresse'), 0, 0, 0, 0],
- 'tel' => [_('report:: telephone'), 0, 0, 0, 0]
+ 'identifiant' => [$app->trans('report:: identifiant'), 0, 0, 0, 0],
+ 'nom' => [$app->trans('report:: nom'), 0, 0, 0, 0],
+ 'mail' => [$app->trans('report:: email'), 0, 0, 0, 0],
+ 'adresse' => [$app->trans('report:: adresse'), 0, 0, 0, 0],
+ 'tel' => [$app->trans('report:: telephone'), 0, 0, 0, 0]
],
'config_cnx' => [
- 'ddate' => [_('report:: date'), 0, 0, 0, 0],
- 'appli' => [_('report:: modules'), 0, 0, 0, 0],
+ 'ddate' => [$app->trans('report:: date'), 0, 0, 0, 0],
+ 'appli' => [$app->trans('report:: modules'), 0, 0, 0, 0],
],
'config_dl' => [
- 'ddate' => [_('report:: date'), 0, 0, 0, 0],
- 'record_id' => [_('report:: record id'), 0, 1, 0, 0],
- 'final' => [_('phrseanet:: sous definition'), 0, 0, 0, 0],
- 'coll_id' => [_('report:: collections'), 0, 0, 0, 0],
- 'comment' => [_('report:: commentaire'), 0, 0, 0, 0],
+ 'ddate' => [$app->trans('report:: date'), 0, 0, 0, 0],
+ 'record_id' => [$app->trans('report:: record id'), 0, 1, 0, 0],
+ 'final' => [$app->trans('phrseanet:: sous definition'), 0, 0, 0, 0],
+ 'coll_id' => [$app->trans('report:: collections'), 0, 0, 0, 0],
+ 'comment' => [$app->trans('report:: commentaire'), 0, 0, 0, 0],
],
'config_ask' => [
- 'search' => [_('report:: question'), 0, 0, 0, 0],
- 'ddate' => [_('report:: date'), 0, 0, 0, 0]
+ 'search' => [$app->trans('report:: question'), 0, 0, 0, 0],
+ 'ddate' => [$app->trans('report:: date'), 0, 0, 0, 0]
]
];
@@ -96,7 +96,7 @@ class Informations implements ControllerProviderInterface
if ('' !== $on && $app['phraseanet.registry']->get('GV_anonymousReport') == true) {
$conf['conf'] = [
$on => [$on, 0, 0, 0, 0],
- 'nb' => [_('report:: nombre'), 0, 0, 0, 0]
+ 'nb' => [$app->trans('report:: nombre'), 0, 0, 0, 0]
];
}
@@ -109,7 +109,7 @@ class Informations implements ControllerProviderInterface
$request->request->get('collection'
));
$conf_array = $conf['config_cnx'];
- $title = _('report:: historique des connexions');
+ $title = $app->trans('report:: historique des connexions');
} elseif ($from == 'USR' || $from == 'GEN') {
$report = new \module_report_download(
$app,
@@ -119,7 +119,7 @@ class Informations implements ControllerProviderInterface
$request->request->get('collection')
);
$conf_array = $conf['config_dl'];
- $title = _('report:: historique des telechargements');
+ $title = $app->trans('report:: historique des telechargements');
} elseif ($from == 'ASK') {
$report = new \module_report_question(
$app,
@@ -129,7 +129,7 @@ class Informations implements ControllerProviderInterface
$request->request->get('collection')
);
$conf_array = $conf['config_ask'];
- $title = _('report:: historique des questions');
+ $title = $app->trans('report:: historique des questions');
}
if ($report) {
@@ -151,7 +151,7 @@ class Informations implements ControllerProviderInterface
return $app->json(['diag' => $app['twig']->render('report/colFilter.html.twig', [
'result' => $report->colFilter($field),
'field' => $field
- ]), 'title' => sprintf(_('filtrer les resultats sur la colonne %s'), $field)]);
+ ]), 'title' => $app->trans('filtrer les resultats sur la colonne %colonne%', array('%colonne%' => $field))]);
}
if ($field === $value) {
@@ -252,8 +252,8 @@ class Informations implements ControllerProviderInterface
public function doReportinformationsBrowser(Application $app, Request $request)
{
$conf = [
- 'version' => [_('report::version '), 0, 0, 0, 0],
- 'nb' => [_('report:: nombre'), 0, 0, 0, 0]
+ 'version' => [$app->trans('report::version'), 0, 0, 0, 0],
+ 'nb' => [$app->trans('report:: nombre'), 0, 0, 0, 0]
];
$info = new \module_report_nav(
@@ -297,24 +297,24 @@ class Informations implements ControllerProviderInterface
public function doReportInformationsDocument(Application $app, Request $request)
{
$config = [
- 'photo' => [_('report:: document'), 0, 0, 0, 0],
- 'record_id' => [_('report:: record id'), 0, 0, 0, 0],
- 'date' => [_('report:: date'), 0, 0, 0, 0],
- 'type' => [_('phrseanet:: sous definition'), 0, 0, 0, 0],
- 'titre' => [_('report:: titre'), 0, 0, 0, 0],
- 'taille' => [_('report:: poids'), 0, 0, 0, 0]
+ 'photo' => [$app->trans('report:: document'), 0, 0, 0, 0],
+ 'record_id' => [$app->trans('report:: record id'), 0, 0, 0, 0],
+ 'date' => [$app->trans('report:: date'), 0, 0, 0, 0],
+ 'type' => [$app->trans('phrseanet:: sous definition'), 0, 0, 0, 0],
+ 'titre' => [$app->trans('report:: titre'), 0, 0, 0, 0],
+ 'taille' => [$app->trans('report:: poids'), 0, 0, 0, 0]
];
$config_dl = [
- 'ddate' => [_('report:: date'), 0, 0, 0, 0],
- 'user' => [_('report:: utilisateurs'), 0, 0, 0, 0],
- 'final' => [_('phrseanet:: sous definition'), 0, 0, 0, 0],
- 'coll_id' => [_('report:: collections'), 0, 0, 0, 0],
- 'comment' => [_('report:: commentaire'), 0, 0, 0, 0],
- 'fonction' => [_('report:: fonction'), 0, 0, 0, 0],
- 'activite' => [_('report:: activite'), 0, 0, 0, 0],
- 'pays' => [_('report:: pays'), 0, 0, 0, 0],
- 'societe' => [_('report:: societe'), 0, 0, 0, 0]
+ 'ddate' => [$app->trans('report:: date'), 0, 0, 0, 0],
+ 'user' => [$app->trans('report:: utilisateurs'), 0, 0, 0, 0],
+ 'final' => [$app->trans('phrseanet:: sous definition'), 0, 0, 0, 0],
+ 'coll_id' => [$app->trans('report:: collections'), 0, 0, 0, 0],
+ 'comment' => [$app->trans('report:: commentaire'), 0, 0, 0, 0],
+ 'fonction' => [$app->trans('report:: fonction'), 0, 0, 0, 0],
+ 'activite' => [$app->trans('report:: activite'), 0, 0, 0, 0],
+ 'pays' => [$app->trans('report:: pays'), 0, 0, 0, 0],
+ 'societe' => [$app->trans('report:: societe'), 0, 0, 0, 0]
];
//format conf according user preferences
@@ -409,7 +409,7 @@ class Informations implements ControllerProviderInterface
return $app->json(['diag' => $app['twig']->render('report/colFilter.html.twig', [
'result' => $download->colFilter($field),
'field' => $field
- ]), 'title' => sprintf(_('filtrer les resultats sur la colonne %s'), $field)]);
+ ]), 'title' => $app->trans('filtrer les resultats sur la colonne %colonne%', array('%colonne%' => $field))]);
}
if ($field === $value) {
@@ -423,7 +423,7 @@ class Informations implements ControllerProviderInterface
$download->setFilter($filter->getTabFilter());
$download->setOrder('ddate', 'DESC');
- $download->setTitle(_('report:: historique des telechargements'));
+ $download->setTitle($app->trans('report:: historique des telechargements'));
$download->setConfig(false);
$reportArray = $download->buildReport($config_dl);
@@ -458,11 +458,11 @@ class Informations implements ControllerProviderInterface
if ($app['phraseanet.registry']->get('GV_anonymousReport') == false && $from !== 'DOC' && $from !== 'DASH' && $from !== 'GEN' && $from !== 'PUSHDOC') {
$conf = [
- 'identifiant' => [_('report:: identifiant'), 0, 0, 0, 0],
- 'nom' => [_('report:: nom'), 0, 0, 0, 0],
- 'mail' => [_('report:: email'), 0, 0, 0, 0],
- 'adresse' => [_('report:: adresse'), 0, 0, 0, 0],
- 'tel' => [_('report:: telephone'), 0, 0, 0, 0]
+ 'identifiant' => [$app->trans('report:: identifiant'), 0, 0, 0, 0],
+ 'nom' => [$app->trans('report:: nom'), 0, 0, 0, 0],
+ 'mail' => [$app->trans('report:: email'), 0, 0, 0, 0],
+ 'adresse' => [$app->trans('report:: adresse'), 0, 0, 0, 0],
+ 'tel' => [$app->trans('report:: telephone'), 0, 0, 0, 0]
];
$info = new \module_report_nav(
@@ -475,11 +475,11 @@ class Informations implements ControllerProviderInterface
$info->setPeriode('');
$info->setConfig(false);
- $info->setTitle(_('report:: utilisateur'));
+ $info->setTitle($app->trans('report:: utilisateur'));
$reportArray = $info->buildTabGrpInfo(false, [], $request->request->get('user'), $conf, false);
- if ($request->request->get('printcsv') == 'on') {
+ if ($request->request->get('printcsv') == 'on' && isset($download)) {
$download->setPrettyString(false);
try {
diff --git a/lib/Alchemy/Phrasea/Controller/Report/Root.php b/lib/Alchemy/Phrasea/Controller/Report/Root.php
index 8f3f818307..63167c9888 100644
--- a/lib/Alchemy/Phrasea/Controller/Report/Root.php
+++ b/lib/Alchemy/Phrasea/Controller/Report/Root.php
@@ -169,14 +169,14 @@ class Root implements ControllerProviderInterface
);
$conf = [
- 'user' => [_('phraseanet::utilisateurs'), 1, 1, 1, 1],
- 'ddate' => [_('report:: date'), 1, 0, 1, 1],
- 'ip' => [_('report:: IP'), 1, 0, 0, 0],
- 'appli' => [_('report:: modules'), 1, 0, 0, 0],
- 'fonction' => [_('report::fonction'), 1, 1, 1, 1],
- 'activite' => [_('report::activite'), 1, 1, 1, 1],
- 'pays' => [_('report::pays'), 1, 1, 1, 1],
- 'societe' => [_('report::societe'), 1, 1, 1, 1]
+ 'user' => [$app->trans('phraseanet::utilisateurs'), 1, 1, 1, 1],
+ 'ddate' => [$app->trans('report:: date'), 1, 0, 1, 1],
+ 'ip' => [$app->trans('report:: IP'), 1, 0, 0, 0],
+ 'appli' => [$app->trans('report:: modules'), 1, 0, 0, 0],
+ 'fonction' => [$app->trans('report::fonction'), 1, 1, 1, 1],
+ 'activite' => [$app->trans('report::activite'), 1, 1, 1, 1],
+ 'pays' => [$app->trans('report::pays'), 1, 1, 1, 1],
+ 'societe' => [$app->trans('report::societe'), 1, 1, 1, 1]
];
if ($request->request->get('printcsv') == 'on') {
@@ -235,13 +235,13 @@ class Root implements ControllerProviderInterface
);
$conf = [
- 'user' => [_('report:: utilisateur'), 1, 1, 1, 1],
- 'search' => [_('report:: question'), 1, 0, 1, 1],
- 'ddate' => [_('report:: date'), 1, 0, 1, 1],
- 'fonction' => [_('report:: fonction'), 1, 1, 1, 1],
- 'activite' => [_('report:: activite'), 1, 1, 1, 1],
- 'pays' => [_('report:: pays'), 1, 1, 1, 1],
- 'societe' => [_('report:: societe'), 1, 1, 1, 1]
+ 'user' => [$app->trans('report:: utilisateur'), 1, 1, 1, 1],
+ 'search' => [$app->trans('report:: question'), 1, 0, 1, 1],
+ 'ddate' => [$app->trans('report:: date'), 1, 0, 1, 1],
+ 'fonction' => [$app->trans('report:: fonction'), 1, 1, 1, 1],
+ 'activite' => [$app->trans('report:: activite'), 1, 1, 1, 1],
+ 'pays' => [$app->trans('report:: pays'), 1, 1, 1, 1],
+ 'societe' => [$app->trans('report:: societe'), 1, 1, 1, 1]
];
if ($request->request->get('printcsv') == 'on') {
@@ -306,16 +306,16 @@ class Root implements ControllerProviderInterface
}
$conf = array_merge([
- 'user' => [_('report:: utilisateurs'), 1, 1, 1, 1],
- 'ddate' => [_('report:: date'), 1, 0, 1, 1],
- 'record_id' => [_('report:: record id'), 1, 1, 1, 1],
- 'final' => [_('phrseanet:: sous definition'), 1, 0, 1, 1],
- 'coll_id' => [_('report:: collections'), 1, 0, 1, 1],
- 'comment' => [_('report:: commentaire'), 1, 0, 0, 0],
- 'fonction' => [_('report:: fonction'), 1, 1, 1, 1],
- 'activite' => [_('report:: activite'), 1, 1, 1, 1],
- 'pays' => [_('report:: pays'), 1, 1, 1, 1],
- 'societe' => [_('report:: societe'), 1, 1, 1, 1]
+ 'user' => [$app->trans('report:: utilisateurs'), 1, 1, 1, 1],
+ 'ddate' => [$app->trans('report:: date'), 1, 0, 1, 1],
+ 'record_id' => [$app->trans('report:: record id'), 1, 1, 1, 1],
+ 'final' => [$app->trans('phrseanet:: sous definition'), 1, 0, 1, 1],
+ 'coll_id' => [$app->trans('report:: collections'), 1, 0, 1, 1],
+ 'comment' => [$app->trans('report:: commentaire'), 1, 0, 0, 0],
+ 'fonction' => [$app->trans('report:: fonction'), 1, 1, 1, 1],
+ 'activite' => [$app->trans('report:: activite'), 1, 1, 1, 1],
+ 'pays' => [$app->trans('report:: pays'), 1, 1, 1, 1],
+ 'societe' => [$app->trans('report:: societe'), 1, 1, 1, 1]
], $conf_pref);
if ($request->request->get('printcsv') == 'on') {
@@ -380,12 +380,12 @@ class Root implements ControllerProviderInterface
}
$conf = array_merge([
- 'telechargement' => [_('report:: telechargements'), 1, 0, 0, 0],
- 'record_id' => [_('report:: record id'), 1, 1, 1, 0],
- 'final' => [_('phraseanet:: sous definition'), 1, 0, 1, 1],
- 'file' => [_('report:: fichier'), 1, 0, 0, 1],
- 'mime' => [_('report:: type'), 1, 0, 1, 1],
- 'size' => [_('report:: taille'), 1, 0, 1, 1]
+ 'telechargement' => [$app->trans('report:: telechargements'), 1, 0, 0, 0],
+ 'record_id' => [$app->trans('report:: record id'), 1, 1, 1, 0],
+ 'final' => [$app->trans('phraseanet:: sous definition'), 1, 0, 1, 1],
+ 'file' => [$app->trans('report:: fichier'), 1, 0, 0, 1],
+ 'mime' => [$app->trans('report:: type'), 1, 0, 1, 1],
+ 'size' => [$app->trans('report:: taille'), 1, 0, 1, 1]
], $conf_pref);
if ($request->request->get('printcsv') == 'on') {
@@ -444,30 +444,30 @@ class Root implements ControllerProviderInterface
);
$conf_nav = [
- 'nav' => [_('report:: navigateur'), 0, 1, 0, 0],
- 'nb' => [_('report:: nombre'), 0, 0, 0, 0],
- 'pourcent' => [_('report:: pourcentage'), 0, 0, 0, 0]
+ 'nav' => [$app->trans('report:: navigateur'), 0, 1, 0, 0],
+ 'nb' => [$app->trans('report:: nombre'), 0, 0, 0, 0],
+ 'pourcent' => [$app->trans('report:: pourcentage'), 0, 0, 0, 0]
];
$conf_combo = [
- 'combo' => [_('report:: navigateurs et plateforme'), 0, 0, 0, 0],
- 'nb' => [_('report:: nombre'), 0, 0, 0, 0],
- 'pourcent' => [_('report:: pourcentage'), 0, 0, 0, 0]
+ 'combo' => [$app->trans('report:: navigateurs et plateforme'), 0, 0, 0, 0],
+ 'nb' => [$app->trans('report:: nombre'), 0, 0, 0, 0],
+ 'pourcent' => [$app->trans('report:: pourcentage'), 0, 0, 0, 0]
];
$conf_os = [
- 'os' => [_('report:: plateforme'), 0, 0, 0, 0],
- 'nb' => [_('report:: nombre'), 0, 0, 0, 0],
- 'pourcent' => [_('report:: pourcentage'), 0, 0, 0, 0]
+ 'os' => [$app->trans('report:: plateforme'), 0, 0, 0, 0],
+ 'nb' => [$app->trans('report:: nombre'), 0, 0, 0, 0],
+ 'pourcent' => [$app->trans('report:: pourcentage'), 0, 0, 0, 0]
];
$conf_res = [
- 'res' => [_('report:: resolution'), 0, 0, 0, 0],
- 'nb' => [_('report:: nombre'), 0, 0, 0, 0],
- 'pourcent' => [_('report:: pourcentage'), 0, 0, 0, 0]
+ 'res' => [$app->trans('report:: resolution'), 0, 0, 0, 0],
+ 'nb' => [$app->trans('report:: nombre'), 0, 0, 0, 0],
+ 'pourcent' => [$app->trans('report:: pourcentage'), 0, 0, 0, 0]
];
$conf_mod = [
- 'appli' => [_('report:: module'), 0, 0, 0, 0],
- 'nb' => [_('report:: nombre'), 0, 0, 0, 0],
- 'pourcent' => [_('report:: pourcentage'), 0, 0, 0, 0]
+ 'appli' => [$app->trans('report:: module'), 0, 0, 0, 0],
+ 'nb' => [$app->trans('report:: nombre'), 0, 0, 0, 0],
+ 'pourcent' => [$app->trans('report:: pourcentage'), 0, 0, 0, 0]
];
$report = [
@@ -543,7 +543,7 @@ class Root implements ControllerProviderInterface
if ($request->request->get('conf') == 'on') {
return $app->json(['liste' => $app['twig']->render('report/listColumn.html.twig', [
'conf' => $base_conf
- ]), 'title' => _('configuration')]);
+ ]), 'title' => $app->trans('configuration')]);
}
//set order
@@ -570,7 +570,7 @@ class Root implements ControllerProviderInterface
return $app->json(['diag' => $app['twig']->render('report/colFilter.html.twig', [
'result' => $report->colFilter($field),
'field' => $field
- ]), 'title' => sprintf(_('filtrer les resultats sur la colonne %s'), $field)]);
+ ]), 'title' => $app->trans('filtrer les resultats sur la colonne %colonne%', array('%colonne%' => $field))]);
}
if ($field === $value) {
@@ -615,7 +615,7 @@ class Root implements ControllerProviderInterface
'is_doc' => false
]),
'display_nav' => false,
- 'title' => _(sprintf('Groupement des resultats sur le champ %s', $groupField))
+ 'title' => $app->trans('Groupement des resultats sur le champ %name%', array('%name%' => $groupField))
]);
}
diff --git a/lib/Alchemy/Phrasea/Controller/Root/Account.php b/lib/Alchemy/Phrasea/Controller/Root/Account.php
index 492eeeab5a..d63c7ef4a0 100644
--- a/lib/Alchemy/Phrasea/Controller/Root/Account.php
+++ b/lib/Alchemy/Phrasea/Controller/Root/Account.php
@@ -97,11 +97,11 @@ class Account implements ControllerProviderInterface
if ($app['auth.password-encoder']->isPasswordValid($user->get_password(), $data['oldPassword'], $user->get_nonce())) {
$user->set_password($data['password']);
- $app->addFlash('success', _('login::notification: Mise a jour du mot de passe avec succes'));
+ $app->addFlash('success', $app->trans('login::notification: Mise a jour du mot de passe avec succes'));
return $app->redirectPath('account');
} else {
- $app->addFlash('error', _('Invalid password provided'));
+ $app->addFlash('error', $app->trans('Invalid password provided'));
}
}
}
@@ -123,25 +123,25 @@ class Account implements ControllerProviderInterface
{
if (null === ($password = $request->request->get('form_password')) || null === ($email = $request->request->get('form_email')) || null === ($emailConfirm = $request->request->get('form_email_confirm'))) {
- $app->abort(400, _('Could not perform request, please contact an administrator.'));
+ $app->abort(400, $app->trans('Could not perform request, please contact an administrator.'));
}
$user = $app['authentication']->getUser();
if (!$app['auth.password-encoder']->isPasswordValid($user->get_password(), $password, $user->get_nonce())) {
- $app->addFlash('error', _('admin::compte-utilisateur:ftp: Le mot de passe est errone'));
+ $app->addFlash('error', $app->trans('admin::compte-utilisateur:ftp: Le mot de passe est errone'));
return $app->redirectPath('account_reset_email');
}
if (!\Swift_Validate::email($email)) {
- $app->addFlash('error', _('forms::l\'email semble invalide'));
+ $app->addFlash('error', $app->trans('forms::l\'email semble invalide'));
return $app->redirectPath('account_reset_email');
}
if ($email !== $emailConfirm) {
- $app->addFlash('error', _('forms::les emails ne correspondent pas'));
+ $app->addFlash('error', $app->trans('forms::les emails ne correspondent pas'));
return $app->redirectPath('account_reset_email');
}
@@ -153,7 +153,7 @@ class Account implements ControllerProviderInterface
try {
$receiver = Receiver::fromUser($app['authentication']->getUser());
} catch (InvalidArgumentException $e) {
- $app->addFlash('error', _('phraseanet::erreur: echec du serveur de mail'));
+ $app->addFlash('error', $app->trans('phraseanet::erreur: echec du serveur de mail'));
return $app->redirectPath('account_reset_email');
}
@@ -164,7 +164,7 @@ class Account implements ControllerProviderInterface
$app['notification.deliverer']->deliver($mail);
- $app->addFlash('info', _('admin::compte-utilisateur un email de confirmation vient de vous etre envoye. Veuillez suivre les instructions contenue pour continuer'));
+ $app->addFlash('info', $app->trans('admin::compte-utilisateur un email de confirmation vient de vous etre envoye. Veuillez suivre les instructions contenue pour continuer'));
return $app->redirectPath('account');
}
@@ -185,11 +185,11 @@ class Account implements ControllerProviderInterface
$user->set_email($datas['datas']);
$app['tokens']->removeToken($token);
- $app->addFlash('success', _('admin::compte-utilisateur: L\'email a correctement ete mis a jour'));
+ $app->addFlash('success', $app->trans('admin::compte-utilisateur: L\'email a correctement ete mis a jour'));
return $app->redirectPath('account');
} catch (\Exception $e) {
- $app->addFlash('error', _('admin::compte-utilisateur: erreur lors de la mise a jour'));
+ $app->addFlash('error', $app->trans('admin::compte-utilisateur: erreur lors de la mise a jour'));
return $app->redirectPath('account');
}
@@ -210,7 +210,7 @@ class Account implements ControllerProviderInterface
public function grantAccess(Application $app, Request $request, $application_id)
{
if (!$request->isXmlHttpRequest() || !array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) {
- $app->abort(400, _('Bad request format, only JSON is allowed'));
+ $app->abort(400, $app->trans('Bad request format, only JSON is allowed'));
}
$error = false;
@@ -344,7 +344,7 @@ class Account implements ControllerProviderInterface
foreach ($demands as $baseId) {
try {
$register->add_request($app['authentication']->getUser(), \collection::get_from_base_id($app, $baseId));
- $app->addFlash('success', _('login::notification: Vos demandes ont ete prises en compte'));
+ $app->addFlash('success', $app->trans('login::notification: Vos demandes ont ete prises en compte'));
} catch (\Exception $e) {
}
@@ -403,9 +403,9 @@ class Account implements ControllerProviderInterface
$app['phraseanet.appbox']->get_connection()->commit();
$app['EM']->persist($ftpCredential);
$app['EM']->flush();
- $app->addFlash('success', _('login::notification: Changements enregistres'));
+ $app->addFlash('success', $app->trans('login::notification: Changements enregistres'));
} catch (\Exception $e) {
- $app->addFlash('error', _('forms::erreurs lors de l\'enregistrement des modifications'));
+ $app->addFlash('error', $app->trans('forms::erreurs lors de l\'enregistrement des modifications'));
$app['phraseanet.appbox']->get_connection()->rollBack();
}
}
diff --git a/lib/Alchemy/Phrasea/Controller/Root/Developers.php b/lib/Alchemy/Phrasea/Controller/Root/Developers.php
index f7964aed6c..9815535c9a 100644
--- a/lib/Alchemy/Phrasea/Controller/Root/Developers.php
+++ b/lib/Alchemy/Phrasea/Controller/Root/Developers.php
@@ -73,7 +73,7 @@ class Developers implements ControllerProviderInterface
public function deleteApp(Application $app, Request $request, $id)
{
if (!$request->isXmlHttpRequest() || !array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) {
- $app->abort(400, _('Bad request format, only JSON is allowed'));
+ $app->abort(400, 'Bad request format, only JSON is allowed');
}
$error = false;
@@ -99,7 +99,7 @@ class Developers implements ControllerProviderInterface
public function renewAppCallback(Application $app, Request $request, $id)
{
if (!$request->isXmlHttpRequest() || !array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) {
- $app->abort(400, _('Bad request format, only JSON is allowed'));
+ $app->abort(400, 'Bad request format, only JSON is allowed');
}
$error = false;
@@ -130,7 +130,7 @@ class Developers implements ControllerProviderInterface
public function renewAccessToken(Application $app, Request $request, $id)
{
if (!$request->isXmlHttpRequest() || !array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) {
- $app->abort(400, _('Bad request format, only JSON is allowed'));
+ $app->abort(400, 'Bad request format, only JSON is allowed');
}
$error = false;
@@ -167,7 +167,7 @@ class Developers implements ControllerProviderInterface
public function authorizeGrantpassword(Application $app, Request $request, $id)
{
if (!$request->isXmlHttpRequest() || !array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) {
- $app->abort(400, _('Bad request format, only JSON is allowed'));
+ $app->abort(400, 'Bad request format, only JSON is allowed');
}
$error = false;
diff --git a/lib/Alchemy/Phrasea/Controller/Root/Login.php b/lib/Alchemy/Phrasea/Controller/Root/Login.php
index 2cfb59c44f..f753f0dfed 100644
--- a/lib/Alchemy/Phrasea/Controller/Root/Login.php
+++ b/lib/Alchemy/Phrasea/Controller/Root/Login.php
@@ -217,23 +217,23 @@ class Login implements ControllerProviderInterface
public function getLanguage(Application $app, Request $request)
{
$response = $app->json([
- 'validation_blank' => _('Please provide a value.'),
- 'validation_choice_min' => _('Please select at least %s choice.'),
- 'validation_email' => _('Please provide a valid email address.'),
- 'validation_ip' => _('Please provide a valid IP address.'),
- 'validation_length_min' => _('Please provide a longer value. It should have %s character or more.'),
- 'password_match' => _('Please provide the same passwords.'),
- 'email_match' => _('Please provide the same emails.'),
- 'accept_tou' => _('Please accept the terms of use to register.'),
- 'no_collection_selected' => _('No collection selected'),
- 'one_collection_selected' => _('%d collection selected'),
- 'collections_selected' => _('%d collections selected'),
- 'all_collections' => _('Select all collections'),
+ 'validation_blank' => $app->trans('Please provide a value.'),
+ 'validation_choice_min' => $app->trans('Please select at least %s choice.'),
+ 'validation_email' => $app->trans('Please provide a valid email address.'),
+ 'validation_ip' => $app->trans('Please provide a valid IP address.'),
+ 'validation_length_min' => $app->trans('Please provide a longer value. It should have %s character or more.'),
+ 'password_match' => $app->trans('Please provide the same passwords.'),
+ 'email_match' => $app->trans('Please provide the same emails.'),
+ 'accept_tou' => $app->trans('Please accept the terms of use to register.'),
+ 'no_collection_selected' => $app->trans('No collection selected'),
+ 'one_collection_selected' => $app->trans('%d collection selected'),
+ 'collections_selected' => $app->trans('%d collections selected'),
+ 'all_collections' => $app->trans('Select all collections'),
// password strength
- 'weak' => _('Weak'),
- 'ordinary' => _('Ordinary'),
- 'good' => _('Good'),
- 'great' => _('Great'),
+ 'weak' => $app->trans('Weak'),
+ 'ordinary' => $app->trans('Ordinary'),
+ 'good' => $app->trans('Good'),
+ 'great' => $app->trans('Great'),
]);
$response->setExpires(new \DateTime('+1 day'));
@@ -268,7 +268,7 @@ class Login implements ControllerProviderInterface
try {
$provider = $this->findProvider($app, $data['provider-id']);
} catch (NotFoundHttpException $e) {
- $app->addFlash('error', _('You tried to register with an unknown provider'));
+ $app->addFlash('error', $app->trans('You tried to register with an unknown provider'));
return $app->redirectPath('login_register');
}
@@ -276,7 +276,7 @@ class Login implements ControllerProviderInterface
try {
$token = $provider->getToken();
} catch (NotAuthenticatedException $e) {
- $app->addFlash('error', _('You tried to register with an unknown provider'));
+ $app->addFlash('error', $app->trans('You tried to register with an unknown provider'));
return $app->redirectPath('login_register');
}
@@ -303,7 +303,7 @@ class Login implements ControllerProviderInterface
$captcha = $app['recaptcha']->bind($request);
if ($app['phraseanet.registry']->get('GV_captchas') && !$captcha->isValid()) {
- throw new FormProcessingException(_('Invalid captcha answer.'));
+ throw new FormProcessingException($app->trans('Invalid captcha answer.'));
}
require_once $app['root.path'] . '/lib/classes/deprecated/inscript.api.php';
@@ -408,10 +408,10 @@ class Login implements ControllerProviderInterface
try {
$this->sendAccountUnlockEmail($app, $user);
- $app->addFlash('info', _('login::notification: demande de confirmation par mail envoyee'));
+ $app->addFlash('info', $app->trans('login::notification: demande de confirmation par mail envoyee'));
} catch (InvalidArgumentException $e) {
// todo, log this failure
- $app->addFlash('error', _('Unable to send your account unlock email.'));
+ $app->addFlash('error', $app->trans('Unable to send your account unlock email.'));
}
return $app->redirectPath('homepage');
@@ -472,17 +472,17 @@ class Login implements ControllerProviderInterface
try {
$user = \User_Adapter::getInstance((int) $usrId, $app);
} catch (\Exception $e) {
- $app->addFlash('error', _('Invalid link.'));
+ $app->addFlash('error', $app->trans('Invalid link.'));
return $app->redirectPath('homepage');
}
try {
$this->sendAccountUnlockEmail($app, $user);
- $app->addFlash('success', _('login::notification: demande de confirmation par mail envoyee'));
+ $app->addFlash('success', $app->trans('login::notification: demande de confirmation par mail envoyee'));
} catch (InvalidArgumentException $e) {
// todo, log this failure
- $app->addFlash('error', _('Unable to send your account unlock email.'));
+ $app->addFlash('error', $app->trans('Unable to send your account unlock email.'));
}
return $app->redirectPath('homepage');
@@ -521,7 +521,7 @@ class Login implements ControllerProviderInterface
public function registerConfirm(PhraseaApplication $app, Request $request)
{
if (null === $code = $request->query->get('code')) {
- $app->addFlash('error', _('Invalid unlock link.'));
+ $app->addFlash('error', $app->trans('Invalid unlock link.'));
return $app->redirectPath('homepage');
}
@@ -529,7 +529,7 @@ class Login implements ControllerProviderInterface
try {
$datas = $app['tokens']->helloToken($code);
} catch (NotFoundHttpException $e) {
- $app->addFlash('error', _('Invalid unlock link.'));
+ $app->addFlash('error', $app->trans('Invalid unlock link.'));
return $app->redirectPath('homepage');
}
@@ -537,13 +537,13 @@ class Login implements ControllerProviderInterface
try {
$user = \User_Adapter::getInstance((int) $datas['usr_id'], $app);
} catch (\Exception $e) {
- $app->addFlash('error', _('Invalid unlock link.'));
+ $app->addFlash('error', $app->trans('Invalid unlock link.'));
return $app->redirectPath('homepage');
}
if (!$user->get_mail_locked()) {
- $app->addFlash('info', _('Account is already unlocked, you can login.'));
+ $app->addFlash('info', $app->trans('Account is already unlocked, you can login.'));
return $app->redirectPath('homepage');
}
@@ -554,7 +554,7 @@ class Login implements ControllerProviderInterface
try {
$receiver = Receiver::fromUser($user);
} catch (InvalidArgumentException $e) {
- $app->addFlash('success', _('Account has been unlocked, you can now login.'));
+ $app->addFlash('success', $app->trans('Account has been unlocked, you can now login.'));
return $app->redirectPath('homepage');
}
@@ -565,12 +565,12 @@ class Login implements ControllerProviderInterface
$mail = MailSuccessEmailConfirmationRegistered::create($app, $receiver);
$app['notification.deliverer']->deliver($mail);
- $app->addFlash('success', _('Account has been unlocked, you can now login.'));
+ $app->addFlash('success', $app->trans('Account has been unlocked, you can now login.'));
} else {
$mail = MailSuccessEmailConfirmationUnregistered::create($app, $receiver);
$app['notification.deliverer']->deliver($mail);
- $app->addFlash('info', _('Account has been unlocked, you still have to wait for admin approval.'));
+ $app->addFlash('info', $app->trans('Account has been unlocked, you still have to wait for admin approval.'));
}
return $app->redirectPath('homepage');
@@ -604,7 +604,7 @@ class Login implements ControllerProviderInterface
$app['tokens']->removeToken($token);
- $app->addFlash('success', _('login::notification: Mise a jour du mot de passe avec succes'));
+ $app->addFlash('success', $app->trans('login::notification: Mise a jour du mot de passe avec succes'));
return $app->redirectPath('homepage');
}
@@ -640,13 +640,13 @@ class Login implements ControllerProviderInterface
try {
$user = \User_Adapter::getInstance(\User_Adapter::get_usr_id_from_email($app, $data['email']), $app);
} catch (\Exception $e) {
- throw new FormProcessingException(_('phraseanet::erreur: Le compte n\'a pas ete trouve'));
+ throw new FormProcessingException($app->trans('phraseanet::erreur: Le compte n\'a pas ete trouve'));
}
try {
$receiver = Receiver::fromUser($user);
} catch (InvalidArgumentException $e) {
- throw new FormProcessingException(_('Invalid email address'));
+ throw new FormProcessingException($app->trans('Invalid email address'));
}
$token = $app['tokens']->getUrlToken(\random::TYPE_PASSWORD, $user->get_id(), new \DateTime('+1 day'));
@@ -662,7 +662,7 @@ class Login implements ControllerProviderInterface
$mail->setButtonUrl($url);
$app['notification.deliverer']->deliver($mail);
- $app->addFlash('info', _('phraseanet:: Un email vient de vous etre envoye'));
+ $app->addFlash('info', $app->trans('phraseanet:: Un email vient de vous etre envoye'));
return $app->redirectPath('login_forgot_password');
}
@@ -710,7 +710,7 @@ class Login implements ControllerProviderInterface
$app['dispatcher']->dispatch(PhraseaEvents::LOGOUT, new LogoutEvent($app));
$app['authentication']->closeAccount();
- $app->addFlash('info', _('Vous etes maintenant deconnecte. A bientot.'));
+ $app->addFlash('info', $app->trans('Vous etes maintenant deconnecte. A bientot.'));
$response = $app->redirectPath('homepage', [
'redirect' => $request->query->get("redirect")
@@ -737,7 +737,7 @@ class Login implements ControllerProviderInterface
try {
$app['phraseanet.appbox']->get_connection();
} catch (\Exception $e) {
- $app->addFlash('error', _('login::erreur: No available connection - Please contact sys-admin'));
+ $app->addFlash('error', $app->trans('login::erreur: No available connection - Please contact sys-admin'));
}
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->findBy(['public' => true], ['updatedOn' => 'DESC']);
@@ -779,7 +779,7 @@ class Login implements ControllerProviderInterface
public function authenticateAsGuest(PhraseaApplication $app, Request $request)
{
if (!$app->isGuestAllowed()) {
- $app->abort(403, _('Phraseanet guest-access is disabled'));
+ $app->abort(403, $app->trans('Phraseanet guest-access is disabled'));
}
$context = new Context(Context::CONTEXT_GUEST);
@@ -899,7 +899,7 @@ class Login implements ControllerProviderInterface
$provider->onCallback($request);
$token = $provider->getToken();
} catch (NotAuthenticatedException $e) {
- $app['session']->getFlashBag()->add('error', sprintf(_('Unable to authenticate with %s'), $provider->getName()));
+ $app['session']->getFlashBag()->add('error', $app->trans('Unable to authenticate with %provider_name%', array('%provider_name%' => $provider->getName())));
return $app->redirectPath('homepage');
}
@@ -923,7 +923,7 @@ class Login implements ControllerProviderInterface
try {
$user = $app['authentication.suggestion-finder']->find($token);
} catch (NotAuthenticatedException $e) {
- $app->addFlash('error', _('Unable to retrieve provider identity'));
+ $app->addFlash('error', $app->trans('Unable to retrieve provider identity'));
return $app->redirectPath('homepage');
}
@@ -962,7 +962,7 @@ class Login implements ControllerProviderInterface
return $app->redirectPath('login_register_classic', ['providerId' => $providerId]);
}
- $app->addFlash('error', _('Your identity is not recognized.'));
+ $app->addFlash('error', $app->trans('Your identity is not recognized.'));
return $app->redirectPath('homepage');
}
@@ -994,7 +994,7 @@ class Login implements ControllerProviderInterface
$form->bind($request);
if (!$form->isValid()) {
- $app->addFlash('error', _('An unexpected error occured during authentication process, please contact an admin'));
+ $app->addFlash('error', $app->trans('An unexpected error occured during authentication process, please contact an admin'));
throw new AuthenticationException(call_user_func($redirector));
}
@@ -1009,18 +1009,18 @@ class Login implements ControllerProviderInterface
$usr_id = $app['auth.native']->getUsrId($request->request->get('login'), $request->request->get('password'), $request);
} catch (RequireCaptchaException $e) {
$app->requireCaptcha();
- $app->addFlash('warning', _('Please fill the captcha'));
+ $app->addFlash('warning', $app->trans('Please fill the captcha'));
throw new AuthenticationException(call_user_func($redirector, $params));
} catch (AccountLockedException $e) {
- $app->addFlash('warning', _('login::erreur: Vous n\'avez pas confirme votre email'));
+ $app->addFlash('warning', $app->trans('login::erreur: Vous n\'avez pas confirme votre email'));
$app->addUnlockAccountData($e->getUsrId());
throw new AuthenticationException(call_user_func($redirector, $params));
}
if (null === $usr_id) {
- $app['session']->getFlashBag()->set('error', _('login::erreur: Erreur d\'authentification'));
+ $app['session']->getFlashBag()->set('error', $app->trans('login::erreur: Erreur d\'authentification'));
throw new AuthenticationException(call_user_func($redirector, $params));
}
diff --git a/lib/Alchemy/Phrasea/Controller/Root/Session.php b/lib/Alchemy/Phrasea/Controller/Root/Session.php
index 0f4072a47b..59e6d90de2 100644
--- a/lib/Alchemy/Phrasea/Controller/Root/Session.php
+++ b/lib/Alchemy/Phrasea/Controller/Root/Session.php
@@ -111,7 +111,7 @@ class Session implements ControllerProviderInterface
if (in_array($app['session']->get('phraseanet.message'), ['1', null])) {
if ($app['conf']->get(['main', 'maintenance'])) {
- $ret['message'] .= _('The application is going down for maintenance, please logout.');
+ $ret['message'] .= $app->trans('The application is going down for maintenance, please logout.');
}
if ($app['phraseanet.registry']->get('GV_message_on')) {
diff --git a/lib/Alchemy/Phrasea/Controller/Setup.php b/lib/Alchemy/Phrasea/Controller/Setup.php
index c86ea983d3..36de8267c6 100644
--- a/lib/Alchemy/Phrasea/Controller/Setup.php
+++ b/lib/Alchemy/Phrasea/Controller/Setup.php
@@ -96,7 +96,7 @@ class Setup implements ControllerProviderInterface
}
if ($request->getScheme() == 'http') {
- $warnings[] = _('It is not recommended to install Phraseanet without HTTPS support');
+ $warnings[] = $app->trans('It is not recommended to install Phraseanet without HTTPS support');
}
return $app['twig']->render('/setup/step2.html.twig', [
@@ -131,7 +131,7 @@ class Setup implements ControllerProviderInterface
$abConn = new \connection_pdo('appbox', $hostname, $port, $user_ab, $ab_password, $appbox_name, [], $app['debug']);
} catch (\Exception $e) {
return $app->redirectPath('install_step2', [
- 'error' => _('Appbox is unreachable'),
+ 'error' => $app->trans('Appbox is unreachable'),
]);
}
@@ -141,7 +141,7 @@ class Setup implements ControllerProviderInterface
}
} catch (\Exception $e) {
return $app->redirectPath('install_step2', [
- 'error' => _('Databox is unreachable'),
+ 'error' => $app->trans('Databox is unreachable'),
]);
}
@@ -180,7 +180,7 @@ class Setup implements ControllerProviderInterface
]);
} catch (\Exception $e) {
return $app->redirectPath('install_step2', [
- 'error' => sprintf(_('an error occured : %s'), $e->getMessage()),
+ 'error' => $app->trans('an error occured : %message%', array('%message%' => $e->getMessage())),
]);
}
}
diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php
index 3c7d6598b2..37f99cbd73 100644
--- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php
+++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php
@@ -429,13 +429,13 @@ class Thesaurus implements ControllerProviderInterface
$dom->formatOutput = true;
$root = $dom->appendChild($dom->createElementNS('www.phraseanet.com', 'phraseanet:topics'));
- $root->appendChild($dom->createComment(sprintf(_('thesaurus:: fichier genere le %s'), $now)));
+ $root->appendChild($dom->createComment($app->trans('thesaurus:: fichier genere le %date%', array('%date%' => $now))));
$root->appendChild($dom->createElement('display'))
->appendChild($dom->createElement('defaultview'))
->appendChild($dom->createTextNode($default_display));
- $this->export0Topics($xpathth->query($q)->item(0), $dom, $root, $lng, $request->get("srt"), $request->get("sth"), $request->get("sand"), $opened_display, $obr);
+ $this->export0Topics($app, $xpathth->query($q)->item(0), $dom, $root, $lng, $request->get("srt"), $request->get("sth"), $request->get("sand"), $opened_display, $obr);
if ($request->get("ofm") == 'toscreen') {
$lngs[$lng] = str_replace(['&', '<', '>'], ['&', '<', '>'], $dom->saveXML());
@@ -445,9 +445,9 @@ class Thesaurus implements ControllerProviderInterface
@rename($app['root.path'] . '/config/topics/' . $fname, $app['root.path'] . '/config/topics/topics_' . $lng . '_BKP_' . $now . '.xml');
if ($dom->save($app['root.path'] . '/config/topics/' . $fname)) {
- $lngs[$lng] = \p4string::MakeString(sprintf(_('thesaurus:: fichier genere : %s'), $fname));
+ $lngs[$lng] = \p4string::MakeString($app->trans('thesaurus:: fichier genere : %filename%', array('%filename%' => $fname)));
} else {
- $lngs[$lng] = \p4string::MakeString(_('thesaurus:: erreur lors de l\'enregsitrement du fichier'));
+ $lngs[$lng] = \p4string::MakeString($app->trans('thesaurus:: erreur lors de l\'enregsitrement du fichier'));
}
}
}
@@ -462,13 +462,13 @@ class Thesaurus implements ControllerProviderInterface
]);
}
- private function export0Topics($znode, \DOMDocument $dom, \DOMNode $root, $lng, $srt, $sth, $sand, $opened_display, $obr)
+ private function export0Topics(Application $app, $znode, \DOMDocument $dom, \DOMNode $root, $lng, $srt, $sth, $sand, $opened_display, $obr)
{
$topics = $root->appendChild($dom->createElement('topics'));
- $this->doExportTopics($znode, $dom, $topics, '', $lng, $srt, $sth, $sand, $opened_display, $obr, 0);
+ $this->doExportTopics($app, $znode, $dom, $topics, '', $lng, $srt, $sth, $sand, $opened_display, $obr, 0);
}
- private function doExportTopics($node, \DOMDocument $dom, \DOMNode $topics, $prevQuery, $lng, $srt, $sth, $sand, $opened_display, $obr, $depth = 0)
+ private function doExportTopics(Application $app, $node, \DOMDocument $dom, \DOMNode $topics, $prevQuery, $lng, $srt, $sth, $sand, $opened_display, $obr, $depth = 0)
{
$ntopics = 0;
if ($node->nodeType == XML_ELEMENT_NODE) {
@@ -506,7 +506,11 @@ class Thesaurus implements ControllerProviderInterface
}
$t_sort[$i] = $query; // tri sur w
- $t_node[$i] = ['label' => $label, 'node' => $n];
+ $t_node[$i] = [
+ /** @Ignore */
+ 'label' => $label,
+ 'node' => $n
+ ];
$i ++;
}
@@ -531,14 +535,14 @@ class Thesaurus implements ControllerProviderInterface
}
if ($sand && $prevQuery != '') {
- $query = $prevQuery . ' ' . _('phraseanet::technique:: et') . ' ' . $query . '';
+ $query = $prevQuery . ' ' . $app->trans('phraseanet::technique:: et') . ' ' . $query . '';
}
$topic->appendChild($dom->createElement('query'))->appendChild($dom->createTextNode('' . $query . ''));
$topics2 = $dom->createElement('topics');
- if ($this->doExportTopics($t_node[$i]['node'], $dom, $topics2, $query, $lng, $srt, $sth, $sand, $opened_display, $obr, $depth + 1) > 0) {
+ if ($this->doExportTopics($app, $t_node[$i]['node'], $dom, $topics2, $query, $lng, $srt, $sth, $sand, $opened_display, $obr, $depth + 1) > 0) {
$topic->appendChild($topics2);
}
}
@@ -604,20 +608,20 @@ class Thesaurus implements ControllerProviderInterface
$line = substr($line, 1);
}
if ($depth > $curdepth + 1) {
- $err = sprintf(_("over-indent at line %s"), $iline);
+ $err = $app->trans("over-indent at line %line%", array('%line%' => $iline));
continue;
}
$line = trim($line);
if ( ! $this->checkEncoding($line, 'UTF-8')) {
- $err = sprintf(_("bad encoding at line %s"), $iline);
+ $err = $app->trans("bad encoding at line %line%", array('%line%' => $iline));
continue;
}
$line = str_replace($cbad, $cok, ($oldline = $line));
if ($line != $oldline) {
- $err = sprintf(_("bad character at line %s"), $iline);
+ $err = $app->trans("bad character at line %line%", array('%line%' => $iline));
continue;
}
@@ -1751,7 +1755,7 @@ class Thesaurus implements ControllerProviderInterface
$domct->documentElement->setAttribute("nextid", (int) ($id) + 1);
$del = $domct->documentElement->appendChild($domct->createElement("te"));
$del->setAttribute("id", "C" . $id);
- $del->setAttribute("field", _('thesaurus:: corbeille'));
+ $del->setAttribute("field", $app->trans('thesaurus:: corbeille'));
$del->setAttribute("nextid", "0");
$del->setAttribute("delbranch", "1");
@@ -1881,7 +1885,7 @@ class Thesaurus implements ControllerProviderInterface
$domct->documentElement->setAttribute("nextid", (int) ($id) + 1);
$ct = $domct->documentElement->appendChild($domct->createElement("te"));
$ct->setAttribute("id", "C" . $id);
- $ct->setAttribute("field", _('thesaurus:: corbeille'));
+ $ct->setAttribute("field", $app->trans('thesaurus:: corbeille'));
$ct->setAttribute("nextid", "0");
$ct->setAttribute("delbranch", "1");
@@ -2978,7 +2982,7 @@ class Thesaurus implements ControllerProviderInterface
}
// on considere que la source 'deleted' est toujours valide
$fields["[deleted]"] = [
- "name" => _('thesaurus:: corbeille'),
+ "name" => $app->trans('thesaurus:: corbeille'),
"tbranch" => null,
"cid" => null,
"sourceok" => true
diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php
index f50393917b..572f9c2257 100644
--- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php
+++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php
@@ -486,7 +486,7 @@ class Xmlhttp implements ControllerProviderInterface
';
@@ -248,7 +248,7 @@ function giveMeBaseUsr(Application $app, $usr)
if ($baseInsc['Colls']) {//des coll ou on peut s'inscrire sans cgu specifiques
//je check si ya des cgu pour la base
if ($baseInsc['CGU']) {
- $out .= '
' . _('login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes') . '
';
+ $out .= '
' . $app->trans('login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes') . '
';
$out .= '
' . $baseInsc['CGU'] . '
';
}
foreach ($baseInsc['Colls'] as $collId => $collName) {
@@ -258,7 +258,7 @@ function giveMeBaseUsr(Application $app, $usr)
'
' .
'
' .
'' .
- '' . _('login::register: Faire une demande d\'acces') . '' .
+ '' . $app->trans('login::register: Faire une demande d\'acces') . '' .
'
- {% trans with {'%username%' : username} %}
- Hello %username%
- {% endtrans %}
+ {% trans with {'%username%' : username} %}Hello %username%{% endtrans %}
{% endif %}
@@ -74,9 +70,7 @@
{% set application_name = '' ~ auth.getClient.get_name() ~ '' %}
- {% trans with {'%application_name%' : application_name, '%home_title%' : home_title} %}
- Autorisez-vous l'application %application_name% a acceder a votre contenu sur %home_title% ?
- {% endtrans %}
+ {% trans with {'%application_name%' : application_name, '%home_title%' : home_title} %}Autorisez-vous l'application %application_name% a acceder a votre contenu sur %home_title% ?{% endtrans %}
- {% trans with {'%username%' : username} %}
- Hello %username%
- {% endtrans %}
+ {% trans with {'%username%' : username} %}Hello %username%{% endtrans %}
{% endif %}
@@ -54,9 +52,7 @@
- {% trans %}
{{error}}
- {% endtrans %}
@@ -66,9 +62,7 @@
- {% trans %}
- Copiez le code ci-dessous, retournez dans votre application et collez-le a l'endroit requis :
- {% endtrans %}
+ {% trans %}Copiez le code ci-dessous, retournez dans votre application et collez-le a l'endroit requis :{% endtrans %}
{% if not app['phraseanet.configuration-tester'].isUpToDate() %}
-
{{ 'update::Votre application necessite une mise a jour vers : ' | trans }} {{ app['phraseanet.version'].getNumber() }}
+
{{ 'update::Votre application necessite une mise a jour vers :' | trans }} {{ app['phraseanet.version'].getNumber() }}
{% else %}
-
{{ 'update::Votre version est a jour : ' | trans }} {{ app['phraseanet.version'].getNumber() }}
+
{{ 'update::Votre version est a jour :' | trans }} {{ app['phraseanet.version'].getNumber() }}
{% endif %}
{% if recommendations | length > 0%}
@@ -133,4 +133,4 @@
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/templates/web/admin/databox/databox.html.twig b/templates/web/admin/databox/databox.html.twig
index 4a178dd744..96e9449ed0 100644
--- a/templates/web/admin/databox/databox.html.twig
+++ b/templates/web/admin/databox/databox.html.twig
@@ -52,7 +52,7 @@
{% if showDetail %}
- {{ 'admin::base: nombre de mots uniques sur la base : ' | trans }}
+ {{ 'admin::base: nombre de mots uniques sur la base :' | trans }}
{{ databox.get_unique_keywords() }}