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

+14 -15
View File
@@ -7,30 +7,29 @@
<%= f.field :serial_number %>
<%= f.field :purchased, as: :date %>
<%= f.field :status, as: :select, collection: Aircraft::STATUSES.invert %>
<%= f.field :icao_type, label: "ICAO type", placeholder: "C150", maxlength: 4, hint: "Type designator, used for AirTrail." %>
<%= f.field :icao_type, label: t(".icao_type"), placeholder: "C150", maxlength: 4, hint: t(".type_designator_used_for_airtrail") %>
</div>
<%= f.field :description, as: :textarea, rows: 3 %>
<div class="grid gap-4 sm:grid-cols-4">
<% if aircraft.new_record? %>
<%= f.field :tach_time, as: :number, step: 0.1, label: "Current tach" %>
<%= f.field :hobbs_time, as: :number, step: 0.1, label: "Current hobbs" %>
<%= f.field :tach_time, as: :number, step: 0.1, label: t(".current_tach") %>
<%= f.field :hobbs_time, as: :number, step: 0.1, label: t(".current_hobbs") %>
<% end %>
<%= f.field :tach_time_offset, as: :number, step: 0.1, hint: "Subtracted from tach for maintenance math (e.g. after a tach replacement)." %>
<%= f.field :hobbs_time_offset, as: :number, step: 0.1, hint: "The same, for Hobbs." %>
<%= f.field :tach_time_offset, as: :number, step: 0.1, hint: t(".subtracted_from_tach_for_maintenance") %>
<%= f.field :hobbs_time_offset, as: :number, step: 0.1, hint: t(".the_same_for_hobbs") %>
</div>
<%= f.field :time_basis, as: :select, label: "Maintenance clock", collection: Aircraft::TIME_BASES.invert,
hint: "The clock used as time in service for inspections, ADs and component times (14 CFR 1.1 defines it as takeoff to landing). " \
"Changing it doesn't convert hours already recorded against the other clock." %>
<%= f.field :time_basis, as: :select, label: t(".maintenance_clock"), collection: Aircraft::TIME_BASES.invert,
hint: t(".the_clock_used_as_time") %>
<% unless aircraft.new_record? %>
<p class="hint">To change hours use “Update Hours” on the overview, so component times stay in sync.</p>
<p class="hint"><%= t(".to_change_hours_use_update") %></p>
<% end %>
<%= f.field :picture, as: :file, accept: "image/*" %>
<%= f.field :electronic_records_since, as: :date, label: "Electronic records since", wrapper: { class: "max-w-xs" },
hint: "The date this app became the maintenance record. Earlier records stay in the paper logbooks (mark their scans as legacy records)." %>
<%= f.field :airworthiness_enforcement, as: :checkbox, label: "Enforce airworthiness",
hint: "Block flight logs and hours updates while the aircraft shows Grounded." %>
<%= f.field :electronic_records_since, as: :date, label: t(".electronic_records_since"), wrapper: { class: "max-w-xs" },
hint: t(".the_date_this_app_became") %>
<%= f.field :airworthiness_enforcement, as: :checkbox, label: t(".enforce_airworthiness"),
hint: t(".block_flight_logs_and_hours") %>
<div class="flex gap-2">
<%= f.submit aircraft.new_record? ? "Add Aircraft" : "Save" %>
<%= link_to "Cancel", aircraft.new_record? ? root_path : aircraft_path(aircraft), class: "btn-secondary" %>
<%= f.submit aircraft.new_record? ? t(".add_aircraft") : t(".save") %>
<%= link_to t(".cancel"), aircraft.new_record? ? root_path : aircraft_path(aircraft), class: "btn-secondary" %>
</div>
<% end %>