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
@@ -14,7 +14,7 @@ class Admin::ProceduresController < ApplicationController
|
||||
if @policy.update(params.require(:recordkeeping_policy).permit(:operator_name, :responsible_name, :responsible_title, :hosting_description,
|
||||
:offsite_backup_description, :audit_interval_months, :audit_sample_size,
|
||||
:additional_procedures))
|
||||
redirect_to admin_procedures_path, notice: "Saved. Review the draft and adopt it as a new revision when it's right."
|
||||
redirect_to admin_procedures_path, notice: t("flash.admin_procedures.saved_review_the_draft")
|
||||
else
|
||||
@revisions = ProceduresRevision.latest_first
|
||||
render :show, status: :unprocessable_entity
|
||||
@@ -29,14 +29,14 @@ class Admin::ProceduresController < ApplicationController
|
||||
def adopt
|
||||
policy = RecordkeepingPolicy.current
|
||||
if policy.unfilled_fields.any?
|
||||
return redirect_to(admin_procedures_path, alert: "Fill in the [bracketed] blanks first: #{policy.unfilled_fields.to_sentence}.")
|
||||
return redirect_to(admin_procedures_path, alert: t("flash.admin_procedures.fill_in_the_bracketed", items: policy.unfilled_fields.to_sentence))
|
||||
end
|
||||
return redirect_to(admin_procedures_path, alert: "Fill in the operator, responsible person, hosting and off-site backup (or connect Google Drive) first.") unless policy.complete?
|
||||
return redirect_to(admin_procedures_path, alert: t("flash.admin_procedures.fill_in_the_operator")) unless policy.complete?
|
||||
number = (ProceduresRevision.maximum(:number) || 0) + 1
|
||||
revision = ProceduresRevision.create!(number: number, adopted_by: current_user, adopted_at: Time.current,
|
||||
summary: params[:summary].to_s.strip.first(500).presence || "Revision #{number}",
|
||||
content: draft_html(number: number, summary: params[:summary].to_s.strip.first(500)))
|
||||
redirect_to admin_procedures_path, notice: "Revision #{revision.number} adopted. Print it or keep the PDF with your records."
|
||||
redirect_to admin_procedures_path, notice: t("flash.admin_procedures.revision_adopted_print_it", number: revision.number)
|
||||
end
|
||||
|
||||
def revision
|
||||
@@ -48,7 +48,7 @@ class Admin::ProceduresController < ApplicationController
|
||||
|
||||
def draft_html(number: nil, summary: nil)
|
||||
render_to_string(partial: "admin/procedures/document",
|
||||
locals: { policy: RecordkeepingPolicy.current, number: number || "#{(ProceduresRevision.maximum(:number) || 0) + 1} (draft)",
|
||||
locals: { policy: RecordkeepingPolicy.current, number: number || t("flash.admin_procedures.draft_number", number: (ProceduresRevision.maximum(:number) || 0) + 1),
|
||||
adopted_at: number ? Time.current : nil, adopted_by: number ? current_user : nil,
|
||||
revisions: ProceduresRevision.latest_first.to_a, summary: summary })
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user