Initial i18n localization

This commit is contained in:
2024-09-17 18:18:32 +02:00
parent 8bef03c2ce
commit 03b1158e7a
7 changed files with 25 additions and 19 deletions

View File

@@ -86,3 +86,7 @@ gem "action_policy", "~> 0.7.1"
gem "pagy", "~> 9.0"
gem "csv", "~> 3.3"
# Centralization of locale data collection for Ruby on Rails.
# URL: https://github.com/svenfuchs/rails-i18n
gem "rails-i18n", "~> 7.0"

View File

@@ -234,6 +234,9 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
rails-i18n (7.0.9)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (7.2.1)
actionpack (= 7.2.1)
activesupport (= 7.2.1)
@@ -379,6 +382,7 @@ DEPENDENCIES
puma (>= 5.0)
pwned
rails (~> 7.2.0, >= 7.2.0)
rails-i18n (~> 7.0)
redis (>= 4.0.1)
rubocop-rails-omakase
selenium-webdriver

View File

@@ -38,21 +38,13 @@
</td>
<% end %>
<td class="p-2 py-3 text-right">
<% if job.printing? %>
<%= link_to edit_operator_job_path(job), target: "_top" do %>
<span class="badge badge-hover">
<%= job.costum_qm_plan.round(2) %> m²
</span>
<% end %>
<% else %>
<span class="badge">
<%= job.costum_qm_plan.round(2) %> m²
<%= number_with_delimiter job.costum_qm_plan.round(2) %> m²
</span>
<% end %>
</td>
<td class="w-24 p-2 py-3 text-right">
<span class="badge">
<%= job.cost %>
<%= number_to_currency job.cost, locale: :de %>
</span>
</td>
<td class="p-2 py-3">

View File

@@ -40,12 +40,12 @@
</td>
<td class="p-2 py-3 text-right">
<span class="badge">
<%= job.costum_qm_plan.round(2) %> m²
<%= number_with_delimiter job.costum_qm_plan.round(2) %> m²
</span>
</td>
<td class="w-24 p-2 py-3 text-right">
<span class="badge">
<%= job.cost %>
<%= number_to_currency job.cost, locale: :de %>
</span>
</td>
<td class="p-2 py-3">

View File

@@ -52,18 +52,18 @@
<% if job.printing? %>
<%= link_to edit_operator_job_path(job) do %>
<span class="badge badge-hover">
<%= job.costum_qm_plan.round(2) %> m²
<%= number_with_delimiter job.costum_qm_plan.round(2) %> m²
</span>
<% end %>
<% else %>
<span class="badge">
<%= job.costum_qm_plan.round(2) %> m²
<%= number_with_delimiter job.costum_qm_plan.round(2) %> m²
</span>
<% end %>
</td>
<td class="w-24 p-2 py-3 text-right">
<span class="badge">
<%= job.cost %>
<%= number_to_currency job.cost, locale: :de %>
</span>
</td>
<td class="p-2 py-3">

View File

@@ -24,6 +24,7 @@ module Plottservice
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
# config.i18n.default_locale = :de
config.i18n.available_locales = [ :en, :de ]
config.i18n.default_locale = :de
end
end

View File

@@ -31,10 +31,15 @@ de:
activerecord:
attributes:
job:
pdf: "PDF Dokument"
pdf: "Plan (PDF Format)"
privacy_policy: "Datenschutzerklärung"
costumer_firstname: "Vorname"
costumer_lastname: "Nachname"
errors:
models:
job:
attributes:
pdf:
blank: "is erforderlich"