Permalink
Browse files

Added basic Spanish pluralization rules (for M. Koper & Friends ^^)

  • Loading branch information...
1 parent 0920851 commit 0658b9909735850d89c6ccd2d7834511e259464b Paul Engel committed Sep 3, 2010
Showing with 44 additions and 0 deletions.
  1. +44 −0 locales/es.yml
View
@@ -0,0 +1,44 @@
+---
+es:
+
+ e9s:
+ plural:
+ - rule: | ([aeiou]s)$
+ replacement: \1
+
+ - rule: | ([^aeioué])$
+ replacement: \1es
+
+ - rule: | á([sn])$
+ replacement: a\1es
+
+ - rule: | í([sn])$
+ replacement: i\1es
+
+ - rule: | ó([sn])$
+ replacement: o\1es
+
+ - rule: | ú([sn])$
+ replacement: u\1es
+
+ - rule: z$
+ replacement: ces
+
+ - rule: (es|s)$
+ replacement: ""
+
+ - rule: $
+ replacement: s
+
+ irregular:
+ "papá": "papás"
+ "mamá": "mamás"
+ "sofá": "sofás"
+
+# http://gist.github.com/138956
+# http://www.viget.com/extend/rails-internationalization-and-tu/
+#
+# inflect.plural(/^(\w+)\s(.+)$/, lambda { |match|
+# head, tail = match.split(/\s+/, 2)
+# "#{head.pluralize} #{tail}"
+# })

0 comments on commit 0658b99

Please sign in to comment.