mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
- 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>
25 lines
1.8 KiB
ERB
25 lines
1.8 KiB
ERB
<% content_for :title, t(".standard_inspections", tail_number: @aircraft.tail_number) %>
|
|
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
|
<%= form_with url: aircraft_standard_inspections_path(@aircraft), class: "card card-body max-w-3xl space-y-4" do %>
|
|
<div>
|
|
<h2 class="card-title"><%= t(".standard_inspections_2") %></h2>
|
|
<p class="mt-1 text-sm text-slate-600"><%= t(".the_recurring_inspections_and_checks_html", tail_number: @aircraft.tail_number) %></p>
|
|
</div>
|
|
<ul class="divide-y divide-slate-100 rounded-md ring-1 ring-slate-200">
|
|
<% StandardInspections::TEMPLATES.each do |t| %>
|
|
<% existing = StandardInspections.existing_for(t, @aircraft) %>
|
|
<li class="flex items-start gap-3 px-3 py-3">
|
|
<%= check_box_tag "templates[]", t.key, t.checked && !existing, id: "template_#{t.key}", disabled: existing.present?, class: "mt-1 h-4 w-4 shrink-0 rounded border-slate-300" %>
|
|
<label for="template_<%= t.key %>" class="min-w-0 flex-1 text-sm">
|
|
<span class="font-medium"><%= t.name %></span>
|
|
<span class="text-slate-500">· <%= [ (t.months && t(".every_calendar_months", months: t.months)), (t.days && "every #{t.days} days"), (t.hours && "every #{t.hours} hours") ].compact.join %></span>
|
|
<span class="block text-xs text-slate-500"><%= t(".overdue_html", who: t.who, effect: (InspectionType::EFFECT_SUMMARIES[t.effect])) %></span>
|
|
<% if existing %><span class="block text-xs text-emerald-700"><%= t(".already_tracked_as_html", existing: existing.name) %></span><% end %>
|
|
</label>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<p class="hint"><%= t(".with_both_an_annual_and") %></p>
|
|
<div class="flex gap-2"><%= submit_tag t(".add_selected"), class: "btn-primary" %><%= link_to t(".cancel"), aircraft_inspections_path(@aircraft), class: "btn-secondary" %></div>
|
|
<% end %>
|