Skip to content

Commit ea8ff09

Browse files
committed
Make default strings localized
1 parent 1c7bb7e commit ea8ff09

2 files changed

Lines changed: 26 additions & 6 deletions

File tree

app/components/primer/open_project/filterable_tree_view.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class FilterableTreeView < Primer::Component
107107

108108
DEFAULT_FILTER_INPUT_ARGUMENTS = {
109109
name: :filter,
110-
label: "Filter",
110+
label: I18n.t(:button_filter),
111111
type: :search,
112112
leading_visual: { icon: :search },
113113
visually_hide_label: true,
@@ -118,34 +118,34 @@ class FilterableTreeView < Primer::Component
118118

119119
DEFAULT_FILTER_MODE_CONTROL_ARGUMENTS = {
120120
aria: {
121-
label: "Filter mode"
121+
label: I18n.t("filterable_tree_view.filter_mode.label")
122122
}
123123
}
124124

125125
DEFAULT_FILTER_MODE_CONTROL_ARGUMENTS.freeze
126126

127127
DEFAULT_INCLUDE_SUB_ITEMS_CHECK_BOX_ARGUMENTS = {
128-
label: "Include sub-items",
128+
label: I18n.t("filterable_tree_view.include_sub_items"),
129129
name: :include_sub_items
130130
}
131131

132132
DEFAULT_INCLUDE_SUB_ITEMS_CHECK_BOX_ARGUMENTS.freeze
133133

134134
DEFAULT_FILTER_MODES = {
135135
all: {
136-
label: "All",
136+
label: I18n.t("filterable_tree_view.filter_mode.all"),
137137
selected: true,
138138
},
139139

140140
selected: {
141-
label: "Selected",
141+
label: I18n.t("filterable_tree_view.filter_mode.selected"),
142142
}
143143
}
144144

145145
DEFAULT_FILTER_MODES.freeze
146146

147147
DEFAULT_NO_RESULTS_NODE_ARGUMENTS = {
148-
label: "No results"
148+
label: I18n.t("filterable_tree_view.no_results_text")
149149
}
150150

151151
DEFAULT_NO_RESULTS_NODE_ARGUMENTS.freeze

config/locales/en.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
en:
2+
button_back: "Back"
3+
button_cancel: "Cancel"
4+
button_close: "Close"
5+
button_delete: "Delete"
6+
button_delete_permanently: "Delete permanently"
7+
button_filter: "Filter"
8+
button_save: "Save"
9+
10+
filterable_tree_view:
11+
filter_mode:
12+
all: "All"
13+
label: "Filter mode"
14+
selected: "Selected"
15+
include_sub_items: "Include sub-items"
16+
no_results_text: "No results"
17+
18+
label_title: "Title"
19+
label_loading: "Loading..."
20+
label_more: "More"

0 commit comments

Comments
 (0)