1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-13 18:40:54 +01:00

Merge pull request #61 from tusbar/add-search-i18n

Allow translating search bar placeholder
This commit is contained in:
Martin Donath 2016-11-05 14:54:49 +01:00 committed by GitHub
commit 406883a236
3 changed files with 8 additions and 8 deletions

View File

@ -175,14 +175,14 @@ extra:
### Localization ### Localization
The **Previous** and **Next** labels in the footer can easily be changed by The following texts and labels can easily be changed by defining variables:
defining the variables `extra.i18n.prev` and `extra.i18n.next`:
``` yaml ``` yaml
extra: extra:
i18n: i18n:
prev: 'Previous' prev: 'Previous' # "Previous" label in the footer
next: 'Next' next: 'Next' # "Next" label in the footer
search: 'Search' # "Search" placeholder in the search bar
``` ```
### Adding a GitHub and Twitter account ### Adding a GitHub and Twitter account

View File

@ -44,10 +44,10 @@
</div> </div>
<div class="stretch"> <div class="stretch">
<div class="field"> <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> </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> <button class="toggle-button icon icon-close" id="reset-search"></button>
</div> </div>
</div> </div>

View File

@ -69,14 +69,14 @@
<!-- Search form --> <!-- Search form -->
<div class="stretch"> <div class="stretch">
<div class="field"> <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" autocapitalize="off" autocorrect="off" autocomplete="off"
spellcheck="false" /> spellcheck="false" />
</div> </div>
</div> </div>
<!-- Empty search --> <!-- 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" <button class="toggle-button icon icon-close"
id="reset-search"></button> id="reset-search"></button>
</div> </div>