Skip to content

Commit 349ed8e

Browse files
committed
Slavic language support, thanks to Tomasz Jadowski
1 parent a36566a commit 349ed8e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bb.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ global_variables() {
109109
template_tags_title="All tags"
110110
# "posts" (on "All tags" page, text at the end of each tag line, like "2. Music - 15 posts")
111111
template_tags_posts="posts"
112+
template_tags_posts_2_4="posts" # Some slavic languages use a different plural form for 2-4 items
112113
template_tags_posts_singular="post"
113114
# "Posts tagged" (text on a title of a page with index of one tag, like "My Blog - Posts tagged "Music"")
114115
template_tag_title="Posts tagged"
@@ -681,7 +682,11 @@ all_tags() {
681682
nposts=$(grep -c "<\!-- text begin -->" "$i")
682683
tagname=${i#"$prefix_tags"}
683684
tagname=${tagname%.html}
684-
((nposts > 1)) && word=$template_tags_posts || word=$template_tags_posts_singular
685+
case $nposts in
686+
1) word=$template_tags_posts_singular;;
687+
2|3|4) word=$template_tags_posts_2_4;;
688+
*) word=$template_tags_posts
689+
esac
685690
echo "<li><a href=\"$i\">$tagname</a> &mdash; $nposts $word</li>"
686691
done
687692
echo "" 1>&3

0 commit comments

Comments
 (0)