Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cuddly-pants-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/primer-view-components": patch
---

[62820] Primer Alpha::ToggleSwitch locale support, set default values for On and Off labels
4 changes: 2 additions & 2 deletions app/components/primer/alpha/toggle_switch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def initialize(

@system_arguments[:src] = @src if @src

@on_label = on_label || "On"
@off_label = off_label || "Off"
@on_label = on_label || I18n.t("toggle_switch.label_on")
@off_label = off_label || I18n.t("toggle_switch.label_off")
end

def on?
Expand Down
4 changes: 4 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ en:
include_sub_items: "Include sub-items"
no_results_text: "No results"

toggle_switch:
label_on: "On"
label_off: "Off"

label_title: "Title"
label_loading: "Loading..."
label_more: "More"
Expand Down
Loading