Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #5 from sanderhahn/master

rich_pluralization working in Rails 3.1
  • Loading branch information...
commit 57e66f099a44c095a8b587087b46ad41378b22bd 2 parents 4e044e1 + 1c0d4fb
authored November 28, 2011
2  lib/rich/pluralization/core/string/inflections.rb
@@ -30,7 +30,7 @@ def cp_case!(s)
30 30
           def pl(count = nil)
31 31
             Rich::Pluralization::Inflector.pluralize self, count
32 32
           end
33  
-                
  33
+
34 34
         end
35 35
       end
36 36
     end
1  lib/rich/pluralization/inflector/inflections.rb
... ...
@@ -1,3 +1,4 @@
  1
+require 'singleton'
1 2
 
2 3
 module Rich
3 4
   module Pluralization
12  locales/es.yml
@@ -6,22 +6,22 @@ es:
6 6
       - rule:          z$
7 7
         replacement:   ces
8 8
 
9  
-      - rule:        | á([sn])$
  9
+      - rule:          á([sn])$
10 10
         replacement:   a\1es
11 11
 
12  
-      - rule:        | í([sn])$
  12
+      - rule:          í([sn])$
13 13
         replacement:   i\1es
14 14
 
15  
-      - rule:        | ó([sn])$
  15
+      - rule:          ó([sn])$
16 16
         replacement:   o\1es
17 17
 
18  
-      - rule:        | ú([sn])$
  18
+      - rule:          ú([sn])$
19 19
         replacement:   u\1es
20 20
         
21  
-      - rule:        | ([aeiou]s)$
  21
+      - rule:          ([aeiou]s)$
22 22
         replacement:   \1
23 23
       
24  
-      - rule:        | ([^aeioué])$
  24
+      - rule:          ([^aeioué])$
25 25
         replacement:   \1es
26 26
         
27 27
       - rule:          $
36  locales/nl.yml
@@ -15,8 +15,8 @@ nl:
15 15
       
16 16
       - rule:          (c|m|n|t)us$
17 17
         replacement:   \1i
18  
-        exceptions:  | abortus, anus
19  
-      
  18
+        exceptions:    abortus, anus
  19
+
20 20
       - rule:          (c|d|e|i|t|tr|v)um$
21 21
         replacement:   \1a
22 22
         exceptions:    (anthu|aqua)rium
@@ -42,8 +42,12 @@ nl:
42 42
       
43 43
       - rule:          stad$
44 44
         replacement:   steden
  45
+
  46
+      - rule:          (gave)$
  47
+        replacement:   \1n
45 48
       
46  
-      - rule:        | abc, acme, acne, (a|ë|i|o|u|y)$
  49
+      - rule:          abc, acme, acne, (a|ë|i|o|u|y)$
  50
+
47 51
         replacement:   \1's
48 52
         exceptions:    (ai|eau|ei|li|lieu|ooi|ou|shampoo|spray|vlo)$
49 53
         
@@ -67,10 +71,12 @@ nl:
67 71
       - rule:          (abort|act|acquisit|advis|amat|inspect)(eur)$
68 72
         replacement:   \1\2s
69 73
         
70  
-      - rule:        | (gevoel)$
  74
+      - rule:          (gevoel)$
  75
+
71 76
         replacement:   \1ens
72 77
       
73  
-      - rule:        | (accent|agent)([-\s])(\w+)
  78
+      - rule:          (accent|agent)([-\s])(\w+)
  79
+
74 80
         replacement:   \1s\2\3s
75 81
       
76 82
       - rule:          advocaat-(\w+)
@@ -79,12 +85,15 @@ nl:
79 85
       - rule:          (bike|borstel|distel|kabel|prikkel|winkel)$
80 86
         replacement:   \1s
81 87
       
82  
-      - rule:        | abraham, account, act, addict, adoptiefzoon, ah, ai, air, airstrip, alligator, amant, ampersand, analysator, animator, anklet, antiquair, arbeidspool,
  88
+      - rule:          |
  89
+                       abraham, account, act, addict, adoptiefzoon, ah, ai, air, airstrip, alligator, amant, ampersand, analysator, animator, anklet, antiquair, arbeidspool,
83 90
                        (aar|aard|age|ah|bag|beignet|bike|chef|chon|club|e|é|eau|eër|el|em|en|eon|er|erd|festival|filet|film)$,
84 91
                        (foon|ie|ier|iër|kon|lation|lieu|lotion|marshal|nal|oir|oor|ose|ou|our|ount|pon|poo|prop|rak|rant|rn|sar|sion|sit|show|sor|spray)$,
85 92
                        (sun|tank|tant|test|um|view)$
  93
+
86 94
         replacement:   \1s
87  
-        exceptions:  | a-attest, aar, aardster, aarlenaar, acceptant, adoptant, afgifte, albe, alge, allofoon, amandel, amarant, ante, antifoon, antipode, aquarel, arelaar,
  95
+        exceptions:    |
  96
+                       a-attest, aar, aardster, aarlenaar, acceptant, adoptant, afgifte, albe, alge, allofoon, amandel, amarant, ante, antifoon, antipode, aquarel, arelaar,
88 97
                        ((aan|ge|ver|voor).*de|afe|ate|bel|bier|cel|contractant|denkende|deur|dier|dienaar|dode|eem|een|eel|eer|einde)$,
89 98
                        (ene|engel|gezwel|gier|iel|iem|isme|ïsme|jaar|ke|kel|krant|lem|lier|maatregel|migrant)$, 
90 99
                        (model|officier|oïde|oor|oen|oer|eose|penaar|rivale|schel|schijnsel|sien|spier|ste|stel|stem|taar|tenaar|tier|tride|uaar|vaar|valide|verwante|vrage|zijde)$
@@ -99,14 +108,18 @@ nl:
99 108
       - rule:          (ver|cijn)s$
100 109
         replacement:   \1zen
101 110
 
102  
-      - rule:        | (a|e|o|u)\1([^aeiou])$
  111
+      - rule:          (a|e|o|u)\1([^aeiou])$
  112
+
103 113
         replacement:   \1\2en
104 114
         
105  
-      - rule:        | (aï|alia)(s), 
  115
+      - rule:          |
  116
+                       (aï|alia)(s), 
106 117
                        ([^aeiou][aeiou])([^aeioux])$, 
107 118
                        ^([aeiou])([^aeioux])$
  119
+
108 120
         replacement:   \1\2\2en
109  
-        exceptions:    alcohol, amandel, apostel, dal, pad, slot, vat, 
  121
+        exceptions:    |
  122
+                       alcohol, amandel, apostel, dal, pad, slot, vat, 
110 123
                        (blad|dag|dak|engel|gat|god|hertog|ij|kel|oorlog|proton|regel|schijnsel|schot|slag|tor|weg)$
111 124
 
112 125
       - rule:          (de|ene)$
@@ -116,7 +129,8 @@ nl:
116 129
         replacement:   ven
117 130
         exceptions:    morf$
118 131
 
119  
-      - rule:        | ([aeiou]|aar|eur|ij)s$
  132
+      - rule:          ([aeiou]|aar|eur|ij)s$
  133
+
120 134
         replacement:   \1zen
121 135
         exceptions:    (kaars|kruis)$
122 136
 

0 notes on commit 57e66f0

Please sign in to comment.
Something went wrong with that request. Please try again.