Skip to content

Commit

Permalink
AO3-6058 Hardcode locale for downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
weeklies committed Oct 21, 2023
1 parent 7692484 commit 9abb668
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/helpers/works_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def get_inspired_by(work)
def related_work_note(related_work, relation, download: false)
work_link = link_to related_work.title, polymorphic_url(related_work)
language = tag.span(related_work.language.name, lang: related_work.language.short) if related_work.language
default_locale = download ? :en : nil

creator_link = if download
byline(related_work, visibility: "public", only_path: false)
Expand All @@ -127,15 +128,18 @@ def related_work_note(related_work, relation, download: false)
t(".#{relation}.unrevealed_html",
language: language)
else
t(".#{relation}.unrevealed")
t(".#{relation}.unrevealed",
locale: default_locale)
end
elsif related_work.restricted? && (download || !logged_in?)
t(".#{relation}.restricted_html",
language: language,
locale: default_locale,
creator_link: creator_link)
else
t(".#{relation}.revealed_html",
language: language,
locale: default_locale,
work_link: work_link,
creator_link: creator_link)
end
Expand Down

0 comments on commit 9abb668

Please sign in to comment.