Skip to content

Commit

Permalink
fix notif
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix committed Nov 21, 2023
1 parent 7c9e4c9 commit 082670e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/Alchemy/Phrasea/WorkerManager/Worker/SubtitleWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ public function process(array $payload)
$this->getEventsManager()->notify(
$payload['authenticatedUserId'],
'eventsmanager_notify_subtitle',
json_encode([]),
json_encode([
'translateMessage' => 'notification:: subtitle "%langues%" generated for "%title%" !',
'langues' => implode(', ', array_keys($payload['languageDestination'])),
'title' => htmlentities($record->get_title())
]),
false
);

Expand Down
2 changes: 1 addition & 1 deletion lib/classes/eventsmanager/notify/subtitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function icon_url()
*/
public function datas(array $data, $unread)
{
$text = $this->app->trans('notification:: subtitle generation finished');
$text = $this->app->trans($data['translateMessage'], ['%title%' => $data['title'], '%langues%' => $data['langues']]);

return [
'text' => $text,
Expand Down
4 changes: 2 additions & 2 deletions templates/web/prod/actions/Tools/videoEditor.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@
$('#submit-subtitle-request').on('click', function (e) {
e.preventDefault();
console.log("auto-subtitle process");
var destination = {};
$.each($('input[name=subtitle_language_destination]'), function(k, input){
Expand All @@ -382,8 +381,9 @@
subtitle_destination: JSON.stringify(destination),
},
success: function success(data) {
console.log(data);
$('#request-status').removeClass('hide');
$('#submit-subtitle-request').hide();
}
});
});
Expand Down

0 comments on commit 082670e

Please sign in to comment.