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 "pagy", "~> 9.0"
gem "csv", "~> 3.3" 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) rails-html-sanitizer (1.6.0)
loofah (~> 2.21) loofah (~> 2.21)
nokogiri (~> 1.14) nokogiri (~> 1.14)
rails-i18n (7.0.9)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (7.2.1) railties (7.2.1)
actionpack (= 7.2.1) actionpack (= 7.2.1)
activesupport (= 7.2.1) activesupport (= 7.2.1)
@@ -379,6 +382,7 @@ DEPENDENCIES
puma (>= 5.0) puma (>= 5.0)
pwned pwned
rails (~> 7.2.0, >= 7.2.0) rails (~> 7.2.0, >= 7.2.0)
rails-i18n (~> 7.0)
redis (>= 4.0.1) redis (>= 4.0.1)
rubocop-rails-omakase rubocop-rails-omakase
selenium-webdriver selenium-webdriver

View File

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

View File

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

View File

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

View File

@@ -24,6 +24,7 @@ module Plottservice
# config.time_zone = "Central Time (US & Canada)" # config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras") # 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
end end

View File

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