perf(categories): support singular and plural forms of locale (#595)
resolves #595
This commit is contained in:
parent
cc6398c104
commit
35cadf969d
2 changed files with 31 additions and 6 deletions
|
@ -75,5 +75,9 @@ post:
|
||||||
|
|
||||||
# categories page
|
# categories page
|
||||||
categories:
|
categories:
|
||||||
category_measure: categories
|
category_measure:
|
||||||
post_measure: posts
|
singular: category
|
||||||
|
plural: categories
|
||||||
|
post_measure:
|
||||||
|
singular: post
|
||||||
|
plural: posts
|
||||||
|
|
|
@ -47,10 +47,24 @@ layout: page
|
||||||
<span class="text-muted small font-weight-light">
|
<span class="text-muted small font-weight-light">
|
||||||
{% if sub_categories_size > 0 %}
|
{% if sub_categories_size > 0 %}
|
||||||
{{ sub_categories_size }}
|
{{ sub_categories_size }}
|
||||||
{{ site.data.locales[lang].categories.category_measure }},
|
{% if sub_categories_size > 1 %}
|
||||||
|
{{ site.data.locales[lang].categories.category_measure.plural
|
||||||
|
| default: site.data.locales[lang].categories.category_measure }}
|
||||||
|
{% else %}
|
||||||
|
{{ site.data.locales[lang].categories.category_measure.singular
|
||||||
|
| default: site.data.locales[lang].categories.category_measure }}
|
||||||
|
{% endif %},
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{{ top_posts_size }}
|
||||||
|
|
||||||
|
{% if top_posts_size > 1 %}
|
||||||
|
{{ site.data.locales[lang].categories.post_measure.plural
|
||||||
|
| default: site.data.locales[lang].categories.post_measure }}
|
||||||
|
{% else %}
|
||||||
|
{{ site.data.locales[lang].categories.post_measure.singular
|
||||||
|
| default: site.data.locales[lang].categories.post_measure }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ top_posts_size }}
|
|
||||||
{{ site.data.locales[lang].categories.post_measure }}
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
@ -83,7 +97,14 @@ layout: page
|
||||||
{% assign posts_size = site.categories[sub_category] | size %}
|
{% assign posts_size = site.categories[sub_category] | size %}
|
||||||
<span class="text-muted small font-weight-light">
|
<span class="text-muted small font-weight-light">
|
||||||
{{ posts_size }}
|
{{ posts_size }}
|
||||||
{{ site.data.locales[lang].categories.post_measure }}
|
|
||||||
|
{% if posts_size > 1 %}
|
||||||
|
{{ site.data.locales[lang].categories.post_measure.plural
|
||||||
|
| default: site.data.locales[lang].categories.post_measure }}
|
||||||
|
{% else %}
|
||||||
|
{{ site.data.locales[lang].categories.post_measure.singular
|
||||||
|
| default: site.data.locales[lang].categories.post_measure }}
|
||||||
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue