4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'app/helpers/adminpanel/pluralizations_helper.rb', line 4
def pluralize_es(string)
pluralized_string = ""
string.split.each do |word|
case(word.last)
when 'a', 'e', 'i', 'o', 'u', 'c'
pluralized_string = "#{pluralized_string}#{word}s "
when 'b', 'r'
pluralized_string = "#{pluralized_string}#{word}es "
when 'z'
pluralized_string = "#{pluralized_string}#{word.chop}ces "
else
pluralized_string = "#{pluralized_string}#{word} "
end
end
pluralized_string.chop
end
|