i18n 0.9.5 → 1.8.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +70 -32
- data/lib/i18n.rb +95 -36
- data/lib/i18n/backend.rb +3 -0
- data/lib/i18n/backend/base.rb +53 -23
- data/lib/i18n/backend/cache.rb +10 -11
- data/lib/i18n/backend/cache_file.rb +36 -0
- data/lib/i18n/backend/cascade.rb +3 -1
- data/lib/i18n/backend/chain.rb +38 -5
- data/lib/i18n/backend/fallbacks.rb +25 -14
- data/lib/i18n/backend/flatten.rb +10 -5
- data/lib/i18n/backend/gettext.rb +4 -0
- data/lib/i18n/backend/interpolation_compiler.rb +3 -1
- data/lib/i18n/backend/key_value.rb +31 -2
- data/lib/i18n/backend/memoize.rb +10 -2
- data/lib/i18n/backend/metadata.rb +5 -3
- data/lib/i18n/backend/pluralization.rb +3 -1
- data/lib/i18n/backend/simple.rb +26 -10
- data/lib/i18n/backend/transliterator.rb +2 -0
- data/lib/i18n/config.rb +20 -2
- data/lib/i18n/core_ext/hash.rb +54 -24
- data/lib/i18n/exceptions.rb +23 -16
- data/lib/i18n/gettext.rb +2 -0
- data/lib/i18n/gettext/helpers.rb +4 -2
- data/lib/i18n/gettext/po_parser.rb +7 -7
- data/lib/i18n/interpolate/ruby.rb +6 -4
- data/lib/i18n/locale.rb +2 -0
- data/lib/i18n/locale/fallbacks.rb +9 -6
- data/lib/i18n/locale/tag/parents.rb +8 -6
- data/lib/i18n/locale/tag/simple.rb +1 -1
- data/lib/i18n/middleware.rb +2 -0
- data/lib/i18n/tests.rb +2 -0
- data/lib/i18n/tests/interpolation.rb +9 -4
- data/lib/i18n/tests/link.rb +11 -1
- data/lib/i18n/tests/localization/date.rb +29 -7
- data/lib/i18n/tests/localization/date_time.rb +27 -6
- data/lib/i18n/tests/localization/procs.rb +6 -5
- data/lib/i18n/tests/localization/time.rb +26 -4
- data/lib/i18n/tests/lookup.rb +2 -2
- data/lib/i18n/tests/procs.rb +5 -0
- data/lib/i18n/version.rb +3 -1
- metadata +14 -60
- 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/lib/i18n/core_ext/kernel/suppress_warnings.rb +0 -8
- data/lib/i18n/core_ext/string/interpolate.rb +0 -9
- 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 -219
- data/test/backend/interpolation_compiler_test.rb +0 -118
- data/test/backend/key_value_test.rb +0 -61
- 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 -103
- 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.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
|