module ActiveSupport::Inflector

def singularize(word, locale = :en)

'leyes'.singularize(:es) # => "ley"
'CamelOctopi'.singularize # => "CamelOctopus"
'word'.singularize # => "word"
'sheep'.singularize # => "sheep"
'octopi'.singularize # => "octopus"
'posts'.singularize # => "post"

this parameter is set to :en.
pluralized using rules defined for that language. By default,
If passed an optional +locale+ parameter, the word will be

string.
The reverse of +pluralize+, returns the singular form of a word in a
def singularize(word, locale = :en)
  apply_inflections(word, inflections(locale).singulars)
end