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

+6 -6
View File
@@ -44,7 +44,7 @@ class DueList
def inspections
Compliance.inspection_rows(@aircraft).map do |r|
item("inspection-#{r.type.id}", "#{r.type.name} due", "inspection", @urls.aircraft_inspections_path(@aircraft),
item("inspection-#{r.type.id}", I18n.t("services.due_list.due", type: r.type.name), "inspection", @urls.aircraft_inspections_path(@aircraft),
date: r.next_due_date, hours_left: hours_left(r.next_due_hours))
end
end
@@ -52,7 +52,7 @@ class DueList
def ads
Compliance.ad_rows(@aircraft).map do |r|
next if r.status.to_s.in?(%w[not_applicable na conditional])
item("ad-#{r.ad.id}", "AD #{r.ad.name} due", "ad", @urls.aircraft_airworthiness_directives_path(@aircraft),
item("ad-#{r.ad.id}", I18n.t("services.due_list.ad_due", ad: r.ad.name), "ad", @urls.aircraft_airworthiness_directives_path(@aircraft),
date: r.next_due_date, hours_left: hours_left(r.next_due_hours))
end
end
@@ -63,19 +63,19 @@ class DueList
path = @urls.aircraft_component_path(@aircraft, c)
since_service = c.hours_since_overhaul.to_d
[
(item("replace-#{c.id}", "Replace #{label}", "component", path, date: c.next_replacement_date,
(item("replace-#{c.id}", I18n.t("services.due_list.replace", label: label), "component", path, date: c.next_replacement_date,
hours_left: c.hours_to_replacement) if c.replacement_hours || c.replacement_calendar?),
(item("tbo-#{c.id}", "#{label} reaches TBO", "component", path,
(item("tbo-#{c.id}", I18n.t("services.due_list.reaches_tbo", label: label), "component", path,
date: c.tbo_after(c.overhaul_date),
hours_left: c.tbo_hours && c.tbo_hours - since_service) if (c.tbo_hours || c.tbo_calendar?) && !c.on_condition?),
(item("expires-#{c.id}", "#{label} expires", "component", path, date: c.expires_on) if c.expires_on)
(item("expires-#{c.id}", I18n.t("services.due_list.expires", label: label), "component", path, date: c.expires_on) if c.expires_on)
]
end
end
def documents
@aircraft.documents.expiring.map do |d|
item("document-#{d.id}", "#{d.name} expires", "document", @urls.aircraft_document_path(@aircraft, d), date: d.expires_on)
item("document-#{d.id}", I18n.t("services.due_list.expires_2", d: d.name), "document", @urls.aircraft_document_path(@aircraft, d), date: d.expires_on)
end
end
end