mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23: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>
44 lines
2.8 KiB
ERB
44 lines
2.8 KiB
ERB
<% content_for :title, t(".export_for_airtrail") %>
|
|
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
|
<div class="grid gap-5 lg:grid-cols-3">
|
|
<%= form_with url: aircraft_air_trail_export_path(@aircraft), class: "card card-body space-y-4 lg:col-span-2", data: { turbo: false } do |f| %>
|
|
<h2 class="card-title"><%= t(".export_flights_for_airtrail") %></h2>
|
|
<% if @export.errors.any? %>
|
|
<div class="rounded-md bg-red-50 p-3 text-sm text-red-700 ring-1 ring-red-200"><ul class="list-disc pl-5"><% @export.errors.each do |e| %><li><%= e %></li><% end %></ul></div>
|
|
<% end %>
|
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
<div>
|
|
<%= label_tag :username, t(".your_airtrail_username"), class: "label" %>
|
|
<%= text_field_tag :username, params[:username].presence || @export.as_json[:users].first[:username], class: "input", required: true, autocomplete: "off" %>
|
|
<p class="hint"><%= t(".airtrail_assigns_the_flights_to") %></p>
|
|
</div>
|
|
<div>
|
|
<%= label_tag :aircraft_type, t(".aircraft_type_icao_optional"), class: "label" %>
|
|
<%= text_field_tag :aircraft_type, params[:aircraft_type].presence || @aircraft.icao_type, class: "input", placeholder: "C150", maxlength: 4 %>
|
|
<p class="hint"><%= t(".icao_type_designator_e_g") %></p>
|
|
</div>
|
|
</div>
|
|
<fieldset class="space-y-1 text-sm">
|
|
<legend class="label"><%= t(".flights") %></legend>
|
|
<label class="flex items-center gap-2"><%= t(".all_flights_html", mine: (radio_button_tag :scope, "all", params[:scope] != "mine"), tail_number: @aircraft.tail_number) %></label>
|
|
<label class="flex items-center gap-2"><%= t(".only_flights_i_logged_html", mine: (radio_button_tag :scope, "mine", params[:scope] == "mine")) %></label>
|
|
</fieldset>
|
|
<% all = AirTrailExport.new(@aircraft, username: "preview") %>
|
|
<p class="text-sm text-slate-600">
|
|
<%= t(".ready_to_export_html", flight: (t("counts.flight", count: all.exportable.size))) %><% if all.skipped.positive? %><%= t(".skipped_because_the_from_or_html", skipped: all.skipped) %><% end %>.
|
|
</p>
|
|
<%= f.submit t(".download_airtrail_file"), class: "btn-primary" %>
|
|
<% end %>
|
|
<section class="card card-body space-y-2 text-sm text-slate-700">
|
|
<h3 class="font-semibold"><%= t(".importing_into_airtrail") %></h3>
|
|
<ol class="list-decimal space-y-1 pl-4 text-xs">
|
|
<li><%= t(".in_airtrail_open_settings_import_html") %></li>
|
|
<li><%= t(".select_the_downloaded_file") %></li>
|
|
<li><%= t(".map_any_airports_airtrail_doesn") %></li>
|
|
</ol>
|
|
<p class="text-xs"><%= t(".each_flight_is_imported_with") %></p>
|
|
<p class="text-xs"><%= t(".prefer_automatic_to_push_new_html", link: (link_to t(".set_up_airtrail_sync"), air_trail_connection_path, class: "link")) %></p>
|
|
<p class="text-xs"><%= t(".re_importing_later_is_safe") %></p>
|
|
</section>
|
|
</div>
|