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

@@ -9,20 +9,22 @@ tail_includes:
- comments
---
{% include lang.html %}
<h1 data-toc-skip>{{ page.title }}</h1>
<div class="post-meta text-muted">
<!-- published date -->
<span>
{{ site.data.locales[site.lang].post.posted }}
{% include datetime.html date=page.date tooltip=true %}
{{ site.data.locales[lang].post.posted }}
{% include datetime.html date=page.date tooltip=true lang=lang %}
</span>
<!-- lastmod date -->
{% if page.last_modified_at %}
<span>
{{ site.data.locales[site.lang].post.updated }}
{% include datetime.html date=page.last_modified_at tooltip=true %}
{{ site.data.locales[lang].post.updated }}
{% include datetime.html date=page.last_modified_at tooltip=true lang=lang %}
</span>
{% endif %}
@@ -54,7 +56,7 @@ tail_includes:
{% assign authors = page.authors %}
{% endif %}
{{ site.data.locales[site.lang].post.written_by }}
{{ site.data.locales[lang].post.written_by }}
<em>
{% if authors %}
@@ -75,12 +77,12 @@ tail_includes:
<em id="pv" class="pageviews">
<i class="fas fa-spinner fa-spin fa-fw"></i>
</em>
{{ site.data.locales[site.lang].post.pageview_measure }}
{{ site.data.locales[lang].post.pageview_measure }}
</span>
{% endif %}
<!-- read time -->
{% include read-time.html content=content prompt=true %}
{% include read-time.html content=content prompt=true lang=lang %}
</div>
</div> <!-- .d-flex -->
@@ -121,20 +123,20 @@ tail_includes:
d-flex justify-content-between align-items-center mt-3 pt-5 pb-2">
<div class="license-wrapper">
{% if site.data.locales[site.lang].copyright.license.template %}
{% if site.data.locales[lang].copyright.license.template %}
{% capture _replacement %}
<a href="{{ site.data.locales[site.lang].copyright.license.link }}">
{{ site.data.locales[site.lang].copyright.license.name }}
<a href="{{ site.data.locales[lang].copyright.license.link }}">
{{ site.data.locales[lang].copyright.license.name }}
</a>
{% endcapture %}
{{ site.data.locales[site.lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
{{ site.data.locales[lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
{% endif %}
</div>
{% include post-sharing.html %}
{% include post-sharing.html lang=lang %}
</div><!-- .post-tail-bottom -->