1
0
mirror of https://github.com/bitwarden/help synced 2025-12-06 00:03:30 +00:00

design updates

This commit is contained in:
Kyle Spearrin
2017-05-22 22:39:59 -04:00
parent ddbb856137
commit f17690a54b
8 changed files with 185 additions and 48 deletions

View File

@@ -0,0 +1,20 @@
# pluralize
#
# A Liquid filter to make it easy to form correct plurals.
#
# https://github.com/bdesham/pluralize
module Pluralize
def pluralize(number, singular, plural = nil)
number = number.to_i
if number == 1
"#{singular}"
elsif plural.nil?
"#{singular}s"
else
"#{plural}"
end
end
end
Liquid::Template.register_filter(Pluralize)