Files
simple-aircraft-manager-rails/app/views/admin/settings/edit.html.erb
T
rickyandClaude Opus 5.5 89ed0a76f9 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>
2026-11-13 22:08:20 -05:00

51 lines
3.0 KiB
ERB

<% content_for :title, t(".settings") %>
<h1 class="mb-4 text-2xl font-bold"><%= t(".settings") %></h1>
<%= form_with url: admin_settings_path, method: :patch, class: "card card-body max-w-xl space-y-4" do |f| %>
<% if @errors.present? %>
<div class="rounded-md bg-red-50 p-3 text-sm text-red-700 ring-1 ring-red-200" role="alert">
<ul class="list-disc pl-5"><% @errors.each do |e| %><li><%= e %></li><% end %></ul>
</div>
<% end %>
<h2 class="card-title"><%= t(".uploads") %></h2>
<% upload = Setting::INTEGERS["max_upload_mb"] %>
<div>
<%= label_tag "settings[max_upload_mb]", Setting::LABELS["max_upload_mb"], class: "label" %>
<%= number_field_tag "settings[max_upload_mb]", @values["max_upload_mb"], id: "settings_max_upload_mb",
min: upload[:in].min, max: upload[:in].max, step: 1, required: true, class: "input w-32" %>
<p class="hint">
<%= t(".the_largest_single_file_anyone_html", default_mb: (upload[:default]), max: (upload[:in].max)) %>
</p>
<p class="hint">
<%= t(".a_proxy_in_front_of_html") %>
<%= t(".logbook_transcription_with_claude_reads_html", pdf_mb: (LogbookTranscriber::MAX_PDF_BYTES / 1.megabyte), image_mb: (LogbookTranscriber::MAX_IMAGE_BYTES / 1.megabyte)) %>
</p>
</div>
<h2 class="card-title pt-2"><%= t(".backups") %></h2>
<% kept = Setting::INTEGERS["backups_kept"] %>
<div>
<%= label_tag "settings[backups_kept]", Setting::LABELS["backups_kept"], class: "label" %>
<%= number_field_tag "settings[backups_kept]", @values["backups_kept"], id: "settings_backups_kept", min: kept[:in].min, max: kept[:in].max,
step: 1, required: true, class: "input w-32" %>
<p class="hint"><%= t(".a_verified_copy_of_the_html", link: (link_to t(".off_site_backup"), admin_offsite_backup_path, class: "link")) %></p>
</div>
<% okept = Setting::INTEGERS["offsite_backups_kept"] %>
<div>
<%= label_tag "settings[offsite_backups_kept]", Setting::LABELS["offsite_backups_kept"], class: "label" %>
<%= number_field_tag "settings[offsite_backups_kept]", @values["offsite_backups_kept"], id: "settings_offsite_backups_kept", min: okept[:in].min, max: okept[:in].max,
step: 1, required: true, class: "input w-32" %>
<p class="hint"><%= t(".with_off_site_backup_to") %></p>
</div>
<h2 class="card-title pt-2"><%= t(".document_search") %></h2>
<div>
<%= label_tag "settings[documents_claude_text]", t(".read_scanned_documents_with"), class: "label" %>
<%= select_tag "settings[documents_claude_text]", options_for_select([ [ t(".tesseract_free_on_this_server"), 0 ], [ t(".claude_better_on_handwriting_uses"), 1 ] ], @values["documents_claude_text"].to_i),
id: "settings_documents_claude_text", class: "input" %>
<p class="hint"><%= t(".text_in_documents_is_read_html", blank: (t(".it_isn_t") if ENV["ANTHROPIC_API_KEY"].blank?)) %></p>
</div>
<div class="flex gap-2"><%= f.submit t(".save_settings"), class: "btn-primary" %><%= link_to t(".cancel"), admin_about_path, class: "btn-secondary" %></div>
<% end %>