Skip to content

Commit

Permalink
🐛 fix(i18n): reverse arrows in RTL languages (welpo#272)
Browse files Browse the repository at this point in the history
Co-authored-by: welpo <welpo@users.noreply.github.com>
  • Loading branch information
2 people authored and Smtbook committed Feb 29, 2024
1 parent 39be9bd commit 48135a5
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
11 changes: 11 additions & 0 deletions sass/parts/_misc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,14 @@ details summary {
}
}
}

:dir(rtl) .arrow {
display: inline-block;
transform: rotate(180deg);
}

// This for the arrows that point to a corner, (e.g. '↗', '↘', '↙', '↖')
:dir(rtl) .arrow-corner {
display: inline-block;
transform: rotate(270deg);
}
2 changes: 1 addition & 1 deletion static/feed_style.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<xsl:attribute name="href">
<xsl:value-of select="/atom:feed/atom:link[2]/@href"/>
</xsl:attribute>
<xsl:value-of select="/atom:feed/str:translations/str:visit_the_site" /></a><p></p>
<xsl:value-of select="/atom:feed/str:translations/str:visit_the_site" />&#160;<span class="arrow">→</span></a><p></p>
</section>

<div class="padding-top listing-title bottom-divider">
Expand Down
4 changes: 2 additions & 2 deletions templates/macros/list_posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ <h2 class="bloglist-title">
<p>{{ post.summary | striptags | safe | trim_end_matches(pat=".") }}…</p>
{% endif %}
</div>
<a class="readmore" href={{ post.permalink }}>{{ macros_translate::translate(key="read_more", default="Read more", language_strings=language_strings) }}&nbsp;</a>
<a class="readmore" href={{ post.permalink }}>{{ macros_translate::translate(key="read_more", default="Read more", language_strings=language_strings) }}&nbsp;<span class="arrow"></span></a>
</div>
</section>
{% endif %}
{% if not loop.last %}
{% if loop.index == max %}
<div class="all-posts">
<a href="{{ get_url(path="blog", lang=lang) }}/">{{ macros_translate::translate(key="all_posts", default="All posts", language_strings=language_strings) }}&nbsp;</a>
<a href="{{ get_url(path="blog", lang=lang) }}/">{{ macros_translate::translate(key="all_posts", default="All posts", language_strings=language_strings) }}&nbsp;<span class="arrow"></span></a>
</div>
{% endif %}
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h1 class="article-title">
{# Show link to remote changes if enabled #}
{% if config.extra.remote_repository_url and macros_settings::evaluate_setting_priority(setting="show_remote_changes", page=page, default_global_value=true) == "true" %}
{{ separator }}
<li><a href="{% include "partials/history_url.html" %}" {{ blank_target }} rel="{{ rel_attributes }}">{{ macros_translate::translate(key="see_changes", default="See changes", language_strings=language_strings) }}<small></small></a></li>
<li><a href="{% include "partials/history_url.html" %}" {{ blank_target }} rel="{{ rel_attributes }}">{{ macros_translate::translate(key="see_changes", default="See changes", language_strings=language_strings) }}<small>&nbsp;<span class="arrow-corner"></span></small></a></li>
{% endif %}
{% endif %}
</ul>
Expand Down Expand Up @@ -165,13 +165,13 @@ <h3>TL;DR:</h3>
<nav class="{{ full_width_class | default(value="") }} article-navigation">
<div>
{%- if left_link and left_label and left_title -%}
<a href="{{ left_link | safe }}" aria-label="{{ left_label }}" aria-describedby="left_title">{{ left_label }}</a>
<a href="{{ left_link | safe }}" aria-label="{{ left_label }}" aria-describedby="left_title"><span class="arrow"></span>&nbsp;{{ left_label }}</a>
<p aria-hidden="true" id="left_title">{{ left_title | truncate(length=100, end="…") }}</p>
{%- endif -%}
</div>
<div>
{%- if right_link and right_label and right_title -%}
<a href="{{ right_link | safe }}" aria-label="{{ right_label }}" aria-describedby="right_title">{{ right_label }}</a>
<a href="{{ right_link | safe }}" aria-label="{{ right_label }}" aria-describedby="right_title">{{ right_label }}&nbsp;<span class="arrow"></span></a>
<p aria-hidden="true" id="right_title">{{ right_title | truncate(length=100, end="…") }}</p>
{%- endif -%}
</div>
Expand Down
8 changes: 4 additions & 4 deletions templates/partials/paginate.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<ul class="pagination">
{% if paginator.previous %}
<li class="page-item page-prev">
<a href="{{ paginator.previous }}" class="page-link" aria-label="{{ macros_translate::translate(key="prev", default="Prev", language_strings=language_strings) }}"> {{ macros_translate::translate(key="prev", default="Prev", language_strings=language_strings) }}</a>
<a href="{{ paginator.previous }}" class="page-link" aria-label="{{ macros_translate::translate(key="prev", default="Prev", language_strings=language_strings) }}"><span class="arrow"></span> {{ macros_translate::translate(key="prev", default="Prev", language_strings=language_strings) }}</a>
</li>
{% else %}
<li class="page-item page-prev">
<span class="page-link disabled" aria-disabled="true" aria-label="{{ macros_translate::translate(key="prev", default="Prev", language_strings=language_strings) }} (disabled)"> {{ macros_translate::translate(key="prev", default="Prev", language_strings=language_strings) }}</span>
<span class="page-link disabled" aria-disabled="true" aria-label="{{ macros_translate::translate(key="prev", default="Prev", language_strings=language_strings) }} (disabled)"><span class="arrow"></span> {{ macros_translate::translate(key="prev", default="Prev", language_strings=language_strings) }}</span>
</li>
{% endif %}

Expand All @@ -16,11 +16,11 @@

{% if paginator.next %}
<li class="page-item page-next">
<a href="{{ paginator.next }}" class="page-link" aria-label="{{ macros_translate::translate(key="next", default="Next", language_strings=language_strings) }}">{{ macros_translate::translate(key="next", default="Next", language_strings=language_strings) }} </a>
<a href="{{ paginator.next }}" class="page-link" aria-label="{{ macros_translate::translate(key="next", default="Next", language_strings=language_strings) }}">{{ macros_translate::translate(key="next", default="Next", language_strings=language_strings) }} <span class="arrow"></span></a>
</li>
{% else %}
<li class="page-item page-next">
<span class="page-link disabled" aria-disabled="true" aria-label="{{ macros_translate::translate(key="next", default="Next", language_strings=language_strings) }} (disabled)">{{ macros_translate::translate(key="next", default="Next", language_strings=language_strings) }} </span>
<span class="page-link disabled" aria-disabled="true" aria-label="{{ macros_translate::translate(key="next", default="Next", language_strings=language_strings) }} (disabled)">{{ macros_translate::translate(key="next", default="Next", language_strings=language_strings) }} <span class="arrow"></span></span>
</li>
{% endif %}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion templates/tags/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ul class="pagination">
<li class="page-item">
<a class="all-tags" href="{{ get_url(path="tags", lang=lang) }}/">&nbsp;{{- macros_translate::translate(key="all_tags", default="All tags", language_strings=language_strings) -}}</a>
<a class="all-tags" href="{{ get_url(path="tags", lang=lang) }}/"><span class="arrow"></span>&nbsp;{{- macros_translate::translate(key="all_tags", default="All tags", language_strings=language_strings) -}}</a>
</li>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion templates/taxonomy_single.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ul class="pagination">
<li class="page-item">
<a class="all-tags" href="{{ get_url(path="tags", lang=lang) }}/">&nbsp;{{- macros_translate::translate(key=taxonomy.name, default=taxonomy.name, language_strings=language_strings) -}}</a>
<a class="all-tags" href="{{ get_url(path="tags", lang=lang) }}/"><span class="arrow"></span>&nbsp;{{- macros_translate::translate(key=taxonomy.name, default=taxonomy.name, language_strings=language_strings) -}}</a>
</li>
</ul>

Expand Down

0 comments on commit 48135a5

Please sign in to comment.