1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

perf(i18n): set the global default locales to "en" (#979)

Avoid missing labels caused by languages ​​outside of locales.
This commit is contained in:
Cotes Chung
2023-05-06 07:22:29 +08:00
parent aca79c1007
commit 61fdbcb83a
23 changed files with 417 additions and 342 deletions

View File

@@ -1,10 +1,8 @@
<!--
Calculate the post's reading time, and display the word count in tooltip
-->
<!-- Calculate the post's reading time, and display the word count in tooltip -->
{% assign words = include.content | strip_html | number_of_words: "auto" %}
{% assign words = include.content | strip_html | number_of_words: 'auto' %}
<!-- words per minute -->
<!-- words per minute -->
{% assign wpm = 180 %}
{% assign min_time = 1 %}
@@ -16,15 +14,24 @@
{% endunless %}
{% capture read_prompt %}
{{- site.data.locales[site.lang].post.read_time.prompt -}}
{{- site.data.locales[include.lang].post.read_time.prompt -}}
{% endcapture %}
<!-- return element -->
<span class="readtime" data-toggle="tooltip" data-placement="bottom"
title="{{ words }} {{ site.data.locales[site.lang].post.words }}">
<em>{{- read_time -}}{{" "}}{{- site.data.locales[site.lang].post.read_time.unit -}}</em>
<span
class="readtime"
data-toggle="tooltip"
data-placement="bottom"
title="{{ words }} {{ site.data.locales[include.lang].post.words }}"
>
<em>
{{- read_time -}}
{{ ' ' }}
{{- site.data.locales[include.lang].post.read_time.unit -}}
</em>
{%- if include.prompt -%}
{%- assign _prompt_words = read_prompt | number_of_words: 'auto' -%}
{%- unless _prompt_words > 1 -%}{{ " " }}{%- endunless -%}{{ read_prompt }}
{%- unless _prompt_words > 1 -%}{{ ' ' }}{%- endunless -%}
{{ read_prompt }}
{%- endif -%}
</span>