mirror of
https://github.com/we-promise/sure.git
synced 2026-08-05 08:32:15 +00:00
`app/views/goals/new.html.erb` called `t("common.close")`, but that key is
only defined at the top level in `ru`, `tr` and `zh-CN`. The canonical key is
`defaults.common.close`, which is defined in `en` (and therefore resolves in
every locale via `config.i18n.fallbacks`) and is already used by
`settings/providers/_drawer_header.html.erb` and
`shared/notifications/_sync_toast.html.erb`.
Because `en` has no top-level `common.close`, the fallback had nothing to fall
back to, so the lookup failed everywhere except those three locales. The
failed lookup was passed straight into the button's `title` and `aria_label`
attributes, injecting literal markup into text meant for screen readers:
t("common.close") @ en
=> "<span class=\"translation_missing\" title=\"translation missing: en.common.close, locale: en\">Close</span>"
Point the view at `defaults.common.close` and drop the now-dead top-level
`common:` blocks from `ru`, `tr` and `zh-CN`. No `en.yml` changes needed.
Verified with `bin/rails runner`: `defaults.common.close` resolves in en, ca,
fr, it, ru, tr, zh-CN, and falls back cleanly to "Close" for de/es. No
`t("common.*")` call sites remain in `app/`.
Closes #2740
Co-authored-by: erkdgn <erkdgn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
31 lines
1.4 KiB
Plaintext
31 lines
1.4 KiB
Plaintext
<% if turbo_frame_request? %>
|
|
<%= render DS::Dialog.new(width: "lg") do |dialog| %>
|
|
<% dialog.with_header(custom_header: true) do %>
|
|
<div class="flex items-start justify-between gap-3">
|
|
<div class="flex items-start gap-3">
|
|
<%= render DS::FilledIcon.new(variant: :container, icon: "target", size: "md", rounded: true) %>
|
|
<div>
|
|
<h2 class="text-base font-medium text-primary"><%= t(".heading") %></h2>
|
|
<p class="text-sm text-secondary mt-0.5"><%= t(".subtitle") %></p>
|
|
</div>
|
|
</div>
|
|
<%= render DS::Button.new(variant: "icon", icon: "x", title: t("defaults.common.close"), aria_label: t("defaults.common.close"), data: { action: "DS--dialog#close" }) %>
|
|
</div>
|
|
<% end %>
|
|
<% dialog.with_body do %>
|
|
<%= render "form", goal: @goal, linkable_accounts: @linkable_accounts %>
|
|
<% end %>
|
|
<% end %>
|
|
<% else %>
|
|
<div class="max-w-2xl mx-auto py-8 px-4">
|
|
<header class="mb-6 flex items-start gap-3">
|
|
<%= render DS::FilledIcon.new(variant: :container, icon: "target", size: "md", rounded: true) %>
|
|
<div>
|
|
<h1 class="text-xl font-medium text-primary"><%= t(".heading") %></h1>
|
|
<p class="text-sm text-secondary mt-0.5"><%= t(".subtitle") %></p>
|
|
</div>
|
|
</header>
|
|
<%= render "form", goal: @goal, linkable_accounts: @linkable_accounts %>
|
|
</div>
|
|
<% end %>
|