add i18n for export template

This commit is contained in:
Christophe Robillard 2024-03-15 18:20:38 +01:00 committed by simon lehericey
parent 43c862ed4d
commit 9f715e84d5
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
3 changed files with 46 additions and 5 deletions

View file

@ -1,9 +1,7 @@
.fr-grid-row.fr-grid-row--gutters
.fr-col-12.fr-col-md-8
= form_with url: form_url, model: @export_template, local: true do |f|
= render Dsfr::InputComponent.new(form: f, attribute: :name, input_type: :text_field) do |c|
- c.with_hint do
Indiquez le nom à utiliser pour ce modèle d'export
= render Dsfr::InputComponent.new(form: f, attribute: :name, input_type: :text_field)
- if groupe_instructeurs.many?
.fr-input-group
@ -19,13 +17,22 @@
= f.hidden_field :kind
.fr-input-group{ data: { controller: 'tiptap' } }
= f.label :tiptap_default_dossier_directory, class: "fr-label"
= f.label :tiptap_default_dossier_directory, class: "fr-label" do
= f.object.class.human_attribute_name(:tiptap_default_dossier_directory)
= render EditableChamp::AsteriskMandatoryComponent.new
%span.fr-hint-text
= t('activerecord.attributes.export_template.hints.tiptap_default_dossier_directory')
.tiptap-editor.fr-mt-1w{ data: { tiptap_target: 'editor' } }
= f.hidden_field :tiptap_default_dossier_directory, data: { tiptap_target: 'input', controller: 'turbo-input', turbo_input_url_value: preview_instructeur_export_templates_path }
.fr-mt-2w= render TagsButtonListComponent.new(tags: { nil => @export_template.specific_tags })
.fr-input-group{ data: { controller: 'tiptap' } }
= f.label :tiptap_pdf_name, class: "fr-label"
= f.label :tiptap_pdf_name, class: "fr-label" do
= f.object.class.human_attribute_name(:tiptap_pdf_name)
= render EditableChamp::AsteriskMandatoryComponent.new
%span.fr-hint-text
= t('activerecord.attributes.export_template.hints.tiptap_pdf_name')
.tiptap-editor.fr-mt-1w{ data: { tiptap_target: 'editor' } }
= f.hidden_field :tiptap_pdf_name, data: { tiptap_target: 'input', controller: 'turbo-input', turbo_input_url_value: preview_instructeur_export_templates_path }
.fr-mt-2w= render TagsButtonListComponent.new(tags: { nil => @export_template.specific_tags })

View file

@ -0,0 +1,17 @@
en:
activerecord:
models:
export_template: Export template
attributes:
export_template:
hints:
name: "The name will be visible by you and the other instructors"
tiptap_default_dossier_directory: "How would you like to name the directory containing the documents of a folder?"
tiptap_pdf_name: "How would you like to name the pdf file containing all the user's answers?"
name: "Template's name"
tiptap_default_dossier_directory: "Directory's name for pdf format"
tiptap_pdf_name: "Export's filename"
errors:
models:
export_template:
dossier_number_mandatory: "must contain dossier's number"

View file

@ -0,0 +1,17 @@
fr:
activerecord:
models:
export_template: "Modèle d'export"
attributes:
export_template:
hints:
name: "Le nom sera visible par vous et les autres instructeurs pour générer un export"
tiptap_default_dossier_directory: "Comment souhaitez-vous nommer le répertoire contenant les documents d'un dossier ?"
tiptap_pdf_name: "Comment souhaitez-vous nommer le fichier pdf qui contient toutes les réponses de l'usager ?"
name: "Nom du modèle"
tiptap_default_dossier_directory: Nom du répertoire
tiptap_pdf_name: "Nom du dossier au format pdf"
errors:
models:
export_template:
dossier_number_mandatory: doit contenir le numéro du dossier