diff options
author | Carlos Fenollosa <carlos.fenollosa@gmail.com> | 2016-10-24 15:32:24 +0200 |
---|---|---|
committer | Carlos Fenollosa <carlos.fenollosa@gmail.com> | 2016-10-24 15:32:24 +0200 |
commit | 349ed8e3a7de19ba5d68613897e85abd68a626e1 (patch) | |
tree | e7105e4067bfd072cc3daf76da182e17cc9e2cc2 | |
parent | a36566a90cef64e18eabc693ca27eb4c12d775cd (diff) |
Slavic language support, thanks to Tomasz Jadowski
-rwxr-xr-x | bb.sh | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 "<li><a href=\"$i\">$tagname</a> — $nposts $word</li>" done echo "" 1>&3 |