r18n-core 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ == 1.1.5 (Hilo)
2
+ * Fix Sinatra plugin under multithreaded web-server (by Viktors Rotanovs).
3
+ * Fix BigDecimal localizing (by François Beausoleil).
4
+ * Add American American Spanish locale (by renemarcelo).
5
+
1
6
  == 1.1.4 (Bokmål)
2
7
  * Add Norwegian “no” locale as gateway to Bokmål or Nynorsk.
3
8
  * Fix Norwegian Bokmål locale code.
@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
 
21
21
  require 'pathname'
22
22
  require 'singleton'
23
+ require 'bigdecimal'
23
24
 
24
25
  module R18n
25
26
  # Information about locale (language, country and other special variant
@@ -152,8 +153,8 @@ module R18n
152
153
  case obj
153
154
  when Integer
154
155
  format_integer(obj)
155
- when Float
156
- format_float(obj)
156
+ when Float, BigDecimal
157
+ format_float(obj.to_f)
157
158
  when Time, DateTime, Date
158
159
  return strftime(obj, format) if format.is_a? String
159
160
  return month_standalone[obj.month - 1] if :month == format
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module R18n
3
- VERSION = '1.1.4'.freeze unless defined? R18n::VERSION
3
+ VERSION = '1.1.5'.freeze unless defined? R18n::VERSION
4
4
  end
data/locales/es-us.rb ADDED
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+
3
+ require File.join(File.dirname(__FILE__), 'es')
4
+
5
+ module R18n::Locales
6
+ class EsUs < Es
7
+ set :title => 'Español Estadounidense',
8
+ :sublocales => %w{es},
9
+
10
+ :time_format => ' %I:%M %p',
11
+ :date_format => '%m/%d/%Y',
12
+
13
+ :number_decimal => ".",
14
+ :number_group => ","
15
+ end
16
+ end
data/spec/locale_spec.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require File.expand_path('../spec_helper', __FILE__)
3
+ require 'bigdecimal'
3
4
 
4
5
  describe R18n::Locale do
5
6
  before :all do
@@ -73,6 +74,7 @@ describe R18n::Locale do
73
74
 
74
75
  it "should format float in local traditions" do
75
76
  @en.localize(-12345.67).should == "−12,345.67"
77
+ @en.localize(BigDecimal.new("-12345.67")).should == "−12,345.67"
76
78
  end
77
79
 
78
80
  it "should translate month, week days and am/pm names in strftime" do
metadata CHANGED
@@ -1,52 +1,51 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r18n-core
3
3
  version: !ruby/object:Gem::Version
4
+ version: 1.1.5
4
5
  prerelease:
5
- version: 1.1.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Andrey "A.I." Sitnik
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-11 00:00:00.000000000 Z
12
+ date: 2013-05-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- type: :development
16
15
  name: bundler
17
- version_requirements: !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ! '>='
21
20
  - !ruby/object:Gem::Version
22
21
  version: 1.0.10
23
- requirement: !ruby/object:Gem::Requirement
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
24
25
  none: false
25
26
  requirements:
26
27
  - - ! '>='
27
28
  - !ruby/object:Gem::Version
28
29
  version: 1.0.10
29
- prerelease: false
30
30
  - !ruby/object:Gem::Dependency
31
- type: :development
32
31
  name: yard
33
- version_requirements: !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
34
33
  none: false
35
34
  requirements:
36
35
  - - ! '>='
37
36
  - !ruby/object:Gem::Version
38
37
  version: '0'
39
- requirement: !ruby/object:Gem::Requirement
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
40
41
  none: false
41
42
  requirements:
42
43
  - - ! '>='
43
44
  - !ruby/object:Gem::Version
44
45
  version: '0'
45
- prerelease: false
46
46
  - !ruby/object:Gem::Dependency
47
- type: :development
48
47
  name: rake
49
- version_requirements: !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
50
49
  none: false
51
50
  requirements:
52
51
  - - ! '>='
@@ -55,7 +54,9 @@ dependencies:
55
54
  - - ! '!='
56
55
  - !ruby/object:Gem::Version
57
56
  version: 0.9.0
58
- requirement: !ruby/object:Gem::Requirement
57
+ type: :development
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
59
60
  none: false
60
61
  requirements:
61
62
  - - ! '>='
@@ -64,103 +65,102 @@ dependencies:
64
65
  - - ! '!='
65
66
  - !ruby/object:Gem::Version
66
67
  version: 0.9.0
67
- prerelease: false
68
68
  - !ruby/object:Gem::Dependency
69
- type: :development
70
69
  name: rspec-core
71
- version_requirements: !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
76
- version: '0'
77
70
  requirement: !ruby/object:Gem::Requirement
78
71
  none: false
79
72
  requirements:
80
73
  - - ! '>='
81
74
  - !ruby/object:Gem::Version
82
75
  version: '0'
83
- prerelease: false
84
- - !ruby/object:Gem::Dependency
85
76
  type: :development
86
- name: rspec-expectations
77
+ prerelease: false
87
78
  version_requirements: !ruby/object:Gem::Requirement
88
79
  none: false
89
80
  requirements:
90
81
  - - ! '>='
91
82
  - !ruby/object:Gem::Version
92
83
  version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: rspec-expectations
93
86
  requirement: !ruby/object:Gem::Requirement
94
87
  none: false
95
88
  requirements:
96
89
  - - ! '>='
97
90
  - !ruby/object:Gem::Version
98
91
  version: '0'
99
- prerelease: false
100
- - !ruby/object:Gem::Dependency
101
92
  type: :development
102
- name: rspec-mocks
93
+ prerelease: false
103
94
  version_requirements: !ruby/object:Gem::Requirement
104
95
  none: false
105
96
  requirements:
106
97
  - - ! '>='
107
98
  - !ruby/object:Gem::Version
108
99
  version: '0'
100
+ - !ruby/object:Gem::Dependency
101
+ name: rspec-mocks
109
102
  requirement: !ruby/object:Gem::Requirement
110
103
  none: false
111
104
  requirements:
112
105
  - - ! '>='
113
106
  - !ruby/object:Gem::Version
114
107
  version: '0'
115
- prerelease: false
116
- - !ruby/object:Gem::Dependency
117
108
  type: :development
118
- name: kramdown
109
+ prerelease: false
119
110
  version_requirements: !ruby/object:Gem::Requirement
120
111
  none: false
121
112
  requirements:
122
113
  - - ! '>='
123
114
  - !ruby/object:Gem::Version
124
115
  version: '0'
116
+ - !ruby/object:Gem::Dependency
117
+ name: kramdown
125
118
  requirement: !ruby/object:Gem::Requirement
126
119
  none: false
127
120
  requirements:
128
121
  - - ! '>='
129
122
  - !ruby/object:Gem::Version
130
123
  version: '0'
131
- prerelease: false
132
- - !ruby/object:Gem::Dependency
133
124
  type: :development
134
- name: RedCloth
125
+ prerelease: false
135
126
  version_requirements: !ruby/object:Gem::Requirement
136
127
  none: false
137
128
  requirements:
138
129
  - - ! '>='
139
130
  - !ruby/object:Gem::Version
140
131
  version: '0'
132
+ - !ruby/object:Gem::Dependency
133
+ name: RedCloth
141
134
  requirement: !ruby/object:Gem::Requirement
142
135
  none: false
143
136
  requirements:
144
137
  - - ! '>='
145
138
  - !ruby/object:Gem::Version
146
139
  version: '0'
147
- prerelease: false
148
- - !ruby/object:Gem::Dependency
149
140
  type: :development
150
- name: redcarpet
141
+ prerelease: false
151
142
  version_requirements: !ruby/object:Gem::Requirement
152
143
  none: false
153
144
  requirements:
154
145
  - - ! '>='
155
146
  - !ruby/object:Gem::Version
156
147
  version: '0'
148
+ - !ruby/object:Gem::Dependency
149
+ name: redcarpet
157
150
  requirement: !ruby/object:Gem::Requirement
158
151
  none: false
159
152
  requirements:
160
153
  - - ! '>='
161
154
  - !ruby/object:Gem::Version
162
155
  version: '0'
156
+ type: :development
163
157
  prerelease: false
158
+ version_requirements: !ruby/object:Gem::Requirement
159
+ none: false
160
+ requirements:
161
+ - - ! '>='
162
+ - !ruby/object:Gem::Version
163
+ version: '0'
164
164
  description: ! " R18n is a i18n tool to translate your Ruby application.\n It
165
165
  has nice Ruby-style syntax, filters, flexible locales, custom loaders,\n translation
166
166
  support for any classes, time and number localization, several\n user language
@@ -233,6 +233,7 @@ files:
233
233
  - locales/en-us.rb
234
234
  - locales/en.rb
235
235
  - locales/eo.rb
236
+ - locales/es-us.rb
236
237
  - locales/es.rb
237
238
  - locales/fi.rb
238
239
  - locales/fr.rb
@@ -296,19 +297,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
296
297
  requirements:
297
298
  - - ! '>='
298
299
  - !ruby/object:Gem::Version
300
+ version: '0'
299
301
  segments:
300
302
  - 0
301
- hash: -3448094811323145834
302
- version: '0'
303
+ hash: 3696730246666431868
303
304
  required_rubygems_version: !ruby/object:Gem::Requirement
304
305
  none: false
305
306
  requirements:
306
307
  - - ! '>='
307
308
  - !ruby/object:Gem::Version
309
+ version: '0'
308
310
  segments:
309
311
  - 0
310
- hash: -3448094811323145834
311
- version: '0'
312
+ hash: 3696730246666431868
312
313
  requirements: []
313
314
  rubyforge_project:
314
315
  rubygems_version: 1.8.23