Merge pull request #6755 from ivanscinote/SCI-9775-ik

Fix translations for notifications (Due date, Date/Date&Time, Low stock) [SCI-9775]
This commit is contained in:
Martin Artnik 2023-12-05 09:29:38 +01:00 committed by GitHub
commit 254550ef7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 6 deletions

View file

@ -4,7 +4,8 @@ class LowStockNotification < BaseNotification
def message
I18n.t(
'notifications.content.item_low_stock_reminder.message_html',
repository_row_name: subject.name
repository_row_name: subject.name,
repository: repository.name
)
end
@ -19,4 +20,8 @@ class LowStockNotification < BaseNotification
def subject
RepositoryRow.find(params[:repository_row_id])
end
def repository
Repository.find(subject.repository_id)
end
end

View file

@ -3,7 +3,7 @@
class TaskDueDateNotification < BaseNotification
def message
I18n.t(
'notifications.notification.my_module_due_date_reminder_html',
'notifications.content.my_module_due_date_reminder.message_html',
my_module_name: subject.name
)
end

View file

@ -22,7 +22,9 @@ if ENV['ENABLE_FLUICS_SYNC'] == 'true'
end
end
scheduler.every '1h' do
reminder_job_interval = ENV['REMINDER_JOB_INTERVAL'] || '1h'
scheduler.every reminder_job_interval do
MyModules::DueDateReminderJob.perform_now
RepositoryItemDateReminderJob.perform_now
end

View file

@ -3444,13 +3444,13 @@ en:
content:
my_module_due_date_reminder:
title_html: "Task due date reminder"
message_html: "Due date for %{my_module_name} is coming up"
message_html: "Due date for a task %{my_module_name} is coming up."
item_low_stock_reminder:
title_html: "Item stock reminder"
message_html: "Item %{repository_row_name} is running low"
message_html: "Item %{repository_row_name} in inventory %{repository} is running low."
item_date_reminder:
title_html: "Item date reminder"
message_html: "Date reminder for %{repository_row_name} is coming up in %{value} %{units}"
message_html: "Date reminder for %{repository_row_name} is coming up in %{value} %{units}."
deliver:
download_link: "Download link:"
download_text: "Click the link to download the file."