mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
- 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>
21 lines
1.8 KiB
ERB
21 lines
1.8 KiB
ERB
<%= form_with model: note, url: note.new_record? ? aircraft_notes_path(aircraft) : aircraft_note_path(aircraft, note), class: "card card-body space-y-4 max-w-2xl" do |f| %>
|
|
<%= f.errors_summary %>
|
|
<div data-controller="markdown-editor" data-markdown-editor-url-value="<%= preview_aircraft_notes_path(aircraft) %>">
|
|
<div class="mb-1 flex items-end justify-between gap-2">
|
|
<%= f.label :text, t(".note"), class: "block text-sm font-medium text-slate-700" %>
|
|
<div class="flex gap-1 text-xs" role="tablist">
|
|
<button type="button" role="tab" data-markdown-editor-target="writeTab" data-action="markdown-editor#write" class="rounded px-2 py-1 font-medium"><%= t(".write") %></button>
|
|
<button type="button" role="tab" data-markdown-editor-target="previewTab" data-action="markdown-editor#preview" class="rounded px-2 py-1 font-medium"><%= t(".preview") %></button>
|
|
</div>
|
|
</div>
|
|
<%= f.text_area :text, rows: 8, autofocus: true, class: "input font-mono text-sm", data: { markdown_editor_target: "input" },
|
|
placeholder: t(".bold_italic_lists_checklists_links") %>
|
|
<div data-markdown-editor-target="output" hidden class="min-h-[10rem] rounded-md p-3 text-sm ring-1 ring-slate-300"></div>
|
|
<% if note.errors[:text].any? %><p class="mt-1 text-sm text-red-600"><%= note.errors.full_messages_for(:text).to_sentence %></p><% end %>
|
|
<p class="hint mt-1"><%= t(".markdown_works_bold_italic_headings") %></p>
|
|
</div>
|
|
<%= f.field :public, as: :checkbox, label: t(".show_on_share_links") %>
|
|
<div class="flex gap-2"><%= f.submit t(".save_note") %><%= link_to t(".cancel"), aircraft_notes_path(aircraft), class: "btn-secondary" %></div>
|
|
<% end %>
|
|
<% if note.persisted? %><div class="mt-4"><%= delete_button t(".delete_note"), aircraft_note_path(aircraft, note) %></div><% end %>
|