Skip to content

Commit 4df04ed

Browse files
feat: replace ui_search_placeholder with docsy provided ui_search
1 parent f5eee4f commit 4df04ed

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

content/en/docs/contribute/localization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ translate the value of each string. For example, this is the German-language
450450
placeholder text for the search form:
451451

452452
```toml
453-
[ui_search_placeholder]
453+
[ui_search]
454454
other = "Suchen"
455455
```
456456

i18n/en/en.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ other = "Copied to clipboard: "
648648
[translated_by]
649649
other = "Translated By"
650650

651-
[ui_search_placeholder]
651+
[ui_search]
652652
other = "Search this site"
653653

654654
[version_check_mustbe]

layouts/partials/search-input-custom.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
{{ $lang := .Site.Language.Lang }}
33
{{ $searchFile := printf "content/%s/search.md" $lang }}
44

5+
{{ $check := "" }}
6+
{{ if T "ui_search_placeholder" }}
7+
{{ warnf "The search bar placeholder for the language %s is using a custom \"ui_search_placeholder\" key. Please change the key in the translations to the Docsy provided \"ui_search\"." $lang }}
8+
{{ $check = T "ui_search_placeholder" }}
9+
{{ else }}
10+
{{ $check = T "ui_search" }}
11+
{{ end }}
12+
513
<div class="search-bar">
614
<i class="search-icon fa-solid fa-search"></i>
715
<input
@@ -13,8 +21,8 @@
1321
data-search-page="{{ "search/" | relURL }}"
1422
{{ end }}
1523
class="search-input td-search-input"
16-
placeholder="{{ T "ui_search_placeholder" }}"
17-
aria-label="{{ T "ui_search_placeholder" }}"
24+
placeholder="{{ $check }}"
25+
aria-label="{{ $check }}"
1826
autocomplete="off"
1927
>
2028
</div>

0 commit comments

Comments
 (0)