Move all user-facing text into config/locales/en.yml for localization

- Views use lazy t(".key") lookups; sentences with values or links stay
  whole (interpolation, _html keys); counts use one/other plurals
- Stored-value labels (statuses, types, priorities...) are LabelSets read
  from labels: in the current locale; field names and validation messages
  under activerecord:; flash and activity text under flash:
- Services, models, helpers, mailer subjects, the logbook PDF, procedures
  templates, records package README and transcription warnings localized;
  the PDF reuses LogbookEntry#certification_statement instead of a copy
- Scripts read js: strings from a JSON tag via app/javascript/i18n.js
- Dates through I18n.l (app, weekday, month_year, long formats); html lang
  follows the locale
- APP_LOCALE picks the language (falls back to English); missing
  translations raise in development and tests
- README: Translating section and APP_LOCALE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-13 22:08:20 -05:00
1 parent 3f45b557c2
commit 89ed0a76f9
313 files changed
+6387 -2653

No files matched your search

@@ -1,17 +1,17 @@
<%= form_with model: [ :admin, template ], class: "card card-body max-w-3xl space-y-4" do |f| %>
<%= f.errors_summary %>
<div class="grid gap-4 sm:grid-cols-2">
<%= f.field :name, required: true, placeholder: "Oil and filter change" %>
<%= f.field :reference, placeholder: "Part 43 App. A (c)(6)", hint: "Shown next to the name, e.g. the regulation or manual paragraph." %>
<%= f.field :name, required: true, placeholder: t(".oil_and_filter_change") %>
<%= f.field :reference, placeholder: t(".part_43_app_a_c"), hint: t(".shown_next_to_the_name") %>
</div>
<%= f.field :text, as: :textarea, rows: 5, required: true, hint: "The entry text. Use __ for blanks to fill in (quantities, part numbers…)." %>
<%= f.field :text, as: :textarea, rows: 5, required: true, hint: t(".the_entry_text_use_for") %>
<div class="grid gap-4 sm:grid-cols-4">
<%= f.field :entry_type, as: :select, label: "Entry type", collection: LogbookEntry::ENTRY_TYPES.invert %>
<%= f.field :log_type, as: :select, label: "Logbook", include_blank: "— Leave as is —", collection: LogbookEntry::LOG_TYPES.invert %>
<%= f.field :certificate_type, as: :select, label: "Kind of certificate", include_blank: "— Leave as is —", collection: LogbookEntry::CERTIFICATE_TYPES.invert,
hint: "Only filled in when none is chosen yet." %>
<%= f.field :position, as: :number, label: "Order" %>
<%= f.field :entry_type, as: :select, label: t(".entry_type"), collection: LogbookEntry::ENTRY_TYPES.invert %>
<%= f.field :log_type, as: :select, label: t(".logbook"), include_blank: t(".leave_as_is"), collection: LogbookEntry::LOG_TYPES.invert %>
<%= f.field :certificate_type, as: :select, label: t(".kind_of_certificate"), include_blank: t(".leave_as_is"), collection: LogbookEntry::CERTIFICATE_TYPES.invert,
hint: t(".only_filled_in_when_none") %>
<%= f.field :position, as: :number, label: t(".order") %>
</div>
<div class="flex gap-2"><%= f.submit "Save Template" %><%= link_to "Cancel", admin_logbook_templates_path, class: "btn-secondary" %></div>
<div class="flex gap-2"><%= f.submit t(".save_template") %><%= link_to t(".cancel"), admin_logbook_templates_path, class: "btn-secondary" %></div>
<% end %>
<% if template.persisted? %><div class="mt-4"><%= delete_button "Delete template", admin_logbook_template_path(template) %></div><% end %>
<% if template.persisted? %><div class="mt-4"><%= delete_button t(".delete_template"), admin_logbook_template_path(template) %></div><% end %>
@@ -1,3 +1,3 @@
<% content_for :title, "Logbook template" %>
<h1 class="mb-4 text-2xl font-bold">Logbook template</h1>
<% content_for :title, t(".logbook_template") %>
<h1 class="mb-4 text-2xl font-bold"><%= t(".logbook_template") %></h1>
<%= render "form", template: @template %>
@@ -1,12 +1,12 @@
<% content_for :title, "Logbook templates" %>
<% content_for :title, t(".logbook_templates") %>
<div class="mb-4 flex flex-wrap items-center justify-between gap-2">
<h1 class="text-2xl font-bold">Logbook templates</h1>
<h1 class="text-2xl font-bold"><%= t(".logbook_templates") %></h1>
<div class="flex gap-2">
<%= button_to "Restore built-in templates", restore_admin_logbook_templates_path, class: "btn-secondary", title: "Add back any of the built-in preventive maintenance templates that were deleted" %>
<%= link_to "+ New Template", new_admin_logbook_template_path, class: "btn-primary" %>
<%= button_to t(".restore_built_in_templates"), restore_admin_logbook_templates_path, class: "btn-secondary", title: t(".add_back_any_of_the") %>
<%= link_to t(".new_template"), new_admin_logbook_template_path, class: "btn-primary" %>
</div>
</div>
<p class="mb-4 text-sm text-slate-600">Wording to start a logbook entry from: the "Template" list on a new entry. Use __ for blanks to fill in.</p>
<p class="mb-4 text-sm text-slate-600"><%= t(".wording_to_start_a_logbook") %></p>
<section class="card">
<% if @templates.any? %>
<ul class="divide-y divide-slate-100">
@@ -17,11 +17,11 @@
<div class="text-xs text-slate-500"><%= [ LogbookEntry::ENTRY_TYPES[t.entry_type], (t.log_type && "#{LogbookEntry::LOG_TYPES[t.log_type]} log"), (t.certificate_type && LogbookEntry::CERTIFICATE_TYPES[t.certificate_type]) ].compact.join(" · ") %></div>
<p class="mt-1 text-xs text-slate-600"><%= t.text.truncate(220) %></p>
</div>
<%= link_to "Edit", edit_admin_logbook_template_path(t), class: "btn-secondary btn-sm" %>
<%= link_to t(".edit"), edit_admin_logbook_template_path(t), class: "btn-secondary btn-sm" %>
</li>
<% end %>
</ul>
<% else %>
<%= empty_state "No templates." %>
<%= empty_state t(".no_templates") %>
<% end %>
</section>
@@ -1,3 +1,3 @@
<% content_for :title, "Logbook template" %>
<h1 class="mb-4 text-2xl font-bold">Logbook template</h1>
<% content_for :title, t(".logbook_template") %>
<h1 class="mb-4 text-2xl font-bold"><%= t(".logbook_template") %></h1>
<%= render "form", template: @template %>