From 623034647242e6aaa3be0a89816ac39d0cfe4b8e Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Tue, 29 Oct 2024 11:54:44 +0100 Subject: [PATCH 1/4] fix(trad): Typo --- config/locales/models/champs/carte_champ/en.yml | 2 +- config/locales/models/champs/decimal_number_champ/en.yml | 2 +- config/locales/models/champs/iban_champ/en.yml | 2 +- config/locales/models/champs/phone_champ/en.yml | 2 +- config/locales/models/champs/rna_champ/en.yml | 2 +- config/locales/models/champs/siret_champ/en.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/locales/models/champs/carte_champ/en.yml b/config/locales/models/champs/carte_champ/en.yml index 332657310..8b8833e29 100644 --- a/config/locales/models/champs/carte_champ/en.yml +++ b/config/locales/models/champs/carte_champ/en.yml @@ -4,4 +4,4 @@ en: champs/carte_champ: hints: value_html: | - Need help ? Check our video tutorial" + Need help ? Check our video tutorial diff --git a/config/locales/models/champs/decimal_number_champ/en.yml b/config/locales/models/champs/decimal_number_champ/en.yml index 1e324bac5..3866bd120 100644 --- a/config/locales/models/champs/decimal_number_champ/en.yml +++ b/config/locales/models/champs/decimal_number_champ/en.yml @@ -3,4 +3,4 @@ en: attributes: champs/decimal_number_champ: hints: - value: "You can enter up to 3 decimal places after the decimal point. Exemple: 3.141" + value: "You can enter up to 3 decimal places after the decimal point. Example: 3.141" diff --git a/config/locales/models/champs/iban_champ/en.yml b/config/locales/models/champs/iban_champ/en.yml index 9761a5a3a..c02db4946 100644 --- a/config/locales/models/champs/iban_champ/en.yml +++ b/config/locales/models/champs/iban_champ/en.yml @@ -9,4 +9,4 @@ en: attributes: champs/iban_champ: hints: - value: "Example (France) : FR76 1234 1234 1234 1234 1234 123" + value: "Example (France): FR76 1234 1234 1234 1234 1234 123" diff --git a/config/locales/models/champs/phone_champ/en.yml b/config/locales/models/champs/phone_champ/en.yml index c475c4f94..8a3a69310 100644 --- a/config/locales/models/champs/phone_champ/en.yml +++ b/config/locales/models/champs/phone_champ/en.yml @@ -3,4 +3,4 @@ en: attributes: champs/phone_champ: hints: - value: "Phone number must be valid. Example : 0612345678" + value: "Phone number must be valid. Example: 0612345678" diff --git a/config/locales/models/champs/rna_champ/en.yml b/config/locales/models/champs/rna_champ/en.yml index d40042092..b67542e65 100644 --- a/config/locales/models/champs/rna_champ/en.yml +++ b/config/locales/models/champs/rna_champ/en.yml @@ -15,4 +15,4 @@ en: attributes: champs/rna_champ: hints: - value: "Expected format : W123456789. Exemple : W503726238" + value: "Expected format: W123456789. Example: W503726238" diff --git a/config/locales/models/champs/siret_champ/en.yml b/config/locales/models/champs/siret_champ/en.yml index a4104f3be..9100d144f 100644 --- a/config/locales/models/champs/siret_champ/en.yml +++ b/config/locales/models/champs/siret_champ/en.yml @@ -3,4 +3,4 @@ en: attributes: champs/siret_champ: hints: - value: "Enter 14 digits. Example : 500 0012 345 6789" + value: "Enter 14 digits. Example: 500 0012 345 6789" From 340595cc861e3ef6b63af7c6e3188a605654da4b Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Tue, 29 Oct 2024 12:36:21 +0100 Subject: [PATCH 2/4] fix(trad): Remove useless entries --- .../champ_label_content_component.en.yml | 1 - .../champ_label_content_component.fr.yml | 1 - .../champ_label_content_component.html.haml | 1 - 3 files changed, 3 deletions(-) diff --git a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml index f761f5f52..ec1a56453 100644 --- a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml +++ b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml @@ -3,5 +3,4 @@ en: changes_to_save: "modifications to submit" modified_at: "modified on %{datetime}" check_content_rebased: "Information: field updated by administration. Check its content." - optional_champ: (optional) recommended_size: The recommended maximum size is %{size} characters. diff --git a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml index 4e983b829..60cf6d066 100644 --- a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml +++ b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml @@ -3,5 +3,4 @@ fr: changes_to_save: "modification à déposer" modified_at: "modifié le %{datetime}" check_content_rebased: "Information : champ actualisé par l'administration. Vérifier son contenu." - optional_champ: (facultatif) recommended_size: La taille maximale conseillée est de %{size} caractères. diff --git a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml index a6dc331f1..297b84b64 100644 --- a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml +++ b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml @@ -10,7 +10,6 @@ %span.updated-at{ class: highlight_if_unseen_class } = t('.modified_at', datetime: try_format_datetime(@champ.updated_at)) - - if @champ.rebased_at.present? && @champ.rebased_at > (@seen_at || @champ.updated_at) && current_user.owns_or_invite?(@champ.dossier) %span.updated-at.highlighted = t('.check_content_rebased') From f72c55631ceaa13840d432017f454e6ee42bb177 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Tue, 29 Oct 2024 14:39:20 +0100 Subject: [PATCH 3/4] fix(trad): Add traduction to supporting document --- app/views/shared/_piece_justificative_template.html.haml | 2 +- config/locales/views/shared/en.yml | 3 +++ config/locales/views/shared/fr.yml | 3 +++ .../piece_justificative_component_spec.rb | 4 ++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/shared/_piece_justificative_template.html.haml b/app/views/shared/_piece_justificative_template.html.haml index 1f45bb7ab..9dbc8d2b7 100644 --- a/app/views/shared/_piece_justificative_template.html.haml +++ b/app/views/shared/_piece_justificative_template.html.haml @@ -1 +1 @@ -= render Dsfr::DownloadComponent.new(attachment: champ.type_de_champ.piece_justificative_template, url: champs_piece_justificative_template_path(champ.dossier, champ.stable_id, row_id: champ.row_id), name: "Modèle à télécharger", ephemeral_link: administrateur_signed_in? ) += render Dsfr::DownloadComponent.new(attachment: champ.type_de_champ.piece_justificative_template, url: champs_piece_justificative_template_path(champ.dossier, champ.stable_id, row_id: champ.row_id), name: t('views.shared.piece_justificative.name'), ephemeral_link: administrateur_signed_in? ) diff --git a/config/locales/views/shared/en.yml b/config/locales/views/shared/en.yml index 749f4bc18..28605257e 100644 --- a/config/locales/views/shared/en.yml +++ b/config/locales/views/shared/en.yml @@ -23,3 +23,6 @@ en: signin: 'Sign in' messages: remove_file: 'Remove file' + piece_justificative: + name: "Download template" + title: "Download template %{filename}" diff --git a/config/locales/views/shared/fr.yml b/config/locales/views/shared/fr.yml index 803f7c726..36c4f2b9b 100644 --- a/config/locales/views/shared/fr.yml +++ b/config/locales/views/shared/fr.yml @@ -24,3 +24,6 @@ fr: messages: remove_file: 'Supprimer le fichier' remove_all: "Supprimer tous les fichiers" + piece_justificative: + name: "Télécharger le modèle" + title: "Télécharger le modèle %{filename}" diff --git a/spec/components/editable_champ/piece_justificative_component/piece_justificative_component_spec.rb b/spec/components/editable_champ/piece_justificative_component/piece_justificative_component_spec.rb index 2da24b79a..e8310aed0 100644 --- a/spec/components/editable_champ/piece_justificative_component/piece_justificative_component_spec.rb +++ b/spec/components/editable_champ/piece_justificative_component/piece_justificative_component_spec.rb @@ -22,14 +22,14 @@ describe EditableChamp::PieceJustificativeComponent, type: :component do end it 'renders a link to template' do - expect(subject).to have_link('Modèle à télécharger') + expect(subject).to have_link('Télécharger le modèle') expect(subject).not_to have_text("éphémère") end context 'as an administrator' do let(:profil) { :administrateur } it 'warn about ephemeral template url' do - expect(subject).to have_link('Modèle à télécharger') + expect(subject).to have_link('Télécharger le modèle') expect(subject).to have_text("éphémère") end end From 54c9e46df07dba20cdb5379016ade7f2bbc746fc Mon Sep 17 00:00:00 2001 From: mfo Date: Wed, 30 Oct 2024 09:50:59 +0100 Subject: [PATCH 4/4] feat(shared/_piece_justificative_template): forward traduction for better naming of download title element Co-Authored-By: Corinne Durrmeyer --- app/components/dsfr/download_component.rb | 5 +++-- app/views/shared/_piece_justificative_template.html.haml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/components/dsfr/download_component.rb b/app/components/dsfr/download_component.rb index 02697b5f1..b576c843e 100644 --- a/app/components/dsfr/download_component.rb +++ b/app/components/dsfr/download_component.rb @@ -9,7 +9,7 @@ class Dsfr::DownloadComponent < ApplicationComponent attr_reader :new_tab attr_reader :truncate - def initialize(attachment:, name: nil, url: nil, ephemeral_link: false, virus_not_analyzed: false, new_tab: false, truncate: false) + def initialize(attachment:, name: nil, url: nil, ephemeral_link: false, virus_not_analyzed: false, new_tab: false, truncate: false, title: nil) @attachment = attachment @name = name || attachment.filename.to_s @url = url @@ -17,10 +17,11 @@ class Dsfr::DownloadComponent < ApplicationComponent @virus_not_analyzed = virus_not_analyzed @new_tab = new_tab @truncate = truncate + @title = title end def title - t(".title", filename: attachment.filename.to_s) + @title || t(".title", filename: attachment.filename.to_s) end def url diff --git a/app/views/shared/_piece_justificative_template.html.haml b/app/views/shared/_piece_justificative_template.html.haml index 9dbc8d2b7..6a6c0226f 100644 --- a/app/views/shared/_piece_justificative_template.html.haml +++ b/app/views/shared/_piece_justificative_template.html.haml @@ -1 +1 @@ -= render Dsfr::DownloadComponent.new(attachment: champ.type_de_champ.piece_justificative_template, url: champs_piece_justificative_template_path(champ.dossier, champ.stable_id, row_id: champ.row_id), name: t('views.shared.piece_justificative.name'), ephemeral_link: administrateur_signed_in? ) += render Dsfr::DownloadComponent.new(attachment: champ.type_de_champ.piece_justificative_template, url: champs_piece_justificative_template_path(champ.dossier, champ.stable_id, row_id: champ.row_id), name: t('views.shared.piece_justificative.name'), ephemeral_link: administrateur_signed_in?, title: t('views.shared.piece_justificative.title', filename: champ.type_de_champ.piece_justificative_template.blob.filename.to_s) )