Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add unknown_storage translation key

Dombi Attila71e9878bf22a
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 249b278efd9..28351e5f579 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1697,6 +1697,7 @@ en:
revoke_token: "Do you really want to remove this token? You will need to login again on %{storage}"
removed: "File Storage token successfully removed"
failed: "An error occurred and the token couldn't be removed. Please try again later."
+ unknown_storage: "Unknown storage"
notifications:
send_notifications: "Send notifications for this action"
diff --git a/lib/open_project/journal_formatter/file_link.rb b/lib/open_project/journal_formatter/file_link.rb
index 8281f5d428f..d8e6fe130ce 100644
--- a/lib/open_project/journal_formatter/file_link.rb
+++ b/lib/open_project/journal_formatter/file_link.rb
@@ -59,7 +59,9 @@ class OpenProject::JournalFormatter::FileLink < JournalFormatter::Base
non_nil_value = [old, current].compact.first
file_link = file_link_for(id, non_nil_value)
- non_nil_value['storage_name'] || file_link&.storage&.name || I18n.t('storages.unknown_storage')
+ non_nil_value['storage_name'] ||
+ file_link&.storage&.name ||
+ I18n.t('unknown_storage', scope: 'my_account.access_tokens.storages')
end
def render_file_link_detail_text(label, value, old_value, storage)
diff --git a/spec/lib/journal_formatter/file_link_spec.rb b/spec/lib/journal_formatter/file_link_spec.rb
index 0165a545d99..8adaca32b85 100644
--- a/spec/lib/journal_formatter/file_link_spec.rb
+++ b/spec/lib/journal_formatter/file_link_spec.rb
@@ -59,7 +59,10 @@ RSpec.describe OpenProject::JournalFormatter::FileLink do
.to eq(I18n.t(:text_journal_file_link_deleted,
label: "<strong>#{I18n.t('activerecord.models.file_link')}</strong>",
old: "<strike><i>#{file_link.origin_name}</i></strike>",
- storage: I18n.t('storages.unknown_storage')))
+ storage: I18n.t(
+ 'unknown_storage',
+ scope: 'my_account.access_tokens.storages'
+ )))
end
end