diff --git a/app/views/crops/_join_banner.html.haml b/app/views/crops/_join_banner.html.haml index b7eb71299..2e8b2b342 100644 --- a/app/views/crops/_join_banner.html.haml +++ b/app/views/crops/_join_banner.html.haml @@ -1,9 +1,9 @@ -# Shown to visitors who are not signed in: what Growstuff is, and an invitation to join. .crop-join-banner.d-flex.flex-wrap.align-items-center.justify-content-between.gap-3 .crop-join-text - %strong Growstuff is a free, community-run site for people who grow food. - Keep track of what you plant and harvest, find seeds to swap, and see what is growing near you. - Join to record your own #{crop.name.pluralize}. + %strong= t('.heading') + = t('.text') + = t('.prompt', crops: crop.name.pluralize) .crop-join-actions.text-nowrap - sign_up = { data: { auth_dialog: 'sign_up' }, class: 'btn btn-signup' } - sign_in = { data: { auth_dialog: 'sign_in' }, class: 'ms-2' } diff --git a/config/locales/de.yml b/config/locales/de.yml index b3742461b..c48630efb 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -229,6 +229,10 @@ de: index: subtitle: '%{crops_size} insgesamt' title: Durchsuchen Sie Pflanzen + join_banner: + heading: Growstuff ist eine kostenlose, von der Community betriebene Website für Menschen, die Lebensmittel anbauen. + prompt: Melden Sie sich an, um Ihre eigenen %{crops} aufzuzeichnen. + text: Behalten Sie im Auge, was Sie pflanzen und ernten, finden Sie Saatgut zum Tauschen und sehen Sie, was in Ihrer Nähe wächst. requested: link: Sie haben %{number_crops} Kulturen, die auf die Genehmigung warten subtitle: Genehmigung ausstehend diff --git a/config/locales/en.yml b/config/locales/en.yml index 8ee43ee16..9092fd05e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -237,6 +237,10 @@ en: index: subtitle: "%{crops_size} total" title: Browse Crops + join_banner: + heading: Growstuff is a free, community-run site for people who grow food. + prompt: Join to record your own %{crops}. + text: Keep track of what you plant and harvest, find seeds to swap, and see what is growing near you. requested: link: You have %{number_crops} crops awaiting approval subtitle: Pending approval diff --git a/config/locales/es.yml b/config/locales/es.yml index e7937819b..a07c4fc0a 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -229,6 +229,10 @@ es: index: subtitle: '%{crops_size} total' title: Explorar cultivos + join_banner: + heading: Growstuff es un sitio gratuito administrado por la comunidad para personas que cultivan alimentos. + prompt: Únase para registrar sus propios %{crops}. + text: Lleve un registro de lo que siembra y cosecha, busque semillas para intercambiar y vea lo que crece cerca de usted. requested: link: Tienes cultivos %{number_crops} pendientes de aprobación subtitle: Pendiente de aprobación diff --git a/config/locales/fr.yml b/config/locales/fr.yml index af429c963..079279196 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -229,6 +229,10 @@ fr: index: subtitle: '%{crops_size} total' title: Parcourir les cultures + join_banner: + heading: Growstuff est un site gratuit géré par la communauté pour les personnes qui cultivent des aliments. + prompt: Inscrivez-vous pour enregistrer vos propres %{crops}. + text: Gardez une trace de ce que vous plantez et récoltez, trouvez des graines à échanger et découvrez ce qui pousse près de chez vous. requested: link: Vous avez des cultures %{number_crops} en attente d'approbation subtitle: En attente d’approbation diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 2cf8ca52a..7e8bb42f4 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -19,6 +19,10 @@ ja: name: 学名 save: 保存 wikidata_id: Wikidata ID + join_banner: + heading: Growstuffは作物を育てる人々のための無料のコミュニティ運営サイトです。 + prompt: 参加してあなた自身の%{crops}を記録しましょう。 + text: 植えたものや収穫したものを記録し、交換する種を見つけ、近くで何が育っているかを確認しましょう。 harvests: edit_modal: harvested_at: いつ収穫しましたか? diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 078b80b5b..0a35141ac 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -229,6 +229,10 @@ zh: index: subtitle: '%{crops_size} 总计' title: 浏览农作物 + join_banner: + heading: Growstuff 是一个免费的、由社区运营的网站,面向种植食物的人们。 + prompt: 注册即可记录您自己的 %{crops}。 + text: 记录您种植和收获的内容,寻找种子进行交换,并了解您附近种植的植物。 requested: link: 您有 %{number_crops} 作物等待批准 subtitle: 待批准 diff --git a/spec/requests/crops_controller_join_banner_spec.rb b/spec/requests/crops_controller_join_banner_spec.rb index 99db0ff89..669fa3e2f 100644 --- a/spec/requests/crops_controller_join_banner_spec.rb +++ b/spec/requests/crops_controller_join_banner_spec.rb @@ -22,6 +22,10 @@ describe CropsController do expect(page).to have_css('.crop-join-banner a', text: 'Sign in') end + it 'prompts to record the crop' do + expect(page).to have_css('.crop-join-banner', text: 'Join to record your own tomatoes.') + end + it 'comes after the description' do expect(response.body.index('A red berry.')).to be < response.body.index('crop-join-banner') end @@ -31,6 +35,18 @@ describe CropsController do end end + context 'when requesting with another locale' do + before { get crop_path(crop, locale: :es) } + + it 'renders the localised banner heading' do + expect(page).to have_css('.crop-join-banner', text: 'Growstuff es un sitio gratuito administrado por la comunidad') + end + + it 'renders the localised prompt' do + expect(page).to have_css('.crop-join-banner', text: 'Únase para registrar sus propios tomatoes.') + end + end + context 'when signed in' do before do sign_in create(:member)