i18n 1.0.1 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +54 -13
  3. data/lib/i18n.rb +53 -27
  4. data/lib/i18n/backend.rb +1 -0
  5. data/lib/i18n/backend/base.rb +36 -9
  6. data/lib/i18n/backend/cache.rb +2 -5
  7. data/lib/i18n/backend/cache_file.rb +36 -0
  8. data/lib/i18n/backend/chain.rb +28 -0
  9. data/lib/i18n/backend/gettext.rb +2 -0
  10. data/lib/i18n/backend/key_value.rb +27 -0
  11. data/lib/i18n/backend/memoize.rb +6 -0
  12. data/lib/i18n/backend/simple.rb +22 -6
  13. data/lib/i18n/config.rb +17 -1
  14. data/lib/i18n/core_ext/hash.rb +42 -24
  15. data/lib/i18n/exceptions.rb +20 -15
  16. data/lib/i18n/interpolate/ruby.rb +5 -3
  17. data/lib/i18n/locale/fallbacks.rb +1 -1
  18. data/lib/i18n/tests/interpolation.rb +1 -1
  19. data/lib/i18n/tests/localization/date.rb +28 -6
  20. data/lib/i18n/tests/localization/date_time.rb +27 -6
  21. data/lib/i18n/tests/localization/time.rb +26 -4
  22. data/lib/i18n/version.rb +1 -1
  23. metadata +24 -58
  24. data/gemfiles/Gemfile.rails-3.2.x +0 -10
  25. data/gemfiles/Gemfile.rails-4.0.x +0 -10
  26. data/gemfiles/Gemfile.rails-4.1.x +0 -10
  27. data/gemfiles/Gemfile.rails-4.2.x +0 -10
  28. data/gemfiles/Gemfile.rails-5.0.x +0 -10
  29. data/gemfiles/Gemfile.rails-5.1.x +0 -10
  30. data/gemfiles/Gemfile.rails-master +0 -10
  31. data/lib/i18n/core_ext/kernel/suppress_warnings.rb +0 -8
  32. data/lib/i18n/core_ext/string/interpolate.rb +0 -9
  33. data/test/api/all_features_test.rb +0 -58
  34. data/test/api/cascade_test.rb +0 -28
  35. data/test/api/chain_test.rb +0 -24
  36. data/test/api/fallbacks_test.rb +0 -30
  37. data/test/api/key_value_test.rb +0 -24
  38. data/test/api/memoize_test.rb +0 -56
  39. data/test/api/override_test.rb +0 -42
  40. data/test/api/pluralization_test.rb +0 -30
  41. data/test/api/simple_test.rb +0 -28
  42. data/test/backend/cache_test.rb +0 -109
  43. data/test/backend/cascade_test.rb +0 -86
  44. data/test/backend/chain_test.rb +0 -122
  45. data/test/backend/exceptions_test.rb +0 -36
  46. data/test/backend/fallbacks_test.rb +0 -219
  47. data/test/backend/interpolation_compiler_test.rb +0 -118
  48. data/test/backend/key_value_test.rb +0 -61
  49. data/test/backend/memoize_test.rb +0 -79
  50. data/test/backend/metadata_test.rb +0 -48
  51. data/test/backend/pluralization_test.rb +0 -45
  52. data/test/backend/simple_test.rb +0 -103
  53. data/test/backend/transliterator_test.rb +0 -84
  54. data/test/core_ext/hash_test.rb +0 -36
  55. data/test/gettext/api_test.rb +0 -214
  56. data/test/gettext/backend_test.rb +0 -92
  57. data/test/i18n/exceptions_test.rb +0 -117
  58. data/test/i18n/gettext_plural_keys_test.rb +0 -20
  59. data/test/i18n/interpolate_test.rb +0 -91
  60. data/test/i18n/load_path_test.rb +0 -34
  61. data/test/i18n/middleware_test.rb +0 -24
  62. data/test/i18n_test.rb +0 -462
  63. data/test/locale/fallbacks_test.rb +0 -133
  64. data/test/locale/tag/rfc4646_test.rb +0 -143
  65. data/test/locale/tag/simple_test.rb +0 -32
  66. data/test/run_all.rb +0 -20
  67. data/test/test_data/locales/de.po +0 -82
  68. data/test/test_data/locales/en.rb +0 -3
  69. data/test/test_data/locales/en.yml +0 -3
  70. data/test/test_data/locales/invalid/empty.yml +0 -0
  71. data/test/test_data/locales/invalid/syntax.yml +0 -4
  72. data/test/test_data/locales/plurals.rb +0 -113
  73. 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