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

+9 -9
View File
@@ -1,24 +1,24 @@
<% content_for :title, "#{@aircraft.tail_number} Oil & Fuel" %>
<% content_for :title, t(".oil_fuel", tail_number: @aircraft.tail_number) %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<%= render "shared/oil_subnav", aircraft: @aircraft %>
<div class="grid gap-5 lg:grid-cols-2">
<% [@oil, @fuel].each do |stats| %>
<section class="card">
<div class="card-header">
<h2 class="card-title"><%= stats.oil? ? "Oil Consumption" : "Fuel Burn" %></h2>
<%= link_to "+ Add #{stats.oil? ? 'Oil' : 'Fuel'}", new_aircraft_consumable_record_path(@aircraft, type: stats.record_type), class: "btn-secondary btn-sm" %>
<h2 class="card-title"><%= stats.oil? ? t(".oil_consumption") : t(".fuel_burn") %></h2>
<%= link_to t(stats.oil? ? ".add_oil" : ".add_fuel"), new_aircraft_consumable_record_path(@aircraft, type: stats.record_type), class: "btn-secondary btn-sm" %>
</div>
<div class="card-body">
<div class="mb-3 flex flex-wrap gap-x-6 gap-y-1 text-sm">
<div><span class="text-2xl font-semibold"><%= stats.recent || "—" %></span> <span class="text-slate-500"><%= stats.metric_label %>, last ~<%= stats.recent_window_hours %> hrs</span></div>
<div><span class="text-lg"><%= stats.lifetime || "—" %></span> <span class="text-slate-500">lifetime</span></div>
<div><span class="text-2xl font-semibold"><%= stats.recent || "—" %></span> <span class="text-slate-500"><%= t(".last_hrs_html", metric_label: stats.metric_label, recent_window_hours: stats.recent_window_hours) %></span></div>
<div><span class="text-lg"><%= stats.lifetime || "—" %></span> <span class="text-slate-500"><%= t(".lifetime") %></span></div>
</div>
<% if stats.points.size >= 2 %>
<%= line_chart stats.chart_data, xtitle: "Tach hours", ytitle: stats.metric_label, height: "220px", curve: false, points: false,
library: { scales: { x: { type: "linear" } } }, colors: [stats.oil? ? "#b45309" : "#0369a1"] %>
<p class="hint">Rolling <%= stats.chart_window_hours %>-hour window: total <%= stats.oil? ? "oil" : "fuel" %> added ÷ hours flown, so partial fills average out.<%= " Higher is better." if stats.oil? %></p>
<p class="hint"><%= t(".rolling_hour_window_total_added_html", chart_window_hours: stats.chart_window_hours, fuel: (stats.oil? ? "oil" : "fuel"), oil: (t(".higher_is_better") if stats.oil?)) %></p>
<% else %>
<%= empty_state "Not enough history yet (need more than #{stats.chart_window_hours} tach hours of records)." %>
<%= empty_state t(".not_enough_history_yet_need", chart_window_hours: stats.chart_window_hours) %>
<% end %>
</div>
</section>
@@ -26,10 +26,10 @@
</div>
<section class="card mt-5">
<div class="card-header"><h2 class="card-title">Records</h2></div>
<div class="card-header"><h2 class="card-title"><%= t(".records") %></h2></div>
<% if @records.any? %>
<%= render "consumable_records/records", records: @records, page: @page, more: @more %>
<% else %>
<%= empty_state "No oil or fuel records yet." %>
<%= empty_state t(".no_oil_or_fuel_records") %>
<% end %>
</section>