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:
|
||||
category_measure: categories
|
||||
post_measure: posts
|
||||
category_measure:
|
||||
singular: category
|
||||
plural: categories
|
||||
post_measure:
|
||||
singular: post
|
||||
plural: posts
|
||||
|
|
|
@ -47,10 +47,24 @@ layout: page
|
|||
<span class="text-muted small font-weight-light">
|
||||
{% if sub_categories_size > 0 %}
|
||||
{{ 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 }}
|
||||
{{ site.data.locales[lang].categories.post_measure }}
|
||||
|
||||
{% 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 %}
|
||||
</span>
|
||||
</span>
|
||||
|
||||
|
@ -83,7 +97,14 @@ layout: page
|
|||
{% assign posts_size = site.categories[sub_category] | size %}
|
||||
<span class="text-muted small font-weight-light">
|
||||
{{ 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>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue