Skip to content

Commit

Permalink
Bug/770 fix person relations add button labels (#777)
Browse files Browse the repository at this point in the history
* Fix person relation labels with new method in actions_helper

* Add translations for person relation new buttons to remaining languages

* Make translations for new buttons match their category name

* Normalize i18n files
  • Loading branch information
RandomTannenbaum authored Nov 25, 2024
1 parent 1737b2a commit 045a7ac
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/helpers/actions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def add_action_link(path = nil, url_options = {}, html_options = {})
action_link(ti('link.add'), 'plus', path, html_options)
end

def add_person_relation_link(path, person_relation_name, html_options)
path = new_polymorphic_path(path, url_options, html_options) unless path.is_a?(String)
action_link(t("people.#{person_relation_name}.link.add"), 'plus', path, html_options)
end

def add_action_link_modal(path = nil, url_options = {})
path ||= path_args(model_class)
path = new_polymorphic_path(path, url_options) unless path.is_a?(String)
Expand Down
2 changes: 1 addition & 1 deletion app/views/people/person_relations/_index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%div.profile-header.mw-100.border-bottom
= "#{list.model_name.human(count: list.count)} (#{list.count})"
%div.d-flex.flex-column.ms-5.mt-3.mb-3
= add_action_link new_polymorphic_path([entry, name_of_obj(list).to_sym]), {}, data: { turbo_frame: dom_id(list.model.new)}
= add_person_relation_link new_polymorphic_path([entry, name_of_obj(list).to_sym]), list.model_name.collection, data: { turbo_frame: dom_id(list.model.new)}
%div.border.rounded.border
%turbo-frame{id: dom_id(list.model.new)}
%turbo-frame{id: name_of_obj(list)}
Expand Down
12 changes: 12 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,17 @@ de:
single: ledig
widowed: verwitwet
people:
activities:
link:
add: Neue Station
advanced_trainings:
link:
add: Neue Weiterbildung
cv:
no_skills_rated_msg: Dieses Profil hat noch keine bewerteten Skills. Gehe zum Skills Tab und bewerte die für dich relevanten Skills.
educations:
link:
add: Neue Ausbildung
export_cv:
export_form:
anonymised_cv: Anonymisierter CV
Expand Down Expand Up @@ -206,6 +215,9 @@ de:
core_competences: Kernkompetenzen
personals: Personalien
upload_image: Bild hochladen
projects:
link:
add: Neues Projekt
scroll_to_menu:
activities: Station
advanced-trainings: Weiterbildungen
Expand Down
12 changes: 12 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,17 @@ en:
single: single
widowed: widowed
people:
activities:
link:
add: New station
advanced_trainings:
link:
add: New further training
cv:
no_skills_rated_msg: This profile has no rated skills yet. Go to the Skills tab and rate the skills relevant to you.
educations:
link:
add: New education
export_cv:
export_form:
anonymised_cv: Anonymized CV
Expand Down Expand Up @@ -202,6 +211,9 @@ en:
core_competences: Core competencies
personals: Personal details
upload_image: Upload image
projects:
link:
add: New project
scroll_to_menu:
activities: Station
advanced-trainings: Further training
Expand Down
12 changes: 12 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,17 @@ fr:
single: célibataire
widowed: veuf/veuve
people:
activities:
link:
add: Nouvelle station
advanced_trainings:
link:
add: Nouvelle formation continue
cv:
no_skills_rated_msg: Ce profil n'a pas encore de skills évalués. Va dans l'onglet Skills et évalue les skills qui te concernent.
educations:
link:
add: Nouvelle formation
export_cv:
export_form:
anonymised_cv: CV anonyme
Expand Down Expand Up @@ -202,6 +211,9 @@ fr:
core_competences: Compétences clés
personals: Données personnelles
upload_image: Télécharger une image
projects:
link:
add: Nouveau projet
scroll_to_menu:
activities: Station
advanced-trainings: Formations continues
Expand Down
12 changes: 12 additions & 0 deletions config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,17 @@ it:
single: singolo
widowed: vedova
people:
activities:
link:
add: Nuova Stazione
advanced_trainings:
link:
add: Nuova formazione continua
cv:
no_skills_rated_msg: Questo profilo non ha ancora competenze valutate. Andate alla scheda Competenze e valutate le competenze che vi interessano.
educations:
link:
add: Nuovo programma di formazione
export_cv:
export_form:
anonymised_cv: CV anonimo
Expand Down Expand Up @@ -202,6 +211,9 @@ it:
core_competences: Competenze di base
personals: Dati personali
upload_image: Carica immagine
projects:
link:
add: Nuovo progetto
scroll_to_menu:
activities: Stazione
advanced-trainings: Formazione continua
Expand Down

0 comments on commit 045a7ac

Please sign in to comment.