diff --git a/app/helpers/outfits_helper.rb b/app/helpers/outfits_helper.rb index 77834ce2..e7c38a71 100644 --- a/app/helpers/outfits_helper.rb +++ b/app/helpers/outfits_helper.rb @@ -55,9 +55,10 @@ module OutfitsHelper end def render_predicted_missing_species_by_color(species_by_color) + key_prefix = 'outfits.new.newest_items.unmodeled.content' + # Transform the Color => Array map into an Array>>. - # TODO: i18n standard = species_by_color.delete(:standard) sorted_pairs = species_by_color.to_a.map { |k, v| [k.human_name, v] }. sort_by { |k, v| k } @@ -66,13 +67,17 @@ module OutfitsHelper first = true contents = sorted_pairs.map { |color_human_name, species| - species_sentence = species.map(&:human_name).sort.to_sentence( - two_words_connector: ' or ', last_word_connector: ', or ') - content = first ? "Have you seen the #{color_human_name} #{species_sentence} wearing this item?" : "Or maybe the #{color_human_name} #{species_sentence}?" + species_list = species.map(&:human_name).sort.to_sentence( + words_connector: t("#{key_prefix}.species_list.words_connector"), + two_words_connector: t("#{key_prefix}.species_list.two_words_connector"), + last_word_connector: t("#{key_prefix}.species_list.last_word_connector")) + key = first ? 'first' : 'other' + content = t("#{key_prefix}.body.#{key}", color: color_human_name, + species_list: species_list) first = false content } - contents.last << " If so, please model it above! Thanks!" + contents.last << " " + t("#{key_prefix}.call_to_action") content_tags = contents.map { |c| content_tag(:p, c) } content_tags.join('').html_safe end diff --git a/config/locales/en-MEEP.yml b/config/locales/en-MEEP.yml index 2378826a..20ae7183 100644 --- a/config/locales/en-MEEP.yml +++ b/config/locales/en-MEEP.yml @@ -647,6 +647,15 @@ en-MEEP: newest_items: unmodeled: header: We meep your help! Can you meep these items? + content: + body: + first: Have you meeped the %{color} %{species_list} wearing this item? + other: Or meepy the %{color} %{species_list}? + call_to_action: If so, please meep it above! Meep! + species_list: + words_connector: '! ' + two_words_connector: ' meep ' + last_word_connector: '! meep ' modeled: header: These items have already been meeped—meep for your help! pet_query: diff --git a/config/locales/en.yml b/config/locales/en.yml index 12391cec..28d474be 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -703,6 +703,15 @@ en: newest_items: unmodeled: header: We need your help! Can you model these items? + content: + body: + first: Have you seen the %{color} %{species_list} wearing this item? + other: Or maybe the %{color} %{species_list}? + call_to_action: If so, please model it above! Thanks! + species_list: + words_connector: ', ' + two_words_connector: ' or ' + last_word_connector: ', or ' modeled: header: These items have already been modeled—thanks for your help! pet_query: