i18n 0.6.5 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of i18n might be problematic. Click here for more details.

@@ -25,7 +25,7 @@ module I18n
25
25
 
26
26
  # Write methods which delegates to the configuration object
27
27
  %w(locale backend default_locale available_locales default_separator
28
- exception_handler load_path).each do |method|
28
+ exception_handler load_path enforce_available_locales).each do |method|
29
29
  module_eval <<-DELEGATORS, __FILE__, __LINE__ + 1
30
30
  def #{method}
31
31
  config.#{method}
@@ -147,6 +147,7 @@ module I18n
147
147
  locale = options.delete(:locale) || config.locale
148
148
  handling = options.delete(:throw) && :throw || options.delete(:raise) && :raise # TODO deprecate :raise
149
149
 
150
+ enforce_available_locales!(locale)
150
151
  raise I18n::ArgumentError if key.is_a?(String) && key.empty?
151
152
 
152
153
  result = catch(:exception) do
@@ -167,6 +168,12 @@ module I18n
167
168
  end
168
169
  alias :t! :translate!
169
170
 
171
+ # Returns true if a translation exists for a given key, otherwise returns false.
172
+ def exists?(key, locale = config.locale)
173
+ raise I18n::ArgumentError if key.is_a?(String) && key.empty?
174
+ config.backend.exists?(locale, key)
175
+ end
176
+
170
177
  # Transliterates UTF-8 characters to ASCII. By default this method will
171
178
  # transliterate only Latin strings to an ASCII approximation:
172
179
  #
@@ -224,6 +231,7 @@ module I18n
224
231
  locale = options && options.delete(:locale) || config.locale
225
232
  handling = options && (options.delete(:throw) && :throw || options.delete(:raise) && :raise)
226
233
  replacement = options && options.delete(:replacement)
234
+ enforce_available_locales!(locale)
227
235
  config.backend.transliterate(locale, key, replacement)
228
236
  rescue I18n::ArgumentError => exception
229
237
  handle_exception(handling, exception, locale, key, options || {})
@@ -234,6 +242,7 @@ module I18n
234
242
  options = options ? options.dup : {}
235
243
  locale = options.delete(:locale) || config.locale
236
244
  format = options.delete(:format) || :default
245
+ enforce_available_locales!(locale)
237
246
  config.backend.localize(locale, object, format, options)
238
247
  end
239
248
  alias :l :localize
@@ -262,6 +271,24 @@ module I18n
262
271
  keys
263
272
  end
264
273
 
274
+ # Returns true when the passed locale is in I18.available_locales.
275
+ # Returns false otherwise.
276
+ # Compare with Strings as `locale` may be coming from user input
277
+ def locale_available?(locale)
278
+ I18n.available_locales.map(&:to_s).include?(locale.to_s)
279
+ end
280
+
281
+ # Raises an InvalidLocale exception when the passed locale is not
282
+ # included in I18n.available_locales.
283
+ # Returns false otherwise
284
+ def enforce_available_locales!(locale)
285
+ handle_enforce_available_locales_deprecation
286
+
287
+ if config.enforce_available_locales
288
+ raise I18n::InvalidLocale.new(locale) if !locale_available?(locale)
289
+ end
290
+ end
291
+
265
292
  # making these private until Ruby 1.9.2 can send to protected methods again
266
293
  # see http://redmine.ruby-lang.org/repositories/revision/ruby-19?rev=24280
267
294
  private
@@ -329,5 +356,12 @@ module I18n
329
356
  "(an instance of which is set to I18n.exception_handler by default)."
330
357
  exception.is_a?(MissingTranslation) ? exception.message : raise(exception)
331
358
  end
359
+
360
+ def handle_enforce_available_locales_deprecation
361
+ if config.enforce_available_locales.nil? && !@unenforced_available_locales_deprecation
362
+ $stderr.puts "[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message."
363
+ @unenforced_available_locales_deprecation = true
364
+ end
365
+ end
332
366
  })
333
367
  end
@@ -42,6 +42,10 @@ module I18n
42
42
  entry
43
43
  end
44
44
 
45
+ def exists?(locale, key)
46
+ lookup(locale, key) != nil
47
+ end
48
+
45
49
  # Acts the same as +strftime+, but uses a localized version of the
46
50
  # format string. Takes a key from the date/time formats translations as
47
51
  # a format argument (<em>e.g.</em>, <tt>:short</tt> in <tt>:'date.formats'</tt>).
@@ -56,6 +56,12 @@ module I18n
56
56
  throw(:exception, I18n::MissingTranslation.new(locale, key, options))
57
57
  end
58
58
 
59
+ def exists?(locale, key)
60
+ backends.any? do |backend|
61
+ backend.exists?(locale, key)
62
+ end
63
+ end
64
+
59
65
  def localize(locale, object, format = :default, options = {})
60
66
  backends.each do |backend|
61
67
  catch(:exception) do
@@ -8,6 +8,7 @@ module I18n
8
8
 
9
9
  # Sets the current locale pseudo-globally, i.e. in the Thread.current hash.
10
10
  def locale=(locale)
11
+ I18n.enforce_available_locales!(locale)
11
12
  @locale = locale.to_sym rescue nil
12
13
  end
13
14
 
@@ -28,6 +29,7 @@ module I18n
28
29
 
29
30
  # Sets the current default locale. Used to set a custom default locale.
30
31
  def default_locale=(locale)
32
+ I18n.enforce_available_locales!(locale)
31
33
  @@default_locale = locale.to_sym rescue nil
32
34
  end
33
35
 
@@ -105,5 +107,15 @@ module I18n
105
107
  def load_path=(load_path)
106
108
  @@load_path = load_path
107
109
  end
110
+
111
+ # [Deprecated] this will default to true in the future
112
+ # Defaults to nil so that it triggers the deprecation warning
113
+ def enforce_available_locales
114
+ @@enforce_available_locales ||= nil
115
+ end
116
+
117
+ def enforce_available_locales=(enforce_available_locales)
118
+ @@enforce_available_locales = enforce_available_locales
119
+ end
108
120
  end
109
121
  end
@@ -1,3 +1,5 @@
1
+ require 'cgi'
2
+
1
3
  module I18n
2
4
  # Handles exceptions raised in the backend. All exceptions except for
3
5
  # MissingTranslationData exceptions are re-thrown. When a MissingTranslationData
@@ -7,7 +9,19 @@ module I18n
7
9
  include Module.new {
8
10
  def call(exception, locale, key, options)
9
11
  if exception.is_a?(MissingTranslation)
10
- options[:rescue_format] == :html ? exception.html_message : exception.message
12
+ #
13
+ # TODO: this block is to be replaced by `exception.message` when
14
+ # rescue_format is removed
15
+ if options[:rescue_format] == :html
16
+ if @rescue_format_deprecation
17
+ $stderr.puts "[DEPRECATED] I18n's :recue_format option will be removed from a future release. All exception messages will be plain text. If you need the exception handler to return an html format please set or pass a custom exception handler."
18
+ @rescue_format_deprecation = true
19
+ end
20
+ exception.html_message
21
+ else
22
+ exception.message
23
+ end
24
+
11
25
  elsif exception.is_a?(Exception)
12
26
  raise exception
13
27
  else
@@ -45,8 +59,9 @@ module I18n
45
59
  end
46
60
 
47
61
  def html_message
48
- key = keys.last.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1.capitalize }
49
- %(<span class="translation_missing" title="translation missing: #{keys.join('.')}">#{key}</span>)
62
+ key = CGI.escapeHTML titleize(keys.last)
63
+ path = CGI.escapeHTML keys.join('.')
64
+ %(<span class="translation_missing" title="translation missing: #{path}">#{key}</span>)
50
65
  end
51
66
 
52
67
  def keys
@@ -63,6 +78,13 @@ module I18n
63
78
  def to_exception
64
79
  MissingTranslationData.new(locale, key, options)
65
80
  end
81
+
82
+ protected
83
+
84
+ # TODO : remove when #html_message is removed
85
+ def titleize(key)
86
+ key.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1.capitalize }
87
+ end
66
88
  end
67
89
 
68
90
  include Base
@@ -41,6 +41,11 @@ module I18n
41
41
  assert_equal I18n.available_locales, I18n.available_locales
42
42
  end
43
43
 
44
+ test "exists? is implemented by the backend" do
45
+ I18n.backend.store_translations(:foo, :bar => 'baz')
46
+ assert I18n.exists?(:bar, :foo)
47
+ end
48
+
44
49
  test "storing a nil value as a translation removes it from the available locale data" do
45
50
  I18n.backend.store_translations(:en, :to_be_deleted => 'bar')
46
51
  assert_equal 'bar', I18n.t(:to_be_deleted, :default => 'baz')
@@ -1,3 +1,3 @@
1
1
  module I18n
2
- VERSION = "0.6.5"
2
+ VERSION = "0.6.8"
3
3
  end
@@ -28,9 +28,13 @@ class I18nExceptionsTest < Test::Unit::TestCase
28
28
  end
29
29
 
30
30
  test "MissingTranslationData html_message is a span with the titlelized last key token" do
31
- force_missing_translation_data do |exception|
32
- assert_equal '<span class="translation_missing" title="translation missing: de.bar.foo">Foo</span>', exception.html_message
33
- end
31
+ exception = I18n::MissingTranslationData.new(:de, :foo, :scope => :bar)
32
+ assert_equal '<span class="translation_missing" title="translation missing: de.bar.foo">Foo</span>', exception.html_message
33
+ end
34
+
35
+ test "MissingTranslationData html_message html escapes key names" do
36
+ exception = I18n::MissingTranslationData.new(:de, '<script>Evil</script>', :scope => '<iframe src="example.com" />')
37
+ assert_equal '<span class="translation_missing" title="translation missing: de.&lt;iframe src=&quot;example.com&quot; /&gt;.&lt;script&gt;Evil&lt;/script&gt;">&lt;Script&gt;Evil&lt;/Script&gt;</span>', exception.html_message
34
38
  end
35
39
 
36
40
  test "ExceptionHandler returns the html_message if :rescue_format => :html was given" do
@@ -4,6 +4,7 @@ require 'test_helper'
4
4
  class I18nTest < Test::Unit::TestCase
5
5
  def setup
6
6
  I18n.backend.store_translations(:'en', :currency => { :format => { :separator => '.', :delimiter => ',', } })
7
+ I18n.backend.store_translations(:'nl', :currency => { :format => { :separator => ',', :delimiter => '.', } })
7
8
  end
8
9
 
9
10
  test "exposes its VERSION constant" do
@@ -36,6 +37,15 @@ class I18nTest < Test::Unit::TestCase
36
37
  end
37
38
  end
38
39
 
40
+ test "raises an I18n::InvalidLocale exception when setting an unavailable default locale" do
41
+ begin
42
+ I18n.config.enforce_available_locales = true
43
+ assert_raise(I18n::InvalidLocale) { I18n.default_locale = :klingon }
44
+ ensure
45
+ I18n.config.enforce_available_locales = false
46
+ end
47
+ end
48
+
39
49
  test "uses the default locale as a locale by default" do
40
50
  assert_equal I18n.default_locale, I18n.locale
41
51
  end
@@ -46,6 +56,15 @@ class I18nTest < Test::Unit::TestCase
46
56
  assert_equal :de, Thread.current[:i18n_config].locale
47
57
  I18n.locale = :en
48
58
  end
59
+
60
+ test "raises an I18n::InvalidLocale exception when setting an unavailable locale" do
61
+ begin
62
+ I18n.config.enforce_available_locales = true
63
+ assert_raise(I18n::InvalidLocale) { I18n.locale = :klingon }
64
+ ensure
65
+ I18n.config.enforce_available_locales = false
66
+ end
67
+ end
49
68
 
50
69
  test "can set the configuration object" do
51
70
  begin
@@ -187,14 +206,56 @@ class I18nTest < Test::Unit::TestCase
187
206
  assert_raise(I18n::ArgumentError) { I18n.t("") }
188
207
  end
189
208
 
209
+ test "translate given an unavailable locale rases an I18n::InvalidLocale" do
210
+ begin
211
+ I18n.config.enforce_available_locales = true
212
+ assert_raise(I18n::InvalidLocale) { I18n.t(:foo, :locale => 'klingon') }
213
+ ensure
214
+ I18n.config.enforce_available_locales = false
215
+ end
216
+ end
217
+
218
+ test "exists? given an existing key will return true" do
219
+ assert_equal true, I18n.exists?(:currency)
220
+ end
221
+
222
+ test "exists? given a non-existing key will return false" do
223
+ assert_equal false, I18n.exists?(:bogus)
224
+ end
225
+
226
+ test "exists? given an existing dot-separated key will return true" do
227
+ assert_equal true, I18n.exists?('currency.format.delimiter')
228
+ end
229
+
230
+ test "exists? given a non-existing dot-separated key will return false" do
231
+ assert_equal false, I18n.exists?('currency.format.bogus')
232
+ end
233
+
234
+ test "exists? given an existing key and an existing locale will return true" do
235
+ assert_equal true, I18n.exists?(:currency, :nl)
236
+ end
237
+
238
+ test "exists? given a non-existing key and an existing locale will return false" do
239
+ assert_equal false, I18n.exists?(:bogus, :nl)
240
+ end
241
+
190
242
  test "localize given nil raises an I18n::ArgumentError" do
191
243
  assert_raise(I18n::ArgumentError) { I18n.l nil }
192
244
  end
193
245
 
194
- test "localize givan an Object raises an I18n::ArgumentError" do
246
+ test "localize given an Object raises an I18n::ArgumentError" do
195
247
  assert_raise(I18n::ArgumentError) { I18n.l Object.new }
196
248
  end
197
249
 
250
+ test "localize given an unavailable locale rases an I18n::InvalidLocale" do
251
+ begin
252
+ I18n.config.enforce_available_locales = true
253
+ assert_raise(I18n::InvalidLocale) { I18n.l(Time.now, :locale => 'klingon') }
254
+ ensure
255
+ I18n.config.enforce_available_locales = false
256
+ end
257
+ end
258
+
198
259
  test "can use a lambda as an exception handler" do
199
260
  begin
200
261
  previous_exception_handler = I18n.exception_handler
@@ -251,4 +312,45 @@ class I18nTest < Test::Unit::TestCase
251
312
  }
252
313
  end
253
314
 
315
+ test "transliterate given an unavailable locale rases an I18n::InvalidLocale" do
316
+ begin
317
+ I18n.config.enforce_available_locales = true
318
+ assert_raise(I18n::InvalidLocale) { I18n.transliterate('string', :locale => 'klingon') }
319
+ ensure
320
+ I18n.config.enforce_available_locales = false
321
+ end
322
+ end
323
+
324
+ test "I18n.locale_available? returns true when the passed locale is available" do
325
+ I18n.available_locales = [:en, :de]
326
+ assert_equal true, I18n.locale_available?(:de)
327
+ end
328
+
329
+ test "I18n.locale_available? returns true when the passed locale is a string and is available" do
330
+ I18n.available_locales = [:en, :de]
331
+ assert_equal true, I18n.locale_available?('de')
332
+ end
333
+
334
+ test "I18n.locale_available? returns false when the passed locale is unavailable" do
335
+ assert_equal false, I18n.locale_available?(:klingon)
336
+ end
337
+
338
+ test "I18n.enforce_available_locales! raises an I18n::InvalidLocale when the passed locale is unavailable" do
339
+ begin
340
+ I18n.config.enforce_available_locales = true
341
+ assert_raise(I18n::InvalidLocale) { I18n.enforce_available_locales!(:klingon) }
342
+ ensure
343
+ I18n.config.enforce_available_locales = false
344
+ end
345
+ end
346
+
347
+ test "I18n.enforce_available_locales! does nothing when the passed locale is available" do
348
+ I18n.available_locales = [:en, :de]
349
+ begin
350
+ I18n.config.enforce_available_locales = true
351
+ assert_nothing_raised { I18n.enforce_available_locales!(:en) }
352
+ ensure
353
+ I18n.config.enforce_available_locales = false
354
+ end
355
+ end
254
356
  end
metadata CHANGED
@@ -1,10 +1,15 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: i18n
3
- version: !ruby/object:Gem::Version
4
- version: 0.6.5
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 6
9
+ - 8
10
+ version: 0.6.8
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Sven Fuchs
9
14
  - Joshua Harvey
10
15
  - Matt Aimonetti
@@ -13,78 +18,76 @@ authors:
13
18
  autorequire:
14
19
  bindir: bin
15
20
  cert_chain: []
16
- date: 2013-08-13 00:00:00.000000000 Z
17
- dependencies:
18
- - !ruby/object:Gem::Dependency
21
+
22
+ date: 2013-12-03 00:00:00 Z
23
+ dependencies:
24
+ - !ruby/object:Gem::Dependency
19
25
  name: activesupport
20
- requirement: !ruby/object:Gem::Requirement
21
- none: false
22
- requirements:
23
- - - ! '>='
24
- - !ruby/object:Gem::Version
25
- version: 3.0.0
26
- type: :development
27
26
  prerelease: false
28
- version_requirements: !ruby/object:Gem::Requirement
27
+ requirement: &id001 !ruby/object:Gem::Requirement
29
28
  none: false
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ hash: 7
33
+ segments:
34
+ - 3
35
+ - 0
36
+ - 0
33
37
  version: 3.0.0
34
- - !ruby/object:Gem::Dependency
35
- name: sqlite3
36
- requirement: !ruby/object:Gem::Requirement
37
- none: false
38
- requirements:
39
- - - ! '>='
40
- - !ruby/object:Gem::Version
41
- version: '0'
42
38
  type: :development
39
+ version_requirements: *id001
40
+ - !ruby/object:Gem::Dependency
41
+ name: sqlite3
43
42
  prerelease: false
44
- version_requirements: !ruby/object:Gem::Requirement
43
+ requirement: &id002 !ruby/object:Gem::Requirement
45
44
  none: false
46
- requirements:
47
- - - ! '>='
48
- - !ruby/object:Gem::Version
49
- version: '0'
50
- - !ruby/object:Gem::Dependency
51
- name: mocha
52
- requirement: !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ! '>='
56
- - !ruby/object:Gem::Version
57
- version: '0'
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ hash: 3
49
+ segments:
50
+ - 0
51
+ version: "0"
58
52
  type: :development
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ name: mocha
59
56
  prerelease: false
60
- version_requirements: !ruby/object:Gem::Requirement
61
- none: false
62
- requirements:
63
- - - ! '>='
64
- - !ruby/object:Gem::Version
65
- version: '0'
66
- - !ruby/object:Gem::Dependency
67
- name: test_declarative
68
- requirement: !ruby/object:Gem::Requirement
57
+ requirement: &id003 !ruby/object:Gem::Requirement
69
58
  none: false
70
- requirements:
71
- - - ! '>='
72
- - !ruby/object:Gem::Version
73
- version: '0'
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ hash: 3
63
+ segments:
64
+ - 0
65
+ version: "0"
74
66
  type: :development
67
+ version_requirements: *id003
68
+ - !ruby/object:Gem::Dependency
69
+ name: test_declarative
75
70
  prerelease: false
76
- version_requirements: !ruby/object:Gem::Requirement
71
+ requirement: &id004 !ruby/object:Gem::Requirement
77
72
  none: false
78
- requirements:
79
- - - ! '>='
80
- - !ruby/object:Gem::Version
81
- version: '0'
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ hash: 3
77
+ segments:
78
+ - 0
79
+ version: "0"
80
+ type: :development
81
+ version_requirements: *id004
82
82
  description: New wave Internationalization support for Ruby.
83
83
  email: rails-i18n@googlegroups.com
84
84
  executables: []
85
+
85
86
  extensions: []
87
+
86
88
  extra_rdoc_files: []
87
- files:
89
+
90
+ files:
88
91
  - ci/Gemfile.no-rails
89
92
  - ci/Gemfile.no-rails.lock
90
93
  - ci/Gemfile.rails-2.3.x
@@ -179,30 +182,40 @@ files:
179
182
  - test/test_helper.rb
180
183
  - README.textile
181
184
  - MIT-LICENSE
182
- - CHANGELOG.textile
183
185
  homepage: http://github.com/svenfuchs/i18n
184
- licenses:
186
+ licenses:
185
187
  - MIT
186
188
  post_install_message:
187
189
  rdoc_options: []
188
- require_paths:
190
+
191
+ require_paths:
189
192
  - lib
190
- required_ruby_version: !ruby/object:Gem::Requirement
193
+ required_ruby_version: !ruby/object:Gem::Requirement
191
194
  none: false
192
- requirements:
193
- - - ! '>='
194
- - !ruby/object:Gem::Version
195
- version: '0'
196
- required_rubygems_version: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ hash: 3
199
+ segments:
200
+ - 0
201
+ version: "0"
202
+ required_rubygems_version: !ruby/object:Gem::Requirement
197
203
  none: false
198
- requirements:
199
- - - ! '>='
200
- - !ruby/object:Gem::Version
204
+ requirements:
205
+ - - ">="
206
+ - !ruby/object:Gem::Version
207
+ hash: 17
208
+ segments:
209
+ - 1
210
+ - 3
211
+ - 5
201
212
  version: 1.3.5
202
213
  requirements: []
203
- rubyforge_project: ! '[none]'
204
- rubygems_version: 1.8.23
214
+
215
+ rubyforge_project: "[none]"
216
+ rubygems_version: 1.8.6
205
217
  signing_key:
206
218
  specification_version: 3
207
219
  summary: New wave Internationalization support for Ruby
208
220
  test_files: []
221
+
@@ -1,152 +0,0 @@
1
- h1. Changelog
2
-
3
- h2. 0.5.0
4
-
5
- * "Extract Backend::ActiveRecord to a separate gem":https://github.com/svenfuchs/i18n/commit/197dacebad356b910d69fa69a719c2ad10cf49e6 (see "i18n-active_record":https://github.com/svenfuchs/i18n-active_record)
6
- * "Improve exception handling":https://github.com/svenfuchs/i18n/commit/2913ff9a7544f223f60e7d7b32c2a0e1af89812b (deprectates I18n.default_exception_handler)
7
- * "Change MissingTranslationData message to 'translation missing: foo.bar'":https://github.com/svenfuchs/i18n/commit/68fdfe47952325411afe5942e971ce10b2bdf900
8
- * "Expose MissingTranslationsData#keys method":https://github.com/svenfuchs/i18n/commit/3a37a389ecaac9670355b334e23e775549ee9822
9
- * "Improve Cascade#lookup (add default options)":https://github.com/svenfuchs/i18n/commit/0b9a1f2058a2be9543106cc19d08071c359511e1
10
- * "Finally remove deprecated interpolation syntax":https://github.com/svenfuchs/i18n/commit/2d43846d2b2a2e596f30fa58ea1c9ddb2243bb64
11
-
12
- h2. 0.4.2 (2010-10-26)
13
-
14
- * "Improve UTF8 handling":http://github.com/svenfuchs/i18n/commit/e8d5820a3b08eeca28de1a2b9c8a6ad2b9e6476c
15
- * "Expose I18n::VERSION":http://github.com/svenfuchs/i18n/commit/b832037bac94c7144f45f3ff5e3b4e4089781726
16
- * "Better deprecation output":http://github.com/svenfuchs/i18n/commit/2bee924464b8a9c33d3d7852eb1c8423aa38cc25
17
-
18
- h2. 0.4.1 (2010-06-05)
19
-
20
- * "Fix interpolation failure on Ruby 1.9":http://github.com/svenfuchs/i18n/commit/8d45bedb11c4136c00e853d104b00a8e67ec4894
21
-
22
- h2. 0.4.0 (2010-05-27)
23
-
24
- * "The localization proc also receives the object as option":http://github.com/svenfuchs/i18n/commit/4a8cd9fa660daaa3078e24c5851353ca377d9213
25
-
26
- h2. 0.4.0.beta1 (2010-05-03)
27
-
28
- * "Renamed Fast backend to Memoize backend":http://github.com/svenfuchs/i18n/commit/f7f7dc12c00a19d3876223771e14f8671ff313cd
29
-
30
- * "Deprecate {{}} as interpolation syntax":http://github.com/svenfuchs/i18n/commit/8894ee521ef5788c415b625a6daf522af4c416e0
31
-
32
- * "Allow nil translation to be stored again":http://github.com/svenfuchs/i18n/commit/f2074f1e82d10c2e9a801c8cc2f2a0c7c30703ba
33
-
34
- h2. 0.4.0.beta (2010-04-30)
35
-
36
- * "Added a KeyValue backend":http://github.com/svenfuchs/i18n/commit/28ca5f53ade7f545f8c0804e93564d4686b416a4
37
-
38
- * "Added transliteration support":http://github.com/svenfuchs/i18n/commit/928fdb4794959e779e90f360eb01ba043672d8d5
39
-
40
- * "Create Flatten backend module to aid handling flatten translations":http://github.com/svenfuchs/i18n/commit/2ec9d6998aa8facd7b15a3ef47a96cf2471cd8a1
41
-
42
- * "Decouple the external separator (used when storing translations) from the internal separator in Fast and ActiveRecord backends":http://github.com/svenfuchs/i18n/commit/274cb4daa0ca5e3b2bd23b45eb7f9fc58f75a79d
43
-
44
- h2. 0.3.7 (2010-04-17)
45
-
46
- * "Speed up I18n.normalize_keys by caching reused normalizations and producing less garbage":http://github.com/svenfuchs/i18n/commit/819dac0fea9c29e6545801aa107e63e355728cd4
47
-
48
- h2. 0.3.6 (2010-03-23)
49
-
50
- * "Move gettext po parser to lib":http://github.com/svenfuchs/i18n/commit/b2f038663b55727ac2327e6f07a46ba5d69d600c
51
-
52
- * "Move I18n configuration to I18n.config":http://github.com/svenfuchs/i18n/commit/4a7baea86663ead8c681008c3e80a622f0546b07
53
-
54
- h2. 0.3.5 (2010-02-26)
55
-
56
- * "Delegate I18n.normalize_translation_keys to I18n.normalize_keys and deprecate
57
- the former":http://github.com/svenfuchs/i18n/commit/7284b04d5f5dd9679cb68875515cdd0cdfc96fef
58
-
59
- h2. 0.3.4 (2010-02-25)
60
-
61
- * "Rename I18n.normalize_translation_keys to I18n.normalize_keys and finally make it public":http://github.com/svenfuchs/i18n/commit/20b05fe5802df6c90fb70a4e3760b2b851b791b3
62
-
63
- * "Added CLDR supoprt":http://github.com/svenfuchs/i18n/commit/860eadf671a231e7f5dffb1bb27fa318ff7a8786
64
-
65
- h2. 0.3.3 (2009-12-29)
66
-
67
- * "Use lib/i18n/version":http://github.com/svenfuchs/i18n/commit/ff426c8e7a2438b814cb303adadec292dacb752e
68
-
69
- * "Added a benchmark suite":http://github.com/svenfuchs/i18n/commit/f9b5b9b113097724638bdab96862ffa404e67e70
70
-
71
- * "Ensure links can be handled recursively":http://github.com/svenfuchs/i18n/commit/2c50bd209f3fc24fe9dfa694c81be64340f09b7d
72
-
73
- * "Make sure we can lookup false values as translation data":http://github.com/svenfuchs/i18n/commit/561c82ba4b8921d03bfdf56cb2d0c2f287629001
74
-
75
- * "Added Fast backend module":http://github.com/svenfuchs/i18n/commit/bd2f09f0a251ca793b0e8ecc7e32177a2f091c23
76
-
77
- * "Added InterpolationCompiler backend module":http://github.com/svenfuchs/i18n/commit/91810887d1abfb28996a9183bc9004678290d28b
78
-
79
- h2. 0.3.2 (2009-12-12)
80
-
81
- * "Added Cascade backend":http://github.com/svenfuchs/i18n/commit/8009aef293e9ef8564c9005090d8380feabcaf6f
82
-
83
- h2. 0.3.1 (2009-12-11)
84
-
85
- * "Add PoParser to gemspec":http://github.com/svenfuchs/i18n/commit/d6b2763f39c932f66adb039b96882a472f883c51
86
- * "Enable custom separators for ActiveRecord backend":http://github.com/svenfuchs/i18n/commit/9341d3fcfc951cc31807ba672d2b5d90909ef3e5
87
- * "Pass interpolation values to interpolation procs":http://github.com/svenfuchs/i18n/commit/39c2ed8fbad645671cd5520ce7ad0aeefe2b0cca
88
- * "Fix that ngettext supports keys with dots":http://github.com/svenfuchs/i18n/commit/7362a43c34364d500de8899cfcca6bf1a5e6d1c8
89
-
90
- h2. 0.3.0 (2009-11-30)
91
-
92
- * "Gettext backend and helpers":http://github.com/svenfuchs/i18n/commit/35a1740d2f10b808548af352006950da4017e374
93
- * "Metadata module":http://github.com/svenfuchs/i18n/commit/2677208555179b36fcbe958c0e8bc642cf5bc020
94
- * "Basic ActiveRecord backend":http://github.com/svenfuchs/i18n/commit/786632d0b42de423ecf0969622efc87f1691e2a2
95
- * "Set encoding to UTF8 for all files":http://github.com/svenfuchs/i18n/commit/9be3d4a311b5bf583eec5d39986176cc40c112f2
96
- * "Chain backend":http://github.com/svenfuchs/i18n/commit/08259ffb88b3005403648d77bc1cbca0b92f3cf5
97
- * "Backend/cache implementation":http://github.com/svenfuchs/i18n/commit/e7bf15351cd2e27f5972eb40e65a5dd6f4a0feed
98
- * "Pluralization module":http://github.com/svenfuchs/i18n/commit/9ca4c9ed52d4706566a6abeb2d78722dcc5d4764
99
- * "add and adapt Globalize2 fallback implementation":http://github.com/svenfuchs/i18n/commit/1b37a303b27d6222b17162804b06323e5628768f
100
- * "move Simple backend implementation to a Base backend class and extend Simple from Base.":http://github.com/svenfuchs/i18n/commit/32ddc80a04e6aa247f6d6613bde7f78c73396cb4
101
-
102
- h2. 0.2.0 (2009-07-12)
103
-
104
- * "Allow using Ruby 1.9 syntax for string interpolation (API addition)":http://github.com/svenfuchs/i18n/commit/c6e0b06d512f2af57199a843a1d8a40241b32861
105
- * "Allow configuring the default scope separator, allow to pass a custom scope separator(API addition)":http://github.com/svenfuchs/i18n/commit/5b75bfbc348061adc11e3790187a187275bfd471 (e.g. I18n.t(:'foo|bar', :separator => '|')
106
- * "Pass :format option to #translate for #localize more useful lambda support":http://github.com/svenfuchs/i18n/commit/e277711b3c844fe7589b8d3f9af0f7d1b969a273
107
- * "Refactor Simple backend #resolve to #default and #resolve for more consistency. Now allows to pass lambdas as defaults and re-resolve Symbols":http://github.com/svenfuchs/i18n/commit/8c4ce3d923ce5fa73e973fe28217e18165549aba
108
- * "Add lambda support to #translate (API addition)":http://github.com/svenfuchs/i18n/commit/c90e62d8f7d3d5b78f34cfe328d871b58884f115
109
- * "Add lambda support to #localize (API addition)":http://github.com/svenfuchs/i18n/commit/9d390afcf33f3f469bb95e6888147152f6cc7442
110
-
111
- h2. 0.1.3 (2009-02-27)
112
-
113
- * "Remove unnecessary string encoding handling in the i18n simple backend which made the backend break on Ruby 1.9":http://github.com/svenfuchs/i18n/commit/4c3a970783861a94f2e89f46714fb3434e4f4f8d
114
-
115
- h2. 0.1.2 (2009-01-09)
116
-
117
- * "added #available_locales (returns an array of locales for which translations are available)":http://github.com/svenfuchs/i18n/commit/411f8fe7c8f3f89e9b6b921fa62ed66cb92f3af4
118
- * "flatten load_path before using it so that a nested array of paths won't throw up":http://github.com/svenfuchs/i18n/commit/d473a068a2b90aba98135deb225d6eb6d8104d70
119
-
120
- h2. 0.1.1 (2008-11-20)
121
-
122
- * "Use :'en' as a default locale (in favor of :'en-US')":http://github.com/svenfuchs/i18n/commit/c4b10b246aecf7da78cb2568dd0d2ab7e6b8a230
123
- * "Add #reload! to Simple backend":http://github.com/svenfuchs/i18n/commit/36dd2bd9973b9e1559728749a9daafa44693e964
124
-
125
- h2. 0.1.0 (2008-10-25)
126
-
127
- * "Fix Simple backend to distinguish false from nil values":http://github.com/svenfuchs/i18n/commit/39d9a47da14b5f3ba126af48923af8c30e135166
128
- * "Add #load_path to public api, add initialize to simple backend and remove #load_translations from public api":http://github.com/svenfuchs/i18n/commit/c4c5649e6bc8f020f1aaf5a5470bde048e22c82d
129
- * "Speed up Backend::Simple#interpolate":http://github.com/svenfuchs/i18n/commit/9e1ac6bf8833304e036323ec9932b9f33c468a35
130
- * "Remove #populate and #store_translations from public API":http://github.com/svenfuchs/i18n/commit/f4e514a80be7feb509f66824ee311905e2940900
131
- * "Use :other instead of :many as a plural key":http://github.com/svenfuchs/i18n/commit/0f8f20a2552bf6a2aa758d8fdd62a7154e4a1bf6
132
- * "Use a class instead of a module for Simple backend":http://github.com/svenfuchs/i18n/commit/08f051aa61320c17debde24a83268bc74e33b995
133
- * "Make Simple backend #interpolate deal with non-ASCII string encodings":http://github.com/svenfuchs/i18n/commit/d84a3f3f55543c084d5dc5d1fed613b8df148789
134
- * "Fix default arrays of non-existant keys returning the default array":http://github.com/svenfuchs/i18n/commit/6c04ca86c87f97dc78f07c2a4023644e5ba8b839
135
-
136
- h2. Initial implementation (June/July 2008)
137
-
138
- Initial implementation by "Sven Fuchs":http://www.workingwithrails.com/person/9963-sven-fuchs based on previous discussion/consensus of the rails-i18n team (alphabetical order) and many others:
139
-
140
- * "Matt Aimonetti":http://railsontherun.com
141
- * "Sven Fuchs":http://www.workingwithrails.com/person/9963-sven-fuchs
142
- * "Joshua Harvey":http://www.workingwithrails.com/person/759-joshua-harvey
143
- * "Saimon Moore":http://saimonmoore.net
144
- * "Stephan Soller":http://www.arkanis-development.de
145
-
146
- h2. More information
147
-
148
- * "Homepage":http://rails-i18n.org
149
- * "Wiki":http://rails-i18n.org/wiki
150
- * "Mailinglist":http://groups.google.com/group/rails-i18n
151
- * "About the project/history":http://www.artweb-design.de/2008/7/18/finally-ruby-on-rails-gets-internationalized
152
- * "Initial API Intro":http://www.artweb-design.de/2008/7/18/the-ruby-on-rails-i18n-core-api