Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHRAS-3851 Untranslated terms : in Notifications, Detailed View, Map #4351

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Phraseanet-production-client/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ module.exports = {
setupDir: _root + 'tests/setup/node.js',
karmaConf: _root + 'config/karma.conf.js',
// change this version when you change JS file for lazy loading
assetFileVersion: 91
assetFileVersion: 92
};
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=91";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=92";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/authenticate.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=91";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=92";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=91";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=92";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/commons.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=91";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=92";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -70250,7 +70250,7 @@ var searchGeoForm = function searchGeoForm(services) {

var renderModal = function renderModal() {
// @TODO cleanup styles
return '\n <div style="overflow:hidden">\n <div id="' + mapContainerName + '" style="top: 0px; left: 0; bottom: 42px; position: absolute;height: auto;width: 100%;overflow: hidden;"></div>\n <div style="position: absolute;bottom: 0; text-align:center; height: 35px; width: 98%;overflow: hidden;"><button class="submit-geo-search-action btn map-geo-btn" style="font-size: 14px">' + localeService.t('Valider') + '</button></div>\n </div>';
return '\n <div style="overflow:hidden">\n <div id="' + mapContainerName + '" style="top: 0px; left: 0; bottom: 42px; position: absolute;height: auto;width: 100%;overflow: hidden;"></div>\n <div style="position: absolute;bottom: 0; text-align:center; height: 35px; width: 98%;overflow: hidden;"><button class="submit-geo-search-action btn map-geo-btn" style="font-size: 14px">' + localeService.t('valider') + '</button></div>\n </div>';
};

var updateCircleGeo = function updateCircleGeo(params) {
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/production.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -70250,7 +70250,7 @@ var searchGeoForm = function searchGeoForm(services) {

var renderModal = function renderModal() {
// @TODO cleanup styles
return '\n <div style="overflow:hidden">\n <div id="' + mapContainerName + '" style="top: 0px; left: 0; bottom: 42px; position: absolute;height: auto;width: 100%;overflow: hidden;"></div>\n <div style="position: absolute;bottom: 0; text-align:center; height: 35px; width: 98%;overflow: hidden;"><button class="submit-geo-search-action btn map-geo-btn" style="font-size: 14px">' + localeService.t('Valider') + '</button></div>\n </div>';
return '\n <div style="overflow:hidden">\n <div id="' + mapContainerName + '" style="top: 0px; left: 0; bottom: 42px; position: absolute;height: auto;width: 100%;overflow: hidden;"></div>\n <div style="position: absolute;bottom: 0; text-align:center; height: 35px; width: 98%;overflow: hidden;"><button class="submit-geo-search-action btn map-geo-btn" style="font-size: 14px">' + localeService.t('valider') + '</button></div>\n </div>';
};

var updateCircleGeo = function updateCircleGeo(params) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const searchGeoForm = (services) => {
return `
<div style="overflow:hidden">
<div id="${mapContainerName}" style="top: 0px; left: 0; bottom: 42px; position: absolute;height: auto;width: 100%;overflow: hidden;"></div>
<div style="position: absolute;bottom: 0; text-align:center; height: 35px; width: 98%;overflow: hidden;"><button class="submit-geo-search-action btn map-geo-btn" style="font-size: 14px">${localeService.t('Valider')}</button></div>
<div style="position: absolute;bottom: 0; text-align:center; height: 35px; width: 98%;overflow: hidden;"><button class="submit-geo-search-action btn map-geo-btn" style="font-size: 14px">${localeService.t('valider')}</button></div>
</div>`;
};

Expand Down
1 change: 1 addition & 0 deletions lib/Alchemy/Phrasea/Controller/Prod/LanguageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ public function getTranslationsAction()
'feedbackTitle' => $translator->trans('prod::dialog feedback title'),
'listmanagerTitle' => $translator->trans('prod::dialog listmanager title'),
'seeMore' => $translator->trans('prod::workzone:facet see more'),
'Geolocalisation' => $translator->trans('preview::tab geolocalisation'),
]);
}
}
4 changes: 2 additions & 2 deletions lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getGlobals()
{
return [
// change this version when you change JS file to force the navigation to reload js file
'assetFileVersion' => 91
'assetFileVersion' => 92
];

}
Expand Down Expand Up @@ -313,7 +313,7 @@ public function getDoctypeIcon(RecordInterface $record)
break;
case 'video':
$src = '/assets/common/images/icons/icon_video.png';
$title = $this->app['translator']->trans('reportage');
$title = $this->app['translator']->trans('video');
break;
case 'audio':
$src = '/assets/common/images/icons/icon_audio.png';
Expand Down
10 changes: 6 additions & 4 deletions lib/Alchemy/Phrasea/WorkerManager/Worker/ShareBasketWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ public function process(array $payload)
'eventsmanager_notify_basketwip',
// 'eventsmanager_notify_push',
json_encode([
'message' => $this->app->trans('notification:: Sharing basket "%name%"...', ['%name%' => htmlentities($basket->getName())]),
]),
'translateMessage' => 'notification:: Sharing basket "%name%"...',
'name' => htmlentities($basket->getName())
]),
false
);

Expand Down Expand Up @@ -395,8 +396,9 @@ public function process(array $payload)
'eventsmanager_notify_basketwip',
// 'eventsmanager_notify_push',
json_encode([
'message' => $this->app->trans('notification:: Basket %name% is shared', ['%name%' => htmlentities($basket->getName())]),
]),
'translateMessage' => 'notification:: Basket %name% is shared',
'name' => htmlentities($basket->getName())
]),
false
);

Expand Down
9 changes: 8 additions & 1 deletion lib/classes/eventsmanager/notify/basketwip.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ public function icon_url()
*/
public function datas(array $data, $unread)
{
if (isset($data['message'])) {
// to be retro compatible with old data value
$text = $data['message'];
} else {
$text = $this->app->trans($data['translateMessage'], ['%name%' => $data['name']]);
}

$ret = [
'text' => $data['message'],
'text' => $text,
'class' => ($unread == 1 ? 'reload_baskets' : '')
];

Expand Down
13 changes: 12 additions & 1 deletion lib/classes/eventsmanager/notify/validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,18 @@ public function datas(array $data, $unread)
. '" target="_blank">'
. htmlentities($basket_name) . '</a>';

$text = $isVoteBasket ? '%user% vous demande de valider %title%' : "notification:: Basket '%title%' shared from %user%";
if ($isVoteBasket) {
$text = $this->app->trans('%user% vous demande de valider %title%', [
'%user%' => htmlentities($sender),
'%title%' => $bask_link,
]);

} else {
$text = $this->app->trans("notification:: Basket '%title%' shared from %user%", [
'%user%' => htmlentities($sender),
'%title%' => $bask_link,
]);
}

$ret = [
'text' => $this->app->trans($text, [
Expand Down
Loading