mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-12 01:50:52 +01:00
Merge pull request #61 from tusbar/add-search-i18n
Allow translating search bar placeholder
This commit is contained in:
commit
406883a236
@ -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