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,4 +1,4 @@
|
||||
<% content_for :title, "AD Import Preview" %>
|
||||
<% content_for :title, t(".ad_import_preview") %>
|
||||
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
||||
<% rows = @import.rows %>
|
||||
<%= form_with url: confirm_aircraft_ad_import_path(@aircraft), class: "space-y-5" do |f| %>
|
||||
@@ -6,17 +6,17 @@
|
||||
<%= hidden_field_tag :filename, @filename %>
|
||||
<section class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">Preview: <%= @filename %></h2>
|
||||
<span class="text-xs text-slate-500"><%= pluralize(rows.size, "AD") %> found · <%= rows.count(&:url) %> with DRS links</span>
|
||||
<h2 class="card-title"><%= t(".preview_html", filename: @filename) %></h2>
|
||||
<span class="text-xs text-slate-500"><%= t(".found_with_drs_links_html", rows: (t("counts.ad", count: rows.size)), url: (rows.count(&:url))) %></span>
|
||||
</div>
|
||||
<div class="card-body space-y-3 text-sm">
|
||||
<% if rows.none?(&:url) %><p class="rounded-md bg-amber-50 px-3 py-2 text-amber-900 ring-1 ring-amber-200">This file has no links to the AD documents. DRS's <strong>Excel</strong> export includes them; import that file instead (or afterwards) to get clickable AD numbers.</p><% end %>
|
||||
<p>Choose what to do with each AD. The suggestions are based on the FAA data and your aircraft's model (<%= @aircraft.model.presence || "not set" %>); you make the call.</p>
|
||||
<% if rows.none?(&:url) %><p class="rounded-md bg-amber-50 px-3 py-2 text-amber-900 ring-1 ring-amber-200"><%= t(".this_file_has_no_links_html") %></p><% end %>
|
||||
<p><%= t(".choose_what_to_do_with_html", model: (@aircraft.model.presence || t(".not_set"))) %></p>
|
||||
<ul class="list-disc space-y-1 pl-5 text-xs text-slate-600">
|
||||
<li><strong>Track</strong>: adds the AD. Until you record compliance, it counts against airworthiness, so <%= @aircraft.tail_number %> will show <span class="badge-red">Grounded</span> while any tracked AD has no compliance record.</li>
|
||||
<li><strong>Not applicable</strong>: adds the AD with an N/A record (e.g. the equipment isn't installed). You can edit the reason afterwards.</li>
|
||||
<li><strong>Update</strong> (ADs already tracked): refreshes the FAA details: subject, summary, dates, supersession and DRS link. Compliance records aren't touched.</li>
|
||||
<li><strong>Skip</strong>: not imported, or left exactly as is.</li>
|
||||
<li><%= t(".track_adds_the_ad_until_html", tail_number: @aircraft.tail_number) %> <span class="badge-red"><%= t(".grounded") %></span> <%= t(".while_any_tracked_ad_has") %></li>
|
||||
<li><%= t(".not_applicable_adds_the_ad_html") %></li>
|
||||
<li><%= t(".update_ads_already_tracked_refreshes_html") %></li>
|
||||
<li><%= t(".skip_not_imported_or_left_html") %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
@@ -24,21 +24,21 @@
|
||||
<section class="card">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table">
|
||||
<thead><tr><th>AD</th><th>Subject</th><th>Effective</th><th>Notes</th><th class="w-44">Action</th></tr></thead>
|
||||
<thead><tr><th><%= t(".ad") %></th><th><%= t(".subject") %></th><th><%= t(".effective") %></th><th><%= t(".notes") %></th><th class="w-44"><%= t(".action") %></th></tr></thead>
|
||||
<tbody>
|
||||
<% rows.each do |r| %>
|
||||
<tr>
|
||||
<td class="whitespace-nowrap font-medium"><%= r.number %><%= link_to " 🔗", r.url, target: "_blank", rel: "noopener noreferrer", title: "Link found in file" if r.url %>
|
||||
<td class="whitespace-nowrap font-medium"><%= r.number %><%= link_to " 🔗", r.url, target: "_blank", rel: "noopener noreferrer", title: t(".link_found_in_file") if r.url %>
|
||||
<% if r.product_type %><div class="text-xs font-normal text-slate-500"><%= r.product_type %></div><% end %></td>
|
||||
<td class="max-w-md">
|
||||
<%= r.subject %>
|
||||
<% if r.summary %><details class="mt-1 text-xs text-slate-600"><summary class="cursor-pointer text-sky-700">Summary</summary><%= r.summary %></details><% end %>
|
||||
<% if r.summary %><details class="mt-1 text-xs text-slate-600"><summary class="cursor-pointer text-sky-700"><%= t(".summary") %></summary><%= r.summary %></details><% end %>
|
||||
</td>
|
||||
<td class="whitespace-nowrap text-xs"><%= fmt_date(r.effective_date) %></td>
|
||||
<td class="text-xs">
|
||||
<% r.notes.each do |n| %><div class="<%= n.start_with?("Already", "Matches") ? 'text-slate-500' : 'text-amber-800' %>">• <%= n %></div><% end %>
|
||||
<% r.notes.each do |n| %><div class="<%= n.start_with?(t(".already"), t(".matches")) ? 'text-slate-500' : 'text-amber-800' %>">• <%= n %></div><% end %>
|
||||
</td>
|
||||
<td><% choices = r.tracked ? [ [ "Update", "track" ], [ "Not applicable", "na" ], [ "Skip (leave as is)", "skip" ] ] : AdImport::ACTIONS.invert %>
|
||||
<td><% choices = r.tracked ? [ [ t(".update"), "track" ], [ t(".not_applicable"), "na" ], [ t(".skip_leave_as_is"), "skip" ] ] : AdImport::ACTIONS.invert %>
|
||||
<%= select_tag "decisions[#{r.number}]", options_for_select(choices, r.suggested), class: "input" %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -48,7 +48,7 @@
|
||||
</section>
|
||||
|
||||
<div class="flex gap-2">
|
||||
<%= f.submit "Import ADs", class: "btn-primary", data: { turbo_confirm: "Import these ADs to #{@aircraft.tail_number}?" } %>
|
||||
<%= link_to "Upload a different file", new_aircraft_ad_import_path(@aircraft), class: "btn-secondary" %>
|
||||
<%= f.submit t(".import_ads"), class: "btn-primary", data: { turbo_confirm: t(".import_these_ads_to", tail_number: @aircraft.tail_number) } %>
|
||||
<%= link_to t(".upload_a_different_file"), new_aircraft_ad_import_path(@aircraft), class: "btn-secondary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
Reference in new issue
Block a user