From 2157b921660bf39a75cd446304887b5675f6de15 Mon Sep 17 00:00:00 2001 From: Carlos Fenollosa Date: Mon, 24 Oct 2016 11:16:01 +0200 Subject: [PATCH] Slavic language support, thanks to Tomasz Jadowski --- bb.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bb.sh b/bb.sh index 14c1b5b..840ba0c 100755 --- a/bb.sh +++ b/bb.sh @@ -109,6 +109,7 @@ global_variables() { template_tags_title="All tags" # "posts" (on "All tags" page, text at the end of each tag line, like "2. Music - 15 posts") template_tags_posts="posts" + template_tags_posts_2_4="posts" # Some slavic languages use a different plural form for 2-4 items template_tags_posts_singular="post" # "Posts tagged" (text on a title of a page with index of one tag, like "My Blog - Posts tagged "Music"") template_tag_title="Posts tagged" @@ -681,7 +682,11 @@ all_tags() { nposts=$(grep -c "<\!-- text begin -->" "$i") tagname=${i#"$prefix_tags"} tagname=${tagname%.html} - ((nposts > 1)) && word=$template_tags_posts || word=$template_tags_posts_singular + case $nposts in + 1) word=$template_tags_posts_singular;; + 2|3|4) word=$template_tags_posts_2_4;; + *) word=$template_tags_posts + esac echo "
  • $tagname — $nposts $word
  • " done echo "" 1>&3