Skip to content

Commit 0e0429b

Browse files
Placeholder default for SearchInput
1 parent a9d2b28 commit 0e0429b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

components/search_combo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func SearchCombo(locale translation.Locale, value, placeholder string) g.Node {
1515
disabled := false
1616
return gh.Div(
1717
gh.Class("ui small fluid action input"),
18-
SearchInput(value, placeholder, disabled),
18+
SearchInput(locale, value, placeholder, disabled),
1919
// TODO SearchModeDropdown
2020
SearchButton(disabled, ""),
2121
)

components/search_input.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44
package components
55

66
import (
7+
"code.gitea.io/gitea/modules/translation"
78
g "maragu.dev/gomponents"
89
gh "maragu.dev/gomponents/html"
910
)
1011

11-
func SearchInput(value, placeholder string, disabled bool) g.Node {
12+
func SearchInput(locale translation.Locale, value, placeholder string, disabled bool) g.Node {
1213
// Corresponds to templates/shared/search/input.tmpl
1314

15+
if placeholder == "" {
16+
placeholder = string(locale.Tr("search.search"))
17+
}
18+
1419
return gh.Input(
1520
gh.Type("search"),
1621
gh.Name("q"),

0 commit comments

Comments
 (0)