mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15: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
@@ -35,8 +35,8 @@ class ComponentsController < ApplicationController
|
||||
def create
|
||||
@component = @aircraft.components.new(component_params)
|
||||
if @component.save
|
||||
log_event("component", "Component added: #{@component}")
|
||||
redirect_to aircraft_components_path(@aircraft), notice: "Component added."
|
||||
log_event("component", t("flash.components.component_added_2", component: @component))
|
||||
redirect_to aircraft_components_path(@aircraft), notice: t("flash.components.component_added")
|
||||
else
|
||||
render :new, status: :unprocessable_entity
|
||||
end
|
||||
@@ -46,8 +46,8 @@ class ComponentsController < ApplicationController
|
||||
|
||||
def update
|
||||
if @component.update(component_params)
|
||||
log_event("component", "Component updated: #{@component}")
|
||||
redirect_to aircraft_components_path(@aircraft), notice: "Component updated."
|
||||
log_event("component", t("flash.components.component_updated_2", component: @component))
|
||||
redirect_to aircraft_components_path(@aircraft), notice: t("flash.components.component_updated")
|
||||
else
|
||||
render :edit, status: :unprocessable_entity
|
||||
end
|
||||
@@ -55,8 +55,8 @@ class ComponentsController < ApplicationController
|
||||
|
||||
def destroy
|
||||
@component.destroy!
|
||||
log_event("component", "Component deleted: #{@component}")
|
||||
redirect_to aircraft_components_path(@aircraft), notice: "Component deleted."
|
||||
log_event("component", t("flash.components.component_deleted_2", component: @component))
|
||||
redirect_to aircraft_components_path(@aircraft), notice: t("flash.components.component_deleted")
|
||||
end
|
||||
|
||||
# Always zeroes hours since overhaul; reset_in_service=1 also zeroes the
|
||||
@@ -64,8 +64,8 @@ class ComponentsController < ApplicationController
|
||||
def reset_service
|
||||
replaced = params[:reset_in_service] == "1"
|
||||
@component.reset_service!(reset_in_service: replaced)
|
||||
log_event("component", "#{replaced ? 'Replaced' : 'Serviced'}: #{@component}")
|
||||
redirect_to aircraft_components_path(@aircraft), notice: "#{@component} #{replaced ? 'replaced' : 'serviced'}."
|
||||
log_event("component", t(replaced ? "flash.components.replaced_event" : "flash.components.serviced_event", component: @component))
|
||||
redirect_to aircraft_components_path(@aircraft), notice: t(replaced ? "flash.components.replaced" : "flash.components.serviced", component: @component)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in new issue
Block a user