mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
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:
1 parent
3f45b557c2
commit
89ed0a76f9
313 files changed
+6387
-2653
No files matched your search
@@ -1,8 +1,8 @@
|
||||
<%# The most recent day's flying (Overview). %>
|
||||
<section class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">Last flight</h2>
|
||||
<%= link_to "Flights →", aircraft_flight_logs_path(aircraft), class: "link text-sm" %>
|
||||
<h2 class="card-title"><%= t(".last_flight") %></h2>
|
||||
<%= link_to t(".flights"), aircraft_flight_logs_path(aircraft), class: "link text-sm" %>
|
||||
</div>
|
||||
<% if last_day %>
|
||||
<% route = last_day.flat_map { [ _1.departure_location, _1.destination_location ] }.compact_blank.chunk_while { _1 == _2 }.map(&:first) %>
|
||||
@@ -10,18 +10,18 @@
|
||||
<% fuel_after = last_day.reverse.find(&:fuel_level_after)&.fuel_level_after %>
|
||||
<% oil_after = last_day.reverse.find(&:oil_level_after)&.oil_level_after %>
|
||||
<dl class="card-body grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm">
|
||||
<dt class="text-slate-500">Date</dt>
|
||||
<dd><%= fmt_date(last_leg.date) %><%= " · #{pluralize(last_day.size, 'leg')}" if last_day.size > 1 %></dd>
|
||||
<% if route.any? %><dt class="text-slate-500">Route</dt><dd><%= route.join(" → ") %></dd><% end %>
|
||||
<dt class="text-slate-500">Flown</dt><dd><%= hours(last_day.sum { _1.tach_time.to_d }) %> hrs tach</dd>
|
||||
<% if last_leg.tach_in %><dt class="text-slate-500">Ended at</dt><dd>Tach <%= hours(last_leg.tach_in) %><%= " · Hobbs #{hours(last_leg.hobbs_in)}" if last_leg.hobbs_in %></dd><% end %>
|
||||
<% if fuel_after %><dt class="text-slate-500">Fuel after</dt><dd><%= number_with_precision(fuel_after, precision: 1, strip_insignificant_zeros: true) %> gal</dd><% end %>
|
||||
<% if oil_after %><dt class="text-slate-500">Oil after</dt><dd><%= number_with_precision(oil_after, precision: 1, strip_insignificant_zeros: true) %> qt</dd><% end %>
|
||||
<dt class="text-slate-500"><%= t(".date") %></dt>
|
||||
<dd><%= fmt_date(last_leg.date) %><%= " · #{t("counts.leg", count: last_day.size)}" if last_day.size > 1 %></dd>
|
||||
<% if route.any? %><dt class="text-slate-500"><%= t(".route") %></dt><dd><%= route.join(" → ") %></dd><% end %>
|
||||
<dt class="text-slate-500"><%= t(".flown") %></dt><dd><%= t(".hrs_tach_html", hours: (hours(last_day.sum { _1.tach_time.to_d }))) %></dd>
|
||||
<% if last_leg.tach_in %><dt class="text-slate-500"><%= t(".ended_at") %></dt><dd><%= t(".tach_html", tach_in: (hours(last_leg.tach_in)), hobbs_in: (t(".hobbs", hobbs_in: (hours(last_leg.hobbs_in))) if last_leg.hobbs_in)) %></dd><% end %>
|
||||
<% if fuel_after %><dt class="text-slate-500"><%= t(".fuel_after") %></dt><dd><%= t(".gal_html", fuel: (number_with_precision(fuel_after, precision: 1, strip_insignificant_zeros: true))) %></dd><% end %>
|
||||
<% if oil_after %><dt class="text-slate-500"><%= t(".oil_after") %></dt><dd><%= t(".qt_html", oil: (number_with_precision(oil_after, precision: 1, strip_insignificant_zeros: true))) %></dd><% end %>
|
||||
<% if (notes = last_day.filter_map { _1.notes.presence }).any? %>
|
||||
<dt class="text-slate-500">Notes</dt><dd class="whitespace-pre-line"><%= notes.join("\n") %></dd>
|
||||
<dt class="text-slate-500"><%= t(".notes") %></dt><dd class="whitespace-pre-line"><%= notes.join("\n") %></dd>
|
||||
<% end %>
|
||||
</dl>
|
||||
<% else %>
|
||||
<%= empty_state "No flights logged yet." %>
|
||||
<%= empty_state t(".no_flights_logged_yet") %>
|
||||
<% end %>
|
||||
</section>
|
||||
Reference in new issue
Block a user