Skip to content

Commit 2749542

Browse files
committed
pass translation of on and off as the default label of toggle switch
1 parent 421f8e3 commit 2749542

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

app/components/primer/alpha/toggle_switch.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def initialize(
8484

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

87-
@on_label = on_label || I18n.t("label_switch_on")
88-
@off_label = off_label || I18n.t("label_switch_off")
87+
@on_label = on_label || I18n.t("toggle_switch.label_on")
88+
@off_label = off_label || I18n.t("toggle_switch.label_off")
8989
end
9090

9191
def on?

config/locales/en.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ en:
1515
include_sub_items: "Include sub-items"
1616
no_results_text: "No results"
1717

18+
toggle_switch:
19+
label_on: "On"
20+
label_off: "Off"
21+
1822
label_title: "Title"
1923
label_loading: "Loading..."
2024
label_more: "More"
21-
label_switch_on: "On"
22-
label_switch_off: "Off"
2325

2426
danger_dialog:
2527
confirmation_live_message_checked: "The button to proceed is now active."

0 commit comments

Comments
 (0)