Last active
June 5, 2018 19:17
-
-
Save kirkgo/1978234 to your computer and use it in GitHub Desktop.
Pluralization in brazilian portuguese through REGEX for Ruby on Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveSupport::Inflector.inflections do |inflect| | |
inflect.plural /ao$/i, 'oes' | |
inflect.singular /oes$/i, 'ao' | |
inflect.plural /l$/i, 'is' | |
inflect.singular /is$/i, 'l' | |
inflect.plural /or$/i, 'ores' | |
inflect.singular /ores$/i, 'or' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment