i18n 0.5.0 → 0.5.2
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.
- data/CHANGELOG.textile +3 -12
- data/README.textile +17 -4
- data/lib/i18n.rb +37 -5
- data/lib/i18n/backend.rb +1 -0
- data/lib/i18n/backend/base.rb +32 -4
- data/lib/i18n/backend/cldr.rb +99 -0
- data/lib/i18n/backend/gettext.rb +3 -3
- data/lib/i18n/backend/interpolation_compiler.rb +1 -1
- data/lib/i18n/backend/metadata.rb +1 -1
- data/lib/i18n/config.rb +13 -1
- data/lib/i18n/core_ext/string/interpolate.rb +0 -9
- data/lib/i18n/exceptions.rb +31 -3
- data/lib/i18n/locale/fallbacks.rb +3 -3
- data/lib/i18n/tests/localization/procs.rb +24 -25
- data/lib/i18n/version.rb +1 -1
- metadata +16 -121
- data/ci/Gemfile.no-rails +0 -5
- data/ci/Gemfile.no-rails.lock +0 -14
- data/ci/Gemfile.rails-2.3.x +0 -9
- data/ci/Gemfile.rails-2.3.x.lock +0 -23
- data/ci/Gemfile.rails-3.x +0 -9
- data/ci/Gemfile.rails-3.x.lock +0 -23
- data/lib/i18n/core_ext/kernel/surpress_warnings.rb +0 -9
- data/lib/i18n/interpolate/ruby.rb +0 -31
- data/test/all.rb +0 -8
- 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 -28
- data/test/api/memoize_test.rb +0 -60
- data/test/api/pluralization_test.rb +0 -30
- data/test/api/simple_test.rb +0 -28
- data/test/backend/cache_test.rb +0 -83
- data/test/backend/cascade_test.rb +0 -85
- data/test/backend/chain_test.rb +0 -67
- data/test/backend/exceptions_test.rb +0 -23
- data/test/backend/fallbacks_test.rb +0 -116
- data/test/backend/interpolation_compiler_test.rb +0 -102
- data/test/backend/key_value_test.rb +0 -46
- data/test/backend/memoize_test.rb +0 -47
- data/test/backend/metadata_test.rb +0 -67
- data/test/backend/pluralization_test.rb +0 -44
- data/test/backend/simple_test.rb +0 -79
- data/test/backend/transliterator_test.rb +0 -81
- data/test/core_ext/hash_test.rb +0 -30
- data/test/core_ext/string/interpolate_test.rb +0 -99
- data/test/gettext/api_test.rb +0 -206
- data/test/gettext/backend_test.rb +0 -93
- data/test/i18n/exceptions_test.rb +0 -116
- data/test/i18n/interpolate_test.rb +0 -61
- data/test/i18n/load_path_test.rb +0 -26
- data/test/i18n_test.rb +0 -236
- data/test/locale/fallbacks_test.rb +0 -124
- data/test/locale/tag/rfc4646_test.rb +0 -142
- data/test/locale/tag/simple_test.rb +0 -32
- data/test/run_all.rb +0 -21
- data/test/test_data/locales/de.po +0 -72
- 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 -1
- data/test/test_data/locales/plurals.rb +0 -113
- data/test/test_helper.rb +0 -56
data/test/test_helper.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
$KCODE = 'u' if RUBY_VERSION <= '1.9'
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'test/unit'
|
5
|
-
|
6
|
-
# Do not load the i18n gem from libraries like active_support.
|
7
|
-
#
|
8
|
-
# This is required for testing against Rails 2.3 because active_support/vendor.rb#24 tries
|
9
|
-
# to load I18n using the gem method. Instead, we want to test the local library of course.
|
10
|
-
alias :gem_for_ruby_19 :gem # for 1.9. gives a super ugly seg fault otherwise
|
11
|
-
def gem(gem_name, *version_requirements)
|
12
|
-
gem_name =='i18n' ? puts("skipping loading the i18n gem ...") : super
|
13
|
-
end
|
14
|
-
|
15
|
-
require 'bundler/setup'
|
16
|
-
require 'i18n'
|
17
|
-
require 'mocha'
|
18
|
-
require 'test_declarative'
|
19
|
-
|
20
|
-
class Test::Unit::TestCase
|
21
|
-
def teardown
|
22
|
-
I18n.locale = nil
|
23
|
-
I18n.default_locale = :en
|
24
|
-
I18n.load_path = []
|
25
|
-
I18n.available_locales = nil
|
26
|
-
I18n.backend = nil
|
27
|
-
end
|
28
|
-
|
29
|
-
def translations
|
30
|
-
I18n.backend.instance_variable_get(:@translations)
|
31
|
-
end
|
32
|
-
|
33
|
-
def store_translations(*args)
|
34
|
-
data = args.pop
|
35
|
-
locale = args.pop || :en
|
36
|
-
I18n.backend.store_translations(locale, data)
|
37
|
-
end
|
38
|
-
|
39
|
-
def locales_dir
|
40
|
-
File.dirname(__FILE__) + '/test_data/locales'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
module Kernel
|
45
|
-
def setup_rufus_tokyo
|
46
|
-
require 'rufus/tokyo'
|
47
|
-
rescue LoadError => e
|
48
|
-
puts "can't use KeyValue backend because: #{e.message}"
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
Object.class_eval do
|
53
|
-
def meta_class
|
54
|
-
class << self; self; end
|
55
|
-
end
|
56
|
-
end unless Object.method_defined?(:meta_class)
|