Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(translations): Add search placeholder translations #708

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions templates/_includes/_defaults.html
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,15 @@
{% else %}
{% set SHARE_LINKS = SHARE_LINKS %}
{% endif %}

{% if not SEARCH_PLACEHOLDER %}
{% set SEARCH_PLACEHOLDER = 'Search' %}
{% else %}
{% set SEARCH_PLACEHOLDER = SEARCH_PLACEHOLDER %}
{% endif %}

{% if not SEARCH_TAG_PLACEHOLDER %}
{% set SEARCH_TAG_PLACEHOLDER = 'Find a tag' %}
{% else %}
{% set SEARCH_TAG_PLACEHOLDER = SEARCH_TAG_PLACEHOLDER %}
{% endif %}
4 changes: 2 additions & 2 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
<li {% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
{% endfor %}
{% endif %}
{% from '_includes/_defaults.html' import TAGS_URL, CATEGORIES_URL, ARCHIVES_URL, SEARCH_URL with context %}
{% from '_includes/_defaults.html' import TAGS_URL, CATEGORIES_URL, ARCHIVES_URL, SEARCH_URL, SEARCH_PLACEHOLDER with context %}
<li {% if page_name == 'categories' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ CATEGORIES_URL }}">Categories</a></li>
<li {% if page_name == 'tags' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ TAGS_URL }}">Tags</a></li>
<li {% if page_name == 'archives' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ ARCHIVES_URL }}">Archives</a></li>
<li><form class="navbar-search" action="{{ SITEURL }}/{{ SEARCH_URL }}" onsubmit="return validateForm(this.elements['q'].value);"> <input type="text" class="search-query" placeholder="Search" name="q" id="tipue_search_input"></form></li>
<li><form class="navbar-search" action="{{ SITEURL }}/{{ SEARCH_URL }}" onsubmit="return validateForm(this.elements['q'].value);"> <input type="text" class="search-query" placeholder="{{ SEARCH_PLACEHOLDER }}" name="q" id="tipue_search_input"></form></li>
</ul>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{% endblock feed_links %}

{% block content %}
{% from '_includes/_defaults.html' import TAGS_URL with context %}
{% from '_includes/_defaults.html' import TAGS_URL, SEARCH_TAG_PLACEHOLDER with context %}
<div class="row-fluid">
<header class="page-header span10 offset2">
<h1><a href="{{ SITEURL }}/{{ TAGS_URL }}">All Tags</a></h1>
Expand All @@ -39,7 +39,7 @@ <h1><a href="{{ SITEURL }}/{{ TAGS_URL }}">All Tags</a></h1>
<div class="row-fluid">
<div class="span8 offset2">
<form class="form-search">
<input type="text" class="input-medium search-query filterinput" placeholder="Find a tag">
<input type="text" class="input-medium search-query filterinput" placeholder="{{ SEARCH_TAG_PLACEHOLDER }}">
</form>
<ul class="list-of-tags">
{% for tag, articles in tags|sort %}
Expand Down