diff --git a/_data/locales/en.yml b/_data/locales/en.yml index 9e76bd3..14394a6 100644 --- a/_data/locales/en.yml +++ b/_data/locales/en.yml @@ -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 diff --git a/_layouts/categories.html b/_layouts/categories.html index 4e9ce77..88c45b0 100644 --- a/_layouts/categories.html +++ b/_layouts/categories.html @@ -47,10 +47,24 @@ layout: page {% 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 }} + + {% 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 %} - {{ top_posts_size }} - {{ site.data.locales[lang].categories.post_measure }} @@ -83,7 +97,14 @@ layout: page {% assign posts_size = site.categories[sub_category] | 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 %} {% endfor %}