i18n 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -0
  3. data/lib/i18n/backend.rb +1 -0
  4. data/lib/i18n/backend/base.rb +12 -1
  5. data/lib/i18n/backend/cache_file.rb +36 -0
  6. data/lib/i18n/backend/chain.rb +22 -0
  7. data/lib/i18n/backend/key_value.rb +24 -0
  8. data/lib/i18n/backend/simple.rb +1 -1
  9. data/lib/i18n/config.rb +16 -0
  10. data/lib/i18n/core_ext/hash.rb +8 -0
  11. data/lib/i18n/interpolate/ruby.rb +5 -3
  12. data/lib/i18n/version.rb +1 -1
  13. metadata +16 -52
  14. data/gemfiles/Gemfile.rails-3.2.x +0 -10
  15. data/gemfiles/Gemfile.rails-4.0.x +0 -10
  16. data/gemfiles/Gemfile.rails-4.1.x +0 -10
  17. data/gemfiles/Gemfile.rails-4.2.x +0 -10
  18. data/gemfiles/Gemfile.rails-5.0.x +0 -10
  19. data/gemfiles/Gemfile.rails-5.1.x +0 -10
  20. data/gemfiles/Gemfile.rails-master +0 -10
  21. data/test/api/all_features_test.rb +0 -58
  22. data/test/api/cascade_test.rb +0 -28
  23. data/test/api/chain_test.rb +0 -24
  24. data/test/api/fallbacks_test.rb +0 -30
  25. data/test/api/key_value_test.rb +0 -24
  26. data/test/api/memoize_test.rb +0 -56
  27. data/test/api/override_test.rb +0 -42
  28. data/test/api/pluralization_test.rb +0 -30
  29. data/test/api/simple_test.rb +0 -28
  30. data/test/backend/cache_test.rb +0 -109
  31. data/test/backend/cascade_test.rb +0 -86
  32. data/test/backend/chain_test.rb +0 -122
  33. data/test/backend/exceptions_test.rb +0 -36
  34. data/test/backend/fallbacks_test.rb +0 -211
  35. data/test/backend/interpolation_compiler_test.rb +0 -118
  36. data/test/backend/key_value_test.rb +0 -85
  37. data/test/backend/memoize_test.rb +0 -79
  38. data/test/backend/metadata_test.rb +0 -48
  39. data/test/backend/pluralization_test.rb +0 -45
  40. data/test/backend/simple_test.rb +0 -111
  41. data/test/backend/transliterator_test.rb +0 -84
  42. data/test/core_ext/hash_test.rb +0 -36
  43. data/test/gettext/api_test.rb +0 -214
  44. data/test/gettext/backend_test.rb +0 -92
  45. data/test/i18n/exceptions_test.rb +0 -117
  46. data/test/i18n/gettext_plural_keys_test.rb +0 -20
  47. data/test/i18n/interpolate_test.rb +0 -91
  48. data/test/i18n/load_path_test.rb +0 -34
  49. data/test/i18n/middleware_test.rb +0 -24
  50. data/test/i18n_test.rb +0 -462
  51. data/test/locale/fallbacks_test.rb +0 -133
  52. data/test/locale/tag/rfc4646_test.rb +0 -143
  53. data/test/locale/tag/simple_test.rb +0 -32
  54. data/test/run_all.rb +0 -20
  55. data/test/test_data/locales/de.po +0 -82
  56. data/test/test_data/locales/en.rb +0 -3
  57. data/test/test_data/locales/en.yaml +0 -3
  58. data/test/test_data/locales/en.yml +0 -3
  59. data/test/test_data/locales/invalid/empty.yml +0 -0
  60. data/test/test_data/locales/invalid/syntax.yml +0 -4
  61. data/test/test_data/locales/plurals.rb +0 -113
  62. data/test/test_helper.rb +0 -61
@@ -1,61 +0,0 @@
1
- $KCODE = 'u' if RUBY_VERSION <= '1.9'
2
-
3
- require 'minitest/autorun'
4
- TEST_CASE = defined?(Minitest::Test) ? Minitest::Test : MiniTest::Unit::TestCase
5
-
6
- # TODO: Remove these aliases and update tests accordingly.
7
- class TEST_CASE
8
- alias :assert_raise :assert_raises
9
- alias :assert_not_equal :refute_equal
10
-
11
- def assert_nothing_raised(*args)
12
- yield
13
- end
14
- end
15
-
16
- require 'bundler/setup'
17
- require 'i18n'
18
- require 'mocha/setup'
19
- require 'test_declarative'
20
-
21
- class I18n::TestCase < TEST_CASE
22
- def self.key_value?
23
- defined?(ActiveSupport)
24
- end
25
-
26
- def setup
27
- super
28
- I18n.enforce_available_locales = false
29
- end
30
-
31
- def teardown
32
- I18n.locale = nil
33
- I18n.default_locale = nil
34
- I18n.load_path = nil
35
- I18n.available_locales = nil
36
- I18n.backend = nil
37
- I18n.default_separator = nil
38
- I18n.enforce_available_locales = true
39
- super
40
- end
41
-
42
- protected
43
-
44
- def translations
45
- I18n.backend.instance_variable_get(:@translations)
46
- end
47
-
48
- def store_translations(locale, data)
49
- I18n.backend.store_translations(locale, data)
50
- end
51
-
52
- def locales_dir
53
- File.dirname(__FILE__) + '/test_data/locales'
54
- end
55
- end
56
-
57
- class DummyRackApp
58
- def call(env)
59
- I18n.locale = :es
60
- end
61
- end