Skip to content

Commit

Permalink
Merge pull request #3438 from manyfold3d/file-pattern-translations
Browse files Browse the repository at this point in the history
Add translations for bulk file renaming fields
  • Loading branch information
Floppy authored Jan 20, 2025
2 parents b3ccb85 + 20efc1c commit 5b1b561
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 10 deletions.
8 changes: 4 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def card(style, title = nil, options = {}, &content)
def text_input_row(form, name, options = {})
content_tag :div, class: "row mb-3 input-group" do
safe_join [
form.label(name, class: "col-auto col-form-label"),
form.label(name, options[:label], class: "col-auto col-form-label"),
content_tag(:div, class: "col p-0") do
safe_join [
form.text_field(name, {class: "form-control"}.merge(options)),
Expand All @@ -99,7 +99,7 @@ def text_input_row(form, name, options = {})
def password_input_row(form, name, options = {})
content_tag :div, class: "row mb-3 input-group" do
safe_join [
form.label(name, class: "col-auto col-form-label"),
form.label(name, options[:label], class: "col-auto col-form-label"),
content_tag(:div, class: "col p-0") do
safe_join [
form.password_field(name, {class: "form-control"}.merge(options)),
Expand All @@ -114,7 +114,7 @@ def password_input_row(form, name, options = {})
def rich_text_input_row(form, name, options = {})
content_tag :div, class: "row mb-3 input-group" do
safe_join [
form.label(name, class: "col-auto col-form-label"),
form.label(name, options[:label], class: "col-auto col-form-label"),
content_tag(:div, class: "col p-0") do
safe_join [
form.text_area(name, class: "form-control col-auto"),
Expand All @@ -129,7 +129,7 @@ def rich_text_input_row(form, name, options = {})
def checkbox_input_row(form, name, options = {})
content_tag :div, class: "row mb-3 input-group" do
safe_join [
form.label(name, class: "col-sm-2 col-form-label"),
form.label(name, options[:label], class: "col-sm-2 col-form-label"),
content_tag(:div, class: "col-sm-10") do
content_tag(:div, class: "form-switch") do
safe_join [
Expand Down
19 changes: 13 additions & 6 deletions app/views/model_files/bulk_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,19 @@

<p class="lead"><%= t ".form_subtitle" %></p>

<%= text_input_row form, :pattern %>
<%= text_input_row form, :replacement %>

<%= checkbox_input_row form, :printed %>
<%= checkbox_input_row form, :presupported %>
<%= checkbox_input_row form, :y_up %>
<div class="row mb-3">
<div class="col col-auto mt-2">
<%= t(".rename") %>
</div>
<div class="col border p-3">
<%= text_input_row form, :pattern, label: t(".pattern") %>
<%= text_input_row form, :replacement, label: t(".replacement") %>
</div>
</div>

<%= checkbox_input_row form, :printed, label: ModelFile.human_attribute_name(:printed) %>
<%= checkbox_input_row form, :presupported, label: ModelFile.human_attribute_name(:presupported) %>
<%= checkbox_input_row form, :y_up, label: ModelFile.human_attribute_name(:y_up) %>

<%= form.submit translate(".submit"), class: "btn btn-primary" %>
<%= form.submit translate(".split"), name: "split", class: "btn btn-warning" %>
Expand Down
3 changes: 3 additions & 0 deletions config/locales/model_files/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ de:
bulk_edit:
description: 'Wähle die zu ändernden Dateien aus:'
form_subtitle: 'Wähle die Änderungen aus, die du vornehmen möchtest:'
pattern:
rename:
replacement:
select: Datei '%{name}' auswählen
select_all: Alle Dateien auswählen
split: Ausgewählte Dateien in ein neues Modell aufteilen
Expand Down
3 changes: 3 additions & 0 deletions config/locales/model_files/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ en:
bulk_edit:
description: 'Select files to change:'
form_subtitle: 'Select changes to make:'
pattern: Find
rename: Rename files
replacement: Replace with
select: Select file '%{name}'
select_all: Select all files
split: Split selected files into new model
Expand Down
3 changes: 3 additions & 0 deletions config/locales/model_files/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ es:
bulk_edit:
description: 'Seleccione los archivos que desea modificar:'
form_subtitle: 'Seleccione los cambios a realizar:'
pattern:
rename:
replacement:
select: Seleccionar fichero '%{name}'
select_all: Seleccionar todos los archivos
split: Dividir los archivos seleccionados en un nuevo modelo
Expand Down
3 changes: 3 additions & 0 deletions config/locales/model_files/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ fr:
bulk_edit:
description: 'Sélectionnez les fichiers à modifier :'
form_subtitle: 'Sélectionnez les modifications à apporter :'
pattern:
rename:
replacement:
select: Sélectionner le fichier '%{name}'
select_all: Sélectionner tous les fichiers
split: Éclater les fichiers sélectionnés en un nouveau modèle
Expand Down
3 changes: 3 additions & 0 deletions config/locales/model_files/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ nl:
bulk_edit:
description: 'Selecteer bestanden om te wijzigen:'
form_subtitle: 'Selecteer aan te brengen wijzigingen:'
pattern:
rename:
replacement:
select: Selecteer bestand '%{name}'
select_all: Selecteer alle bestanden
split: Splits geselecteerde bestanden in nieuw model
Expand Down
3 changes: 3 additions & 0 deletions config/locales/model_files/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ pl:
bulk_edit:
description: 'Wybierz pliki do zmiany:'
form_subtitle: 'Wybierz zmiany do wprowadzenia:'
pattern:
rename:
replacement:
select: Zaznacz plik '%{name}'
select_all: Zaznacz wszystkie pliki
split: Rozdziel wybrane pliki na nowy model
Expand Down

0 comments on commit 5b1b561

Please sign in to comment.