Commit 8996fd4e authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻 Committed by Kaspar
Browse files

make boolean to yes/no translation easyer and more efficient

parent 7aae60aa
......@@ -69,10 +69,6 @@ class Volunteer < ApplicationRecord
state == REJECTED
end
def self.human_boolean(boolean)
boolean ? I18n.t('simple_form.yes') : I18n.t('simple_form.no')
end
def self.state_collection
STATES.map(&:to_sym)
end
......
......@@ -9,7 +9,7 @@ tr
- seeking_client.language_skills.each do |language|
= language.full_language_skills
td= seeking_client.motivation
td= Volunteer.human_boolean(seeking_client.experience)
td= t(seeking_client.experience)
td
- Volunteer::SINGLE_ACCOMPANIMENTS.each do |single|
- if seeking_client[single]
......
......@@ -9,7 +9,7 @@ tr
- without_client.language_skills.each do |language|
= language.full_language_skills
td= without_client.motivation
td= Volunteer.human_boolean(without_client.experience)
td= t(without_client.experience)
td
- Volunteer.single_accompaniment.each do |single|
- if without_client[single]
......
......@@ -55,7 +55,7 @@ h4= "#{t_attr(:motivation, Volunteer)}: "
p= @volunteer.motivation
h4= "#{t(:experience, scope: [:simple_form, :labels, :volunteer])}: "
p= Volunteer.human_boolean(@volunteer.experience)
p= t(@volunteer.experience)
h4= "#{t_attr(:expectations, Volunteer)}: "
p= @volunteer.expectations
......
......@@ -65,7 +65,7 @@
- if @volunteer.experience.present?
= "#{rn2}#{t(:experience, scope: [:simple_form, :labels, :volunteer])}:\t"
= Volunteer.human_boolean(@volunteer.experience)
= t(@volunteer.experience)
- if @volunteer.volunteer_experience_desc.present?
= "\r\n#{@volunteer.volunteer_experience_desc}#{rn2}"
......
......@@ -17,19 +17,19 @@
tbody
tr
td= t_attr(:trial_period)
td= Volunteer.human_boolean(@volunteer.trial_period)
td= t(@volunteer.trial_period)
tr
td= t_attr(:intro_course)
td= Volunteer.human_boolean(@volunteer.intro_course)
td= t(@volunteer.intro_course)
tr
td= t_attr(:doc_sent)
td= Volunteer.human_boolean(@volunteer.doc_sent)
td= t(@volunteer.doc_sent)
tr
td= t_attr(:bank_account)
td= Volunteer.human_boolean(@volunteer.bank_account)
td= t(@volunteer.bank_account)
tr
td= t_attr(:evaluation)
td= Volunteer.human_boolean(@volunteer.evaluation)
td= t(@volunteer.evaluation)
h3= t('personal_background')
.table-responsive
......@@ -70,7 +70,7 @@ h3= t('personal_background')
td= t_attr(:experience)
td
dl.dl-horizontal
dt= Volunteer.human_boolean(@volunteer.experience)
dt= t(@volunteer.experience)
dd= @volunteer.volunteer_experience_desc if @volunteer.volunteer_experience_desc?
tr
td= t_attr(:expectations)
......@@ -96,7 +96,7 @@ h3= t('personal_background')
td= t_attr(:zurich)
td
dl.dl-horizontal
dt= Volunteer.human_boolean(@volunteer.zurich)
dt= t(@volunteer.zurich)
h3= t_attr(:single_accompaniment)
.table-responsive
......
......@@ -279,6 +279,8 @@ de:
change_my_password: Ihr Passwort ändern
change_password: Ihr Passwort ändern
checklist: Checkliste
"true": Ja
"false": Nein
client_created: Klient/in wurde erfolgreich erstellt.
client_destroyed: Klient/in wurde erfolgreich gelöscht.
client_updated: Klient/in wurde erfolgreich aktualisiert.
......
......@@ -299,6 +299,8 @@ en:
language_skills: Language skills
login: Log in
logout: Logout
"true": "Yes"
"false": "No"
messages:
confirm_delete: "Really delete %{model} %{record}?"
select_prompt: "Select %{model}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment