brails 0.0.8 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/brails.gemspec +2 -1
- data/lib/generators/templates/brails_inflections.rb +43 -43
- metadata +1 -1
data/brails.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'brails'
|
3
|
-
s.version = '0.0
|
3
|
+
s.version = '0.1.0'
|
4
4
|
s.date = '2013-01-29'
|
5
5
|
s.summary = "Brails!"
|
6
6
|
s.description = "The solutions for your ugly hack translations"
|
@@ -10,5 +10,6 @@ Gem::Specification.new do |s|
|
|
10
10
|
|
11
11
|
s.files = `git ls-files`.split("\n")
|
12
12
|
s.test_files = `git ls-files -- test/*`.split("\n")
|
13
|
+
|
13
14
|
s.require_paths = ["lib"]
|
14
15
|
end
|
@@ -1,48 +1,48 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
ActiveSupport::Inflector.inflections do |inflect|
|
2
|
+
inflect.clear
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
4
|
+
inflect.plural(/$/, 's')
|
5
|
+
inflect.plural(/(s)$/i, '\1')
|
6
|
+
inflect.plural(/^(paí)s$/i, '\1ses')
|
7
|
+
inflect.plural(/(z|r)$/i, '\1es')
|
8
|
+
inflect.plural(/al$/i, 'ais')
|
9
|
+
inflect.plural(/el$/i, 'eis')
|
10
|
+
inflect.plural(/ol$/i, 'ois')
|
11
|
+
inflect.plural(/ul$/i, 'uis')
|
12
|
+
inflect.plural(/([^aeou])il$/i, '\1is')
|
13
|
+
inflect.plural(/m$/i, 'ns')
|
14
|
+
inflect.plural(/^(japon|escoc|ingl|dinamarqu|fregu|portugu)ês$/i, '\1eses')
|
15
|
+
inflect.plural(/^(|g)ás$/i, '\1ases')
|
16
|
+
inflect.plural(/ão$/i, 'ões')
|
17
|
+
inflect.plural(/^(irm|m)ão$/i, '\1ãos')
|
18
|
+
inflect.plural(/^(alem|c|p)ão$/i, '\1ães')
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
# Sem acentos...
|
21
|
+
inflect.plural(/ao$/i, 'oes')
|
22
|
+
inflect.plural(/^(irm|m)ao$/i, '\1aos')
|
23
|
+
inflect.plural(/^(alem|c|p)ao$/i, '\1aes')
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
25
|
+
inflect.singular(/([^ê])s$/i, '\1')
|
26
|
+
inflect.singular(/^(á|gá|paí)s$/i, '\1s')
|
27
|
+
inflect.singular(/(r|z)es$/i, '\1')
|
28
|
+
inflect.singular(/([^p])ais$/i, '\1al')
|
29
|
+
inflect.singular(/eis$/i, 'el')
|
30
|
+
inflect.singular(/ois$/i, 'ol')
|
31
|
+
inflect.singular(/uis$/i, 'ul')
|
32
|
+
inflect.singular(/(r|t|f|v)is$/i, '\1il')
|
33
|
+
inflect.singular(/ns$/i, 'm')
|
34
|
+
inflect.singular(/sses$/i, 'sse')
|
35
|
+
inflect.singular(/^(.*[^s]s)es$/i, '\1')
|
36
|
+
inflect.singular(/ães$/i, 'ão')
|
37
|
+
inflect.singular(/aes$/i, 'ao')
|
38
|
+
inflect.singular(/ãos$/i, 'ão')
|
39
|
+
inflect.singular(/aos$/i, 'ao')
|
40
|
+
inflect.singular(/ões$/i, 'ão')
|
41
|
+
inflect.singular(/oes$/i, 'ao')
|
42
|
+
inflect.singular(/(japon|escoc|ingl|dinamarqu|fregu|portugu)eses$/i, '\1ês')
|
43
|
+
inflect.singular(/^(g|)ases$/i, '\1ás')
|
44
44
|
|
45
|
-
|
45
|
+
# #irregulares
|
46
46
|
# irregulares = {'país' => 'paises'}
|
47
47
|
#
|
48
48
|
#
|
@@ -51,5 +51,5 @@
|
|
51
51
|
# inflect.singular(/^#{value}$/, key.to_s)
|
52
52
|
# end
|
53
53
|
|
54
|
-
|
55
|
-
|
54
|
+
inflect.uncountable %w( tórax tênis ônibus lápis fênix )
|
55
|
+
end
|