From 36970bcf5071a1f382e908c563d346f836061e04 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 14 Mar 2018 12:12:24 +0800 Subject: [PATCH] Use underscore versions of model names for translation keys. --- app/views/reports/new.html.erb | 2 +- config/locales/en.yml | 8 ++++---- test/system/report_anonymous_note_test.rb | 2 +- test/system/report_diary_entry_test.rb | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/reports/new.html.erb b/app/views/reports/new.html.erb index 9812c6806..e5ac6373f 100644 --- a/app/views/reports/new.html.erb +++ b/app/views/reports/new.html.erb @@ -25,7 +25,7 @@ <% Report.categories_for(@report.issue.reportable).each do |c| %>
  • <%= radio_button :report, :category, c %> - <%= label_tag "report_category_#{c}", t("reports.categories.#{@report.issue.reportable.class.name}.#{c}") %>
    + <%= label_tag "report_category_#{c}", t("reports.categories.#{@report.issue.reportable.class.name.underscore}.#{c}") %>
  • <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 1e37c0fc0..7e4d01319 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1040,23 +1040,23 @@ en: new: title_html: "Report %{link}" categories: - DiaryEntry: + diary_entry: spam: This Diary Entry is/contains spam offensive: This Diary Entry is obscene/offensive threat: This Diary Entry contains a threat other: Other - DiaryComment: + diary_comment: spam: This Diary Comment is/contains spam offensive: This Diary Comment is obscene/offensive threat: This Diary Comment contains a threat other: Other - User: + user: spam: This User profile is/contains spam offensive: This User profile is obscene/offensive threat: This User profile contains a threat vandal: This User is a vandal other: Other - Note: + note: spam: This note is spam vandalism: This note is vandalism personal: This note contains personal data diff --git a/test/system/report_anonymous_note_test.rb b/test/system/report_anonymous_note_test.rb index a5a15d3a0..07621ab23 100644 --- a/test/system/report_anonymous_note_test.rb +++ b/test/system/report_anonymous_note_test.rb @@ -18,7 +18,7 @@ class ReportAnonymousNoteTest < ApplicationSystemTestCase assert page.has_content? "Report" assert page.has_content? I18n.t("issues.new.disclaimer.intro") - choose I18n.t("reports.categories.Note.spam") + choose I18n.t("reports.categories.note.spam") fill_in "report_details", :with => "This is spam" click_on "Create Report" diff --git a/test/system/report_diary_entry_test.rb b/test/system/report_diary_entry_test.rb index 988bfbe1f..3be8b3fd7 100644 --- a/test/system/report_diary_entry_test.rb +++ b/test/system/report_diary_entry_test.rb @@ -22,7 +22,7 @@ class ReportDiaryEntryTest < ApplicationSystemTestCase assert page.has_content? "Report" assert page.has_content? I18n.t("issues.new.disclaimer.intro") - choose I18n.t("reports.categories.DiaryEntry.spam") + choose I18n.t("reports.categories.diary_entry.spam") fill_in "report_details", :with => "This is advertising" click_on "Create Report" @@ -41,7 +41,7 @@ class ReportDiaryEntryTest < ApplicationSystemTestCase assert page.has_content? "Report" assert page.has_content? I18n.t("issues.new.disclaimer.intro") - choose I18n.t("reports.categories.DiaryEntry.spam") + choose I18n.t("reports.categories.diary_entry.spam") fill_in "report_details", :with => "This is advertising" click_on "Create Report" -- 2.39.5