mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Allow translating search bar placeholder
Add `extra.i18n.search` variable.
This commit is contained in:
parent
68b1800d38
commit
34a5779628
@ -175,14 +175,14 @@ extra:
|
||||
|
||||
### Localization
|
||||
|
||||
The **Previous** and **Next** labels in the footer can easily be changed by
|
||||
defining the variables `extra.i18n.prev` and `extra.i18n.next`:
|
||||
The following texts and labels can easily be changed by defining variables:
|
||||
|
||||
``` yaml
|
||||
extra:
|
||||
i18n:
|
||||
prev: 'Previous'
|
||||
next: 'Next'
|
||||
prev: 'Previous' # "Previous" label in the footer
|
||||
next: 'Next' # "Next" label in the footer
|
||||
search: 'Search' # "Search" placeholder in the search bar
|
||||
```
|
||||
|
||||
### Adding a GitHub and Twitter account
|
||||
|
@ -44,10 +44,10 @@
|
||||
</div>
|
||||
<div class="stretch">
|
||||
<div class="field">
|
||||
<input class="query" type="text" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false">
|
||||
<input class="query" type="text" placeholder="{{ config.extra.get('i18n', {}).search | default('Search') }}" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="button button-reset" role="button" aria-label="Search">
|
||||
<div class="button button-reset" role="button" aria-label="{{ config.extra.get('i18n', {}).search | default('Search') }}">
|
||||
<button class="toggle-button icon icon-close" id="reset-search"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -69,14 +69,14 @@
|
||||
<!-- Search form -->
|
||||
<div class="stretch">
|
||||
<div class="field">
|
||||
<input class="query" type="text" placeholder="Search"
|
||||
<input class="query" type="text" placeholder="{{ config.extra.get('i18n', {}).search | default('Search') }}"
|
||||
autocapitalize="off" autocorrect="off" autocomplete="off"
|
||||
spellcheck="false" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Empty search -->
|
||||
<div class="button button-reset" role="button" aria-label="Search">
|
||||
<div class="button button-reset" role="button" aria-label="{{ config.extra.get('i18n', {}).search | default('Search') }}">
|
||||
<button class="toggle-button icon icon-close"
|
||||
id="reset-search"></button>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user