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

+10 -10
View File
@@ -1,26 +1,26 @@
<p>Here's what needs attention<%= " on your aircraft" if @items.any? %>.</p>
<p><%= t(".here_s_what_needs_attention_html", any: (t(".on_your_aircraft") if @items.any?)) %></p>
<% @items.each do |aircraft, issues, alerts| %>
<h3 style="margin: 16px 0 4px;"><%= link_to aircraft.tail_number, aircraft_url(aircraft) %> <span style="font-weight: normal; color: #64748b;"><%= aircraft.airworthiness.label %></span></h3>
<ul style="margin: 0; padding-left: 20px;">
<% issues.each do |issue| %>
<li><strong><%= { "RED" => "Overdue", "LIMITED" => "Overdue", "ORANGE" => "Due soon", "INFO" => "Deferred" }[issue.severity] %>:</strong>
<li><strong><%= { "RED" => t(".overdue"), "LIMITED" => t(".overdue"), "ORANGE" => t(".due_soon"), "INFO" => t(".deferred") }[issue.severity] %>:</strong>
<%= issue.title %> <span style="color: #64748b;"><%= issue.description %></span></li>
<% end %>
</ul>
<% if alerts.any? %>
<p style="margin: 8px 0 0;"><strong><%= alerts.size %> newly published <%= "AD".pluralize(alerts.size) %> may apply:</strong>
<%= alerts.map { _1.ad_number || _1.fr_document_number }.to_sentence %>. <%= link_to "Review them", aircraft_airworthiness_directives_url(aircraft, anchor: "new-ads") %>.</p>
<p style="margin: 8px 0 0;"><%= t(".newly_published_may_apply_html", count: alerts.size) %>
<%= alerts.map { _1.ad_number || _1.fr_document_number }.to_sentence %>. <%= link_to t(".review_them"), aircraft_airworthiness_directives_url(aircraft, anchor: "new-ads") %>.</p>
<% end %>
<% end %>
<% if @certificates.any? %>
<h3 style="margin: 16px 0 4px;">Your certificates</h3>
<h3 style="margin: 16px 0 4px;"><%= t(".your_certificates") %></h3>
<ul style="margin: 0; padding-left: 20px;">
<% @certificates.each do |c| %><li><strong><%= c.expired? ? "Expired" : "Expires" %> <%= fmt_date(c.expires_on) %>:</strong> <%= c.kind_label %> <%= c.number %></li><% end %>
<% @certificates.each do |c| %><li><strong><%= c.expired? ? t(".expired") : t(".expires") %> <%= fmt_date(c.expires_on) %>:</strong> <%= c.kind_label %> <%= c.number %></li><% end %>
</ul>
<% end %>
<% if @drs_due.any? %><p><strong>Refresh the AD list from FAA DRS</strong> (new ADs are found weekly, but revisions and anything missed come from a fresh import):</p>
<ul><% @drs_due.each do |a| %><li><%= link_to a.tail_number, aircraft_airworthiness_directives_url(a) %>: <%= (m = DrsImport.missing_models(a)).any? ? "never imported for #{m.to_sentence}" : "last import #{a.drs_imports.latest_first.first&.created_at&.to_date || 'never'}" %></li><% end %></ul><% end %>
<% if @audit_due %><p><strong>Records audit due <%= @audit_due %></strong> (AC 120-78B quality control): <%= link_to "start it", new_admin_audit_url %>.</p><% end %>
<% if @drs_due.any? %><p><%= t(".refresh_the_ad_list_from_html") %></p>
<ul><% @drs_due.each do |a| %><li><%= link_to a.tail_number, aircraft_airworthiness_directives_url(a) %>: <%= (m = DrsImport.missing_models(a)).any? ? t(".never_imported_for", to_sentence: m.to_sentence) : t(".last_import", never: (a.drs_imports.latest_first.first&.created_at&.to_date || 'never')) %></li><% end %></ul><% end %>
<% if @audit_due %><p><%= t(".records_audit_due_ac_120_html", audit_due: @audit_due, link: (link_to t(".start_it"), new_admin_audit_url)) %></p><% end %>
<p style="color: #64748b; font-size: 12px; margin-top: 20px;">
Based on the records in Simple Aircraft Manager. Turn these emails off on your <%= link_to "profile", edit_profile_url %>.
<%= t(".based_on_the_records_in_html", link: (link_to "profile", edit_profile_url)) %>
</p>
+9 -9
View File
@@ -1,31 +1,31 @@
Here's what needs attention<%= " on your aircraft" if @items.any? %>.
<%= raw t(".here_s_what_needs_attention_text", any: (t(".on_your_aircraft") if @items.any?)) %>
<% @items.each do |aircraft, issues, alerts| %>
<%= aircraft.tail_number %> (<%= aircraft.airworthiness.label %>): <%= aircraft_url(aircraft) %>
<% issues.each do |issue| %>
- <%= { "RED" => "Overdue", "LIMITED" => "Overdue", "ORANGE" => "Due soon", "INFO" => "Deferred" }[issue.severity] %>: <%= issue.title %>. <%= issue.description %>
- <%= { "RED" => t(".overdue"), "LIMITED" => t(".overdue"), "ORANGE" => t(".due_soon"), "INFO" => t(".deferred") }[issue.severity] %>: <%= issue.title %>. <%= issue.description %>
<% end %>
<% if alerts.any? %>
- New ADs that may apply: <%= alerts.map { _1.ad_number || _1.fr_document_number }.to_sentence %>. Review: <%= aircraft_airworthiness_directives_url(aircraft, anchor: "new-ads") %>
<%= raw t(".new_ads_that_may_apply_text", to_sentence: (alerts.map { _1.ad_number || _1.fr_document_number }.to_sentence), ads: (aircraft_airworthiness_directives_url(aircraft, anchor: "new-ads"))) %>
<% end %>
<% end %>
<% if @certificates.any? %>
Your certificates:
<%= raw t(".your_certificates_2") %>
<% @certificates.each do |c| %>
- <%= c.expired? ? "Expired" : "Expires" %> <%= fmt_date(c.expires_on) %>: <%= c.kind_label %> <%= c.number %>
- <%= c.expired? ? t(".expired") : t(".expires") %> <%= fmt_date(c.expires_on) %>: <%= c.kind_label %> <%= c.number %>
<% end %>
<% end %>
<% if @drs_due.any? %>
AD list from FAA DRS needs a refresh:
<%= raw t(".ad_list_from_faa_drs") %>
<% @drs_due.each do |a| %>
- <%= a.tail_number %>: <%= (m = DrsImport.missing_models(a)).any? ? "never imported for #{m.to_sentence}" : "last import #{a.drs_imports.latest_first.first&.created_at&.to_date || 'never'}" %> (<%= aircraft_airworthiness_directives_url(a) %>)
- <%= a.tail_number %>: <%= (m = DrsImport.missing_models(a)).any? ? t(".never_imported_for", to_sentence: m.to_sentence) : t(".last_import", never: (a.drs_imports.latest_first.first&.created_at&.to_date || 'never')) %> (<%= aircraft_airworthiness_directives_url(a) %>)
<% end %>
<% end %>
<% if @audit_due %>
Records audit due <%= @audit_due %>: <%= new_admin_audit_url %>
<%= raw t(".records_audit_due_text", audit_due: @audit_due, new_admin_audit_url: new_admin_audit_url) %>
<% end %>
Based on the records in Simple Aircraft Manager. Turn these emails off on your profile: <%= edit_profile_url %>
<%= raw t(".based_on_the_records_in_2_text", edit_profile_url: edit_profile_url) %>