i18n 0.3.6 → 0.3.7
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/lib/i18n.rb +29 -4
- data/lib/i18n/backend/active_record/translation.rb +6 -4
- data/lib/i18n/backend/base.rb +1 -1
- data/lib/i18n/locale/fallbacks.rb +4 -4
- data/lib/i18n/version.rb +1 -1
- metadata +16 -116
- data/CHANGELOG.textile +0 -76
- data/MIT-LICENSE +0 -20
- data/README.textile +0 -104
- data/Rakefile +0 -29
- data/test/all.rb +0 -8
- data/test/api.rb +0 -18
- data/test/api/active_record_test.rb +0 -30
- data/test/api/all_features_test.rb +0 -59
- data/test/api/cascade_test.rb +0 -32
- data/test/api/chain_test.rb +0 -27
- data/test/api/fallbacks_test.rb +0 -34
- data/test/api/fast_test.rb +0 -32
- data/test/api/pluralization_test.rb +0 -34
- data/test/api/simple_test.rb +0 -23
- data/test/api/tests/basics.rb +0 -15
- data/test/api/tests/defaults.rb +0 -40
- data/test/api/tests/interpolation.rb +0 -92
- data/test/api/tests/link.rb +0 -56
- data/test/api/tests/localization/date.rb +0 -96
- data/test/api/tests/localization/date_time.rb +0 -93
- data/test/api/tests/localization/procs.rb +0 -60
- data/test/api/tests/localization/time.rb +0 -88
- data/test/api/tests/lookup.rb +0 -62
- data/test/api/tests/pluralization.rb +0 -35
- data/test/api/tests/procs.rb +0 -55
- data/test/backend/active_record/missing_test.rb +0 -51
- data/test/backend/active_record_test.rb +0 -57
- data/test/backend/cache_test.rb +0 -71
- data/test/backend/cascade_test.rb +0 -73
- data/test/backend/chain_test.rb +0 -63
- data/test/backend/cldr_test.rb +0 -151
- data/test/backend/exceptions_test.rb +0 -25
- data/test/backend/fallbacks_test.rb +0 -107
- data/test/backend/fast_test.rb +0 -50
- data/test/backend/helpers_test.rb +0 -27
- data/test/backend/interpolation_compiler_test.rb +0 -108
- data/test/backend/metadata_test.rb +0 -66
- data/test/backend/pluralization_test.rb +0 -47
- data/test/backend/simple_test.rb +0 -77
- data/test/core_ext/string/interpolate_test.rb +0 -99
- data/test/gettext/api_test.rb +0 -207
- data/test/gettext/backend_test.rb +0 -91
- data/test/i18n_exceptions_test.rb +0 -97
- data/test/i18n_load_path_test.rb +0 -23
- data/test/i18n_test.rb +0 -207
- data/test/locale/fallbacks_test.rb +0 -126
- data/test/locale/tag/rfc4646_test.rb +0 -143
- data/test/locale/tag/simple_test.rb +0 -33
- data/test/test_data/locales/cldr/de/calendars.yml +0 -152
- data/test/test_data/locales/cldr/de/currencies.yml +0 -8
- data/test/test_data/locales/cldr/de/numbers.yml +0 -31
- 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/plurals.rb +0 -113
- data/test/test_helper.rb +0 -116
@@ -1,33 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../../')); $:.uniq!
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
class I18nLocaleTagSimpleTest < Test::Unit::TestCase
|
6
|
-
include I18n::Locale
|
7
|
-
|
8
|
-
test "returns 'de' as the language subtag in lowercase" do
|
9
|
-
assert_equal %w(de Latn DE), Tag::Simple.new('de-Latn-DE').subtags
|
10
|
-
end
|
11
|
-
|
12
|
-
test "returns a formatted tag string from #to_s" do
|
13
|
-
assert_equal 'de-Latn-DE', Tag::Simple.new('de-Latn-DE').to_s
|
14
|
-
end
|
15
|
-
|
16
|
-
test "returns an array containing the formatted subtags from #to_a" do
|
17
|
-
assert_equal %w(de Latn DE), Tag::Simple.new('de-Latn-DE').to_a
|
18
|
-
end
|
19
|
-
|
20
|
-
# Tag inheritance
|
21
|
-
|
22
|
-
test "#parent returns 'de-Latn' as the parent of 'de-Latn-DE'" do
|
23
|
-
assert_equal 'de-Latn', Tag::Simple.new('de-Latn-DE').parent.to_s
|
24
|
-
end
|
25
|
-
|
26
|
-
test "#parent returns 'de' as the parent of 'de-Latn'" do
|
27
|
-
assert_equal 'de', Tag::Simple.new('de-Latn').parent.to_s
|
28
|
-
end
|
29
|
-
|
30
|
-
test "#self_and_parents returns an array of 3 tags for 'de-Latn-DE'" do
|
31
|
-
assert_equal %w(de-Latn-DE de-Latn de), Tag::Simple.new('de-Latn-DE').self_and_parents.map { |tag| tag.to_s}
|
32
|
-
end
|
33
|
-
end
|
@@ -1,152 +0,0 @@
|
|
1
|
-
de:
|
2
|
-
calendars:
|
3
|
-
gregorian:
|
4
|
-
days:
|
5
|
-
format:
|
6
|
-
abbreviated:
|
7
|
-
fri: Fr.
|
8
|
-
mon: Mo.
|
9
|
-
sat: Sa.
|
10
|
-
sun: So.
|
11
|
-
thu: Do.
|
12
|
-
tue: Di.
|
13
|
-
wed: Mi.
|
14
|
-
narrow: :"calendars.gregorian.days.stand-alone.narrow"
|
15
|
-
wide:
|
16
|
-
fri: Freitag
|
17
|
-
mon: Montag
|
18
|
-
sat: Samstag
|
19
|
-
sun: Sonntag
|
20
|
-
thu: Donnerstag
|
21
|
-
tue: Dienstag
|
22
|
-
wed: Mittwoch
|
23
|
-
stand-alone:
|
24
|
-
abbreviated: :"calendars.gregorian.days.format.abbreviated"
|
25
|
-
narrow:
|
26
|
-
fri: F
|
27
|
-
mon: M
|
28
|
-
sat: S
|
29
|
-
sun: S
|
30
|
-
thu: D
|
31
|
-
tue: D
|
32
|
-
wed: M
|
33
|
-
wide: :"calendars.gregorian.days.format.wide"
|
34
|
-
fields:
|
35
|
-
day: Tag
|
36
|
-
dayperiod: Tageshälfte
|
37
|
-
era: Epoche
|
38
|
-
hour: Stunde
|
39
|
-
minute: Minute
|
40
|
-
month: Monat
|
41
|
-
second: Sekunde
|
42
|
-
week: Woche
|
43
|
-
weekday: Wochentag
|
44
|
-
year: Jahr
|
45
|
-
zone: Zone
|
46
|
-
formats:
|
47
|
-
date:
|
48
|
-
default: :"calendars.gregorian.formats.date.medium"
|
49
|
-
full:
|
50
|
-
pattern: "EEEE, d. MMMM y"
|
51
|
-
long:
|
52
|
-
pattern: "d. MMMM y"
|
53
|
-
medium:
|
54
|
-
pattern: dd.MM.yyyy
|
55
|
-
short:
|
56
|
-
pattern: dd.MM.yy
|
57
|
-
datetime:
|
58
|
-
default: :"calendars.gregorian.formats.datetime.medium"
|
59
|
-
full:
|
60
|
-
pattern: "{{date}} {{time}}"
|
61
|
-
long:
|
62
|
-
pattern: "{{date}} {{time}}"
|
63
|
-
medium:
|
64
|
-
pattern: "{{date}} {{time}}"
|
65
|
-
short:
|
66
|
-
pattern: "{{date}} {{time}}"
|
67
|
-
time:
|
68
|
-
default: :"calendars.gregorian.formats.time.medium"
|
69
|
-
full:
|
70
|
-
pattern: "HH:mm:ss zzzz"
|
71
|
-
long:
|
72
|
-
pattern: "HH:mm:ss z"
|
73
|
-
medium:
|
74
|
-
pattern: "HH:mm:ss"
|
75
|
-
short:
|
76
|
-
pattern: "HH:mm"
|
77
|
-
months:
|
78
|
-
format:
|
79
|
-
abbreviated:
|
80
|
-
1: Jan
|
81
|
-
10: Okt
|
82
|
-
11: Nov
|
83
|
-
12: Dez
|
84
|
-
2: Feb
|
85
|
-
3: Mär
|
86
|
-
4: Apr
|
87
|
-
5: Mai
|
88
|
-
6: Jun
|
89
|
-
7: Jul
|
90
|
-
8: Aug
|
91
|
-
9: Sep
|
92
|
-
narrow: :"calendars.gregorian.months.stand-alone.narrow"
|
93
|
-
wide:
|
94
|
-
1: Januar
|
95
|
-
10: Oktober
|
96
|
-
11: November
|
97
|
-
12: Dezember
|
98
|
-
2: Februar
|
99
|
-
3: März
|
100
|
-
4: April
|
101
|
-
5: Mai
|
102
|
-
6: Juni
|
103
|
-
7: Juli
|
104
|
-
8: August
|
105
|
-
9: September
|
106
|
-
stand-alone:
|
107
|
-
abbreviated:
|
108
|
-
10: Okt
|
109
|
-
11: Nov
|
110
|
-
12: Dez
|
111
|
-
3: Mär
|
112
|
-
7: Jul
|
113
|
-
8: Aug
|
114
|
-
9: Sep
|
115
|
-
narrow:
|
116
|
-
1: J
|
117
|
-
10: O
|
118
|
-
11: N
|
119
|
-
12: D
|
120
|
-
2: F
|
121
|
-
3: M
|
122
|
-
4: A
|
123
|
-
5: M
|
124
|
-
6: J
|
125
|
-
7: J
|
126
|
-
8: A
|
127
|
-
9: S
|
128
|
-
wide: :"calendars.gregorian.months.format.wide"
|
129
|
-
periods:
|
130
|
-
am: vorm.
|
131
|
-
pm: nachm.
|
132
|
-
quarters:
|
133
|
-
format:
|
134
|
-
abbreviated:
|
135
|
-
1: Q1
|
136
|
-
2: Q2
|
137
|
-
3: Q3
|
138
|
-
4: Q4
|
139
|
-
narrow: :"calendars.gregorian.quarters.stand-alone.narrow"
|
140
|
-
wide:
|
141
|
-
1: "1. Quartal"
|
142
|
-
2: "2. Quartal"
|
143
|
-
3: "3. Quartal"
|
144
|
-
4: "4. Quartal"
|
145
|
-
stand-alone:
|
146
|
-
abbreviated: :"calendars.gregorian.quarters.format.abbreviated"
|
147
|
-
narrow:
|
148
|
-
1: 1
|
149
|
-
2: 2
|
150
|
-
3: 3
|
151
|
-
4: 4
|
152
|
-
wide: :"calendars.gregorian.quarters.format.wide"
|
@@ -1,31 +0,0 @@
|
|
1
|
-
de:
|
2
|
-
numbers:
|
3
|
-
formats:
|
4
|
-
currency:
|
5
|
-
patterns:
|
6
|
-
default: "#,##0.00 ¤"
|
7
|
-
unit:
|
8
|
-
one: "{0} {1}"
|
9
|
-
other: "{0} {1}"
|
10
|
-
decimal:
|
11
|
-
patterns:
|
12
|
-
default: "#,##0.###"
|
13
|
-
percent:
|
14
|
-
patterns:
|
15
|
-
default: "#,##0 %"
|
16
|
-
scientific:
|
17
|
-
patterns:
|
18
|
-
default: "#E0"
|
19
|
-
symbols:
|
20
|
-
decimal: ","
|
21
|
-
exponential: E
|
22
|
-
group: "."
|
23
|
-
infinity: ∞
|
24
|
-
list: ;
|
25
|
-
minus_sign: "-"
|
26
|
-
nan: NaN
|
27
|
-
native_zero_digit: 0
|
28
|
-
pattern_digit: "#"
|
29
|
-
per_mille: ‰
|
30
|
-
percent_sign: "%"
|
31
|
-
plus_sign: +
|
@@ -1,72 +0,0 @@
|
|
1
|
-
# SOME DESCRIPTIVE TITLE.
|
2
|
-
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3
|
-
# This file is distributed under the same license as the PACKAGE package.
|
4
|
-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5
|
-
#
|
6
|
-
#, fuzzy
|
7
|
-
msgid ""
|
8
|
-
msgstr ""
|
9
|
-
"Project-Id-Version: version 0.0.1\n"
|
10
|
-
"POT-Creation-Date: 2009-02-26 19:50+0100\n"
|
11
|
-
"PO-Revision-Date: 2009-02-18 14:53+0100\n"
|
12
|
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13
|
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14
|
-
"MIME-Version: 1.0\n"
|
15
|
-
"Content-Type: text/plain; charset=UTF-8\n"
|
16
|
-
"Content-Transfer-Encoding: 8bit\n"
|
17
|
-
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
18
|
-
|
19
|
-
# #: app/helpers/translation_helper.rb:3
|
20
|
-
# msgid "%{relative_time} ago"
|
21
|
-
# msgstr "vor %{relative_time}"
|
22
|
-
|
23
|
-
#: app/views/cars/show.html.erb:5
|
24
|
-
msgid "Axis"
|
25
|
-
msgid_plural "Axis"
|
26
|
-
msgstr[0] "Achse"
|
27
|
-
msgstr[1] "Achsen"
|
28
|
-
|
29
|
-
#: app/controllers/cars_controller.rb:47
|
30
|
-
msgid "Car was successfully created."
|
31
|
-
msgstr "Auto wurde erfolgreich gespeichert"
|
32
|
-
|
33
|
-
#: app/controllers/cars_controller.rb:64
|
34
|
-
msgid "Car was successfully updated."
|
35
|
-
msgstr "Auto wurde erfolgreich aktualisiert"
|
36
|
-
|
37
|
-
#: app/views/cars/show.html.erb:1 locale/model_attributes.rb:3
|
38
|
-
msgid "Car|Model"
|
39
|
-
msgstr "Modell"
|
40
|
-
|
41
|
-
#: app/views/cars/show.html.erb:3 locale/model_attributes.rb:4
|
42
|
-
msgid "Car|Wheels count"
|
43
|
-
msgstr "Räderzahl"
|
44
|
-
|
45
|
-
#: app/views/cars/show.html.erb:7
|
46
|
-
msgid "Created"
|
47
|
-
msgstr "Erstellt"
|
48
|
-
|
49
|
-
#: app/views/cars/show.html.erb:9
|
50
|
-
msgid "Month"
|
51
|
-
msgstr "Monat"
|
52
|
-
|
53
|
-
#: locale/model_attributes.rb:2
|
54
|
-
msgid "car"
|
55
|
-
msgstr "Auto"
|
56
|
-
|
57
|
-
#: locale/testlog_phrases.rb:2
|
58
|
-
msgid "this is a dynamic translation which was found thorugh gettext_test_log!"
|
59
|
-
msgstr ""
|
60
|
-
"Dies ist eine dynamische Übersetzung, die durch gettext_test_log "
|
61
|
-
"gefunden wurde!"
|
62
|
-
|
63
|
-
#: app/views/cars/nowhere_really
|
64
|
-
msgid "Car|wheel"
|
65
|
-
msgid_plural "Car|wheels"
|
66
|
-
msgstr[0] "Rad"
|
67
|
-
msgstr[1] "Räder"
|
68
|
-
|
69
|
-
msgid "On %{count} wheel."
|
70
|
-
msgid_plural "On %{count} wheels."
|
71
|
-
msgstr[0] "Auf %{count} Achse."
|
72
|
-
msgstr[1] "Auf %{count} Achsen."
|
@@ -1,113 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
{
|
4
|
-
:af => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
5
|
-
:am => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
6
|
-
:ar => { :i18n => { :plural => { :keys => [:zero, :one, :two, :few, :many, :other], :rule => lambda { |n| n == 0 ? :zero : n == 1 ? :one : n == 2 ? :two : [3, 4, 5, 6, 7, 8, 9, 10].include?(n % 100) ? :few : [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99].include?(n % 100) ? :many : :other } } } },
|
7
|
-
:az => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
8
|
-
:be => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
|
9
|
-
:bg => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
10
|
-
:bh => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
11
|
-
:bn => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
12
|
-
:bo => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
13
|
-
:bs => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
|
14
|
-
:ca => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
15
|
-
:cs => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n) ? :few : :other } } } },
|
16
|
-
:cy => { :i18n => { :plural => { :keys => [:one, :two, :many, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : n == 8 || n == 11 ? :many : :other } } } },
|
17
|
-
:da => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
18
|
-
:de => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
19
|
-
:dz => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
20
|
-
:el => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
21
|
-
:en => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
22
|
-
:eo => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
23
|
-
:es => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
24
|
-
:et => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
25
|
-
:eu => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
26
|
-
:fa => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
27
|
-
:fi => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
28
|
-
:fil => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
29
|
-
:fo => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
30
|
-
:fr => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n && n != 2 ? :one : :other } } } },
|
31
|
-
:fur => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
32
|
-
:fy => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
33
|
-
:ga => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
|
34
|
-
:gl => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
35
|
-
:gu => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
36
|
-
:guw => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
37
|
-
:ha => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
38
|
-
:he => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
39
|
-
:hi => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
40
|
-
:hr => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
|
41
|
-
:hu => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
42
|
-
:id => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
43
|
-
:is => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
44
|
-
:it => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
45
|
-
:iw => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
46
|
-
:ja => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
47
|
-
:jv => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
48
|
-
:ka => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
49
|
-
:km => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
50
|
-
:kn => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
51
|
-
:ko => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
52
|
-
:ku => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
53
|
-
:lb => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
54
|
-
:ln => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
55
|
-
:lt => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n % 10 == 1 && ![11, 12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) ? :one : [2, 3, 4, 5, 6, 7, 8, 9].include?(n % 10) && ![11, 12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) ? :few : :other } } } },
|
56
|
-
:lv => { :i18n => { :plural => { :keys => [:zero, :one, :other], :rule => lambda { |n| n == 0 ? :zero : n % 10 == 1 && n % 100 != 11 ? :one : :other } } } },
|
57
|
-
:mg => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
58
|
-
:mk => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n % 10 == 1 ? :one : :other } } } },
|
59
|
-
:ml => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
60
|
-
:mn => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
61
|
-
:mo => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : n == 0 ? :few : :other } } } },
|
62
|
-
:mr => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
63
|
-
:ms => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
64
|
-
:mt => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n == 1 ? :one : n == 0 || [2, 3, 4, 5, 6, 7, 8, 9, 10].include?(n % 100) ? :few : [11, 12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) ? :many : :other } } } },
|
65
|
-
:my => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
66
|
-
:nah => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
67
|
-
:nb => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
68
|
-
:ne => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
69
|
-
:nl => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
70
|
-
:nn => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
71
|
-
:no => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
72
|
-
:nso => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
73
|
-
:om => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
74
|
-
:or => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
75
|
-
:pa => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
76
|
-
:pap => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
77
|
-
:pl => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) && ![22, 23, 24].include?(n % 100) ? :few : :other } } } },
|
78
|
-
:ps => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
79
|
-
:pt => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
80
|
-
:"pt-PT" => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
81
|
-
:ro => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : n == 0 ? :few : :other } } } },
|
82
|
-
:ru => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
|
83
|
-
:se => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
|
84
|
-
:sh => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
|
85
|
-
:sk => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n) ? :few : :other } } } },
|
86
|
-
:sl => { :i18n => { :plural => { :keys => [:one, :two, :few, :other], :rule => lambda { |n| n % 100 == 1 ? :one : n % 100 == 2 ? :two : [3, 4].include?(n % 100) ? :few : :other } } } },
|
87
|
-
:sma => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
|
88
|
-
:smi => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
|
89
|
-
:smj => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
|
90
|
-
:smn => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
|
91
|
-
:sms => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
|
92
|
-
:so => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
93
|
-
:sq => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
94
|
-
:sr => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
|
95
|
-
:sv => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
96
|
-
:sw => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
97
|
-
:ta => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
98
|
-
:te => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
99
|
-
:th => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
100
|
-
:ti => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
101
|
-
:tk => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
102
|
-
:tl => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
103
|
-
:to => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
104
|
-
:tr => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
105
|
-
:uk => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
|
106
|
-
:ur => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
107
|
-
:vi => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
108
|
-
:wa => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
109
|
-
:yo => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
110
|
-
:zh => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
111
|
-
:zu => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } }
|
112
|
-
}
|
113
|
-
|
data/test/test_helper.rb
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
$KCODE = 'u' unless RUBY_VERSION >= '1.9'
|
4
|
-
|
5
|
-
$:.unshift File.expand_path("../lib", File.dirname(__FILE__))
|
6
|
-
$:.unshift(File.expand_path(File.dirname(__FILE__)))
|
7
|
-
$:.uniq!
|
8
|
-
|
9
|
-
require 'i18n'
|
10
|
-
require 'i18n/core_ext/object/meta_class'
|
11
|
-
|
12
|
-
require 'rubygems'
|
13
|
-
require 'test/unit'
|
14
|
-
require 'time'
|
15
|
-
require 'yaml'
|
16
|
-
|
17
|
-
# Overwrite #gem to not load i18n gem by libraries like active_support
|
18
|
-
alias gem_for_ruby_19 gem # for 1.9. gives a super ugly seg fault otherwise
|
19
|
-
def gem(gem_name, *version_requirements)
|
20
|
-
if gem_name =='i18n'
|
21
|
-
puts "Skiping loading i18n gem..."
|
22
|
-
return
|
23
|
-
end
|
24
|
-
super(gem_name, *version_requirements)
|
25
|
-
end
|
26
|
-
|
27
|
-
require 'active_record'
|
28
|
-
|
29
|
-
begin
|
30
|
-
require 'mocha'
|
31
|
-
rescue LoadError
|
32
|
-
puts "skipping tests using mocha as mocha can't be found"
|
33
|
-
end
|
34
|
-
|
35
|
-
class Test::Unit::TestCase
|
36
|
-
def self.test(name, &block)
|
37
|
-
test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
|
38
|
-
defined = instance_method(test_name) rescue false
|
39
|
-
raise "#{test_name} is already defined in #{self}" if defined
|
40
|
-
if block_given?
|
41
|
-
define_method(test_name, &block)
|
42
|
-
else
|
43
|
-
define_method(test_name) do
|
44
|
-
flunk "No implementation provided for #{name}"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def self.with_mocha
|
50
|
-
yield if Object.respond_to?(:expects)
|
51
|
-
end
|
52
|
-
|
53
|
-
def teardown
|
54
|
-
I18n.locale = nil
|
55
|
-
I18n.default_locale = :en
|
56
|
-
I18n.load_path = []
|
57
|
-
I18n.available_locales = nil
|
58
|
-
I18n.backend = nil
|
59
|
-
end
|
60
|
-
|
61
|
-
def translations
|
62
|
-
I18n.backend.instance_variable_get(:@translations)
|
63
|
-
end
|
64
|
-
|
65
|
-
def store_translations(*args)
|
66
|
-
data = args.pop
|
67
|
-
locale = args.pop || :en
|
68
|
-
I18n.backend.store_translations(locale, data)
|
69
|
-
end
|
70
|
-
|
71
|
-
def locales_dir
|
72
|
-
File.dirname(__FILE__) + '/test_data/locales'
|
73
|
-
end
|
74
|
-
|
75
|
-
def euc_jp(string)
|
76
|
-
string.encode!(Encoding::EUC_JP)
|
77
|
-
end
|
78
|
-
|
79
|
-
def can_store_procs?
|
80
|
-
I18n.backend.class != I18n::Backend::ActiveRecord or
|
81
|
-
I18n::Backend::ActiveRecord.included_modules.include?(I18n::Backend::ActiveRecord::StoreProcs)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def require_active_record!
|
86
|
-
begin
|
87
|
-
require 'active_record'
|
88
|
-
ActiveRecord::Base.connection
|
89
|
-
true
|
90
|
-
rescue ActiveRecord::ConnectionNotEstablished
|
91
|
-
require 'i18n/backend/active_record'
|
92
|
-
require 'i18n/backend/active_record/store_procs'
|
93
|
-
setup_active_record
|
94
|
-
true
|
95
|
-
rescue LoadError
|
96
|
-
puts "skipping tests using activerecord as activerecord can't be found"
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
def setup_active_record
|
101
|
-
if I18n::Backend::Simple.method_defined?(:interpolate_with_deprecated_syntax)
|
102
|
-
I18n::Backend::Simple.send(:remove_method, :interpolate) rescue NameError
|
103
|
-
end
|
104
|
-
|
105
|
-
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
|
106
|
-
ActiveRecord::Migration.verbose = false
|
107
|
-
ActiveRecord::Schema.define(:version => 1) do
|
108
|
-
create_table :translations do |t|
|
109
|
-
t.string :locale
|
110
|
-
t.string :key
|
111
|
-
t.string :value
|
112
|
-
t.string :interpolations
|
113
|
-
t.boolean :is_proc, :default => false
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|