i18n 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/i18n/backend.rb +1 -0
- data/lib/i18n/backend/base.rb +12 -1
- data/lib/i18n/backend/cache_file.rb +36 -0
- data/lib/i18n/backend/chain.rb +22 -0
- data/lib/i18n/backend/key_value.rb +24 -0
- data/lib/i18n/backend/simple.rb +1 -1
- data/lib/i18n/config.rb +16 -0
- data/lib/i18n/core_ext/hash.rb +8 -0
- data/lib/i18n/interpolate/ruby.rb +5 -3
- data/lib/i18n/version.rb +1 -1
- metadata +16 -52
- data/gemfiles/Gemfile.rails-3.2.x +0 -10
- data/gemfiles/Gemfile.rails-4.0.x +0 -10
- data/gemfiles/Gemfile.rails-4.1.x +0 -10
- data/gemfiles/Gemfile.rails-4.2.x +0 -10
- data/gemfiles/Gemfile.rails-5.0.x +0 -10
- data/gemfiles/Gemfile.rails-5.1.x +0 -10
- data/gemfiles/Gemfile.rails-master +0 -10
- data/test/api/all_features_test.rb +0 -58
- data/test/api/cascade_test.rb +0 -28
- data/test/api/chain_test.rb +0 -24
- data/test/api/fallbacks_test.rb +0 -30
- data/test/api/key_value_test.rb +0 -24
- data/test/api/memoize_test.rb +0 -56
- data/test/api/override_test.rb +0 -42
- data/test/api/pluralization_test.rb +0 -30
- data/test/api/simple_test.rb +0 -28
- data/test/backend/cache_test.rb +0 -109
- data/test/backend/cascade_test.rb +0 -86
- data/test/backend/chain_test.rb +0 -122
- data/test/backend/exceptions_test.rb +0 -36
- data/test/backend/fallbacks_test.rb +0 -211
- data/test/backend/interpolation_compiler_test.rb +0 -118
- data/test/backend/key_value_test.rb +0 -85
- data/test/backend/memoize_test.rb +0 -79
- data/test/backend/metadata_test.rb +0 -48
- data/test/backend/pluralization_test.rb +0 -45
- data/test/backend/simple_test.rb +0 -111
- data/test/backend/transliterator_test.rb +0 -84
- data/test/core_ext/hash_test.rb +0 -36
- data/test/gettext/api_test.rb +0 -214
- data/test/gettext/backend_test.rb +0 -92
- data/test/i18n/exceptions_test.rb +0 -117
- data/test/i18n/gettext_plural_keys_test.rb +0 -20
- data/test/i18n/interpolate_test.rb +0 -91
- data/test/i18n/load_path_test.rb +0 -34
- data/test/i18n/middleware_test.rb +0 -24
- data/test/i18n_test.rb +0 -462
- data/test/locale/fallbacks_test.rb +0 -133
- data/test/locale/tag/rfc4646_test.rb +0 -143
- data/test/locale/tag/simple_test.rb +0 -32
- data/test/run_all.rb +0 -20
- data/test/test_data/locales/de.po +0 -82
- data/test/test_data/locales/en.rb +0 -3
- data/test/test_data/locales/en.yaml +0 -3
- data/test/test_data/locales/en.yml +0 -3
- data/test/test_data/locales/invalid/empty.yml +0 -0
- data/test/test_data/locales/invalid/syntax.yml +0 -4
- data/test/test_data/locales/plurals.rb +0 -113
- data/test/test_helper.rb +0 -61
data/test/test_helper.rb
DELETED
@@ -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
|