mirror of
https://github.com/we-promise/sure.git
synced 2026-05-24 13:04:56 +00:00
fix(ds/dialog): use existing i18n namespace for close button label (#1776)
DS::Dialog#close_button called I18n.t("common.close") but no
`common.close` key exists in any locale file, so every modal rendered
the literal string "Translation missing: en.common.close" as both the
`title` and `aria-label` of the X close button — visible to screen
readers and as a hover tooltip.
Switch to `ds.dialog.close` to mirror the existing `ds.alert.*`
namespace under config/locales/views/components/*.yml, and add the
English string. Other locales fall back to English (fallbacks=true in
config/application.rb) until translated.
Closes #1763.
Co-authored-by: plind-junior <plind-junior@users.noreply.github.com>
This commit is contained in:
@@ -133,8 +133,8 @@ class DS::Dialog < DesignSystemComponent
|
||||
variant: "icon",
|
||||
class: classes,
|
||||
icon: "x",
|
||||
title: I18n.t("common.close"),
|
||||
aria_label: I18n.t("common.close"),
|
||||
title: I18n.t("ds.dialog.close"),
|
||||
aria_label: I18n.t("ds.dialog.close"),
|
||||
data: { action: "DS--dialog#close" }
|
||||
)
|
||||
end
|
||||
|
||||
@@ -8,6 +8,8 @@ en:
|
||||
warning: Warning
|
||||
error: Error
|
||||
destructive: Error
|
||||
dialog:
|
||||
close: Close
|
||||
provider_sync_summary:
|
||||
title: Sync summary
|
||||
last_sync: "Last sync: %{time_ago} ago"
|
||||
|
||||
Reference in New Issue
Block a user