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

+24 -24
View File
@@ -1,9 +1,9 @@
<% content_for :title, "#{@aircraft.tail_number} Access" %>
<% content_for :title, t(".access", tail_number: @aircraft.tail_number) %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<h2 class="mb-4 text-lg font-semibold">Access &amp; sharing</h2>
<h2 class="mb-4 text-lg font-semibold"><%= t(".access_sharing_html") %></h2>
<div class="grid gap-5 lg:grid-cols-2">
<section class="card">
<div class="card-header"><h2 class="card-title">People</h2></div>
<div class="card-header"><h2 class="card-title"><%= t(".people") %></h2></div>
<table class="table">
<tbody>
<% @roles.each do |r| %>
@@ -14,66 +14,66 @@
<%= f.select :role, AircraftRole::ROLES.invert, { selected: r.role }, class: "input w-28", data: { submit_on_change: true } %>
<% end %>
</td>
<td class="text-right"><% unless r.user == current_user %><%= delete_button "Remove", aircraft_aircraft_role_path(@aircraft, r), confirm: "Remove #{r.user.display_name}'s access?" %><% end %></td>
<td class="text-right"><% unless r.user == current_user %><%= delete_button t(".remove"), aircraft_aircraft_role_path(@aircraft, r), confirm: t(".remove_s_access", display_name: r.user.display_name) %><% end %></td>
</tr>
<% end %>
</tbody>
</table>
<%= form_with url: aircraft_aircraft_roles_path(@aircraft), class: "flex flex-wrap items-end gap-2 border-t border-slate-100 p-4" do |f| %>
<div class="flex-1"><%= f.label :email_address, "Add by email", class: "label" %><%= f.email_field :email_address, class: "input", required: true %></div>
<div class="flex-1"><%= f.label :email_address, t(".add_by_email"), class: "label" %><%= f.email_field :email_address, class: "input", required: true %></div>
<%= f.select :role, AircraftRole::ROLES.invert, { selected: "pilot" }, class: "input w-28" %>
<%= f.submit "Add", class: "btn-primary" %>
<%= f.submit t(".add"), class: "btn-primary" %>
<% end %>
<p class="px-4 pb-4 hint"><strong>Owners</strong> can edit everything. <strong>Pilots</strong> can view all records, log flights, update hours, and add squawks, notes and oil/fuel.</p>
<p class="px-4 pb-4 hint"><%= t(".owners_can_edit_everything_pilots_html") %></p>
</section>
<section class="card">
<div class="card-header"><h2 class="card-title">Share Links</h2></div>
<div class="card-header"><h2 class="card-title"><%= t(".share_links") %></h2></div>
<% if @share_tokens.any? %>
<ul class="divide-y divide-slate-100">
<% @share_tokens.each do |t| %>
<li class="px-4 py-3">
<div class="flex items-center justify-between gap-2">
<div>
<span class="font-medium"><%= t.label.presence || "Untitled link" %></span>
<span class="font-medium"><%= t.label.presence || t(".untitled_link") %></span>
<%= tag.span ShareToken::PRIVILEGES[t.privilege], class: t.maintenance? ? "badge-blue" : "badge-green" %>
<% if t.expired? %><span class="badge-red">Expired</span><% end %>
<% if t.expired? %><span class="badge-red"><%= t(".expired") %></span><% end %>
</div>
<%= delete_button "Revoke", aircraft_share_token_path(@aircraft, t), confirm: "Revoke this link? Anyone using it will lose access." %>
<%= delete_button t(".revoke"), aircraft_share_token_path(@aircraft, t), confirm: t(".revoke_this_link_anyone_using") %>
</div>
<input type="text" readonly value="<%= shared_url(t.token) %>" class="input mt-2 font-mono text-xs" data-select-on-click>
<div class="mt-1 text-xs text-slate-500">Created <%= fmt_date(t.created_at.to_date) %><%= " by #{t.created_by.display_name}" if t.created_by %> · <%= t.expires_at ? "expires #{l t.expires_at, format: :short}" : "never expires" %></div>
<div class="mt-1 text-xs text-slate-500"><%= t(".created_html", to_date: (fmt_date(t.created_at.to_date)), created_by: (" by #{t.created_by.display_name}" if t.created_by), expires: (t.expires_at ? "expires #{l t.expires_at, format: :short}" : t(".never_expires"))) %></div>
</li>
<% end %>
</ul>
<% else %>
<%= empty_state "No share links." %>
<%= empty_state t(".no_share_links") %>
<% end %>
<%= form_with model: ShareToken.new, url: aircraft_share_tokens_path(@aircraft), class: "space-y-3 border-t border-slate-100 p-4" do |f| %>
<div class="grid gap-3 sm:grid-cols-3">
<%= f.field :label, placeholder: "Mechanic, buyer…" %>
<%= f.field :privilege, as: :select, label: "Shows", collection: ShareToken::PRIVILEGES.invert %>
<%= f.field :expires_at, as: :datetime, label: "Expires (optional)" %>
<%= f.field :label, placeholder: t(".mechanic_buyer") %>
<%= f.field :privilege, as: :select, label: t(".shows"), collection: ShareToken::PRIVILEGES.invert %>
<%= f.field :expires_at, as: :datetime, label: t(".expires_optional") %>
</div>
<p class="hint"><strong>Current Status</strong>: overview, airworthiness, components, open squawks, AD/inspection status, oil & fuel, public notes and documents shared with all links. <strong>Maintenance Detail</strong> adds the full logbook, history, resolved squawks and major records.</p>
<%= f.submit "Create Share Link" %>
<p class="hint"><%= t(".current_status_overview_airworthiness_components_html") %></p>
<%= f.submit t(".create_share_link") %>
<% end %>
</section>
<section class="card lg:col-span-2">
<div class="card-header">
<div>
<h2 class="card-title">Backup &amp; transfer</h2>
<p class="hint">Everything recorded for <%= @aircraft.tail_number %>, with its files, in one .sam.zip archive. Import it from the Fleet page here or into another Simple Aircraft Manager (including the original).</p>
<h2 class="card-title"><%= t(".backup_transfer_html") %></h2>
<p class="hint"><%= t(".everything_recorded_for_with_its_html", tail_number: @aircraft.tail_number) %></p>
</div>
<%= link_to "Download .sam.zip", aircraft_export_path(@aircraft), class: "btn-secondary", data: { turbo: false } %>
<%= link_to t(".download_sam_zip"), aircraft_export_path(@aircraft), class: "btn-secondary", data: { turbo: false } %>
</div>
<div class="card-header border-t border-slate-100">
<div>
<h2 class="card-title">Records package</h2>
<p class="hint">For an FAA or NTSB request, or a buyer: every logbook entry as a PDF with its electronic signature, a signature register, the full change history, the status report, and the .sam.zip, in one ZIP with a README.</p>
<h2 class="card-title"><%= t(".records_package") %></h2>
<p class="hint"><%= t(".for_an_faa_or_ntsb") %></p>
</div>
<%= link_to "Download records package", aircraft_records_package_path(@aircraft), class: "btn-secondary", data: { turbo: false } %>
<%= link_to t(".download_records_package"), aircraft_records_package_path(@aircraft), class: "btn-secondary", data: { turbo: false } %>
</div>
</section>
</div>