r18n-core 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +8 -0
- data/base/hu.yml +19 -0
- data/base/ja.yml +19 -0
- data/lib/r18n-core/locale.rb +3 -2
- data/lib/r18n-core/version.rb +1 -1
- data/locales/hu.rb +47 -0
- data/locales/ja.rb +18 -0
- data/locales/pl.rb +1 -1
- data/locales/zh.rb +0 -1
- data/spec/locale_spec.rb +1 -0
- data/spec/locales/hu_spec.rb +18 -0
- metadata +40 -4
data/ChangeLog
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 0.4.7 (Mado)
|
2
|
+
* Fix autodetect locale in Windows and Ruby 1.9.1 (by Marvin Gülker).
|
3
|
+
* Fix autodetect locale in JRuby (by Kővágó, Zoltán).
|
4
|
+
* Fix human time format on 60 minutes.
|
5
|
+
* Add Hungarian locale (by Kővágó, Zoltán).
|
6
|
+
* Add Japanese locale (by hryk).
|
7
|
+
* Fix Polish locale (by Piotr Szotkowski).
|
8
|
+
|
1
9
|
== 0.4.6 (Trinity)
|
2
10
|
* Add support for new interpolation syntax in Rails 3.
|
3
11
|
* Add Catalian locale (by Jordi Romero).
|
data/base/hu.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
ok: OK
|
2
|
+
save: Mentés
|
3
|
+
cancel: Mégse
|
4
|
+
'yes': 'Igen'
|
5
|
+
'no': 'Nem'
|
6
|
+
exit: Kilépés
|
7
|
+
delete: Törlés
|
8
|
+
|
9
|
+
human_time:
|
10
|
+
after_days: %1 nap múlva
|
11
|
+
tomorrow: holnap
|
12
|
+
after_hours: %1 óra múlva
|
13
|
+
after_minutes: %1 perc múlva
|
14
|
+
now: most
|
15
|
+
today: ma
|
16
|
+
minutes_ago: %1 perccel ezelőtt
|
17
|
+
hours_ago: %1 órával ezelőtt
|
18
|
+
yesterday: tegnap
|
19
|
+
days_ago: %1 nappal ezelőtt
|
data/base/ja.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
ok: 了解
|
2
|
+
save: 保存
|
3
|
+
cancel: キャンセル
|
4
|
+
'yes': 'はい'
|
5
|
+
'no': 'いいえ'
|
6
|
+
exit: 終了
|
7
|
+
delete: 削除
|
8
|
+
|
9
|
+
human_time:
|
10
|
+
after_days: %1日後
|
11
|
+
tomorrow: 明日
|
12
|
+
after_hours: %1時間後
|
13
|
+
after_minutes: %1分後
|
14
|
+
now: 今
|
15
|
+
today: 今日
|
16
|
+
minutes_ago: %1分前
|
17
|
+
hours_ago: %1時間前
|
18
|
+
yesterday: 昨日
|
19
|
+
days_ago: %1日前
|
data/lib/r18n-core/locale.rb
CHANGED
@@ -118,6 +118,7 @@ module R18n
|
|
118
118
|
:year_format => '_ %Y'
|
119
119
|
|
120
120
|
def month_standalone; month_names; end
|
121
|
+
def month_abbrs; month_names; end
|
121
122
|
|
122
123
|
# Is locale has left-to-right write direction.
|
123
124
|
def ltr?; true; end
|
@@ -227,9 +228,9 @@ module R18n
|
|
227
228
|
R18n::Utils.to_date(now)) + format_time(time)
|
228
229
|
else
|
229
230
|
case minutes
|
230
|
-
when -
|
231
|
+
when -59..-1
|
231
232
|
i18n.human_time.minutes_ago(minutes.round.abs)
|
232
|
-
when 1..
|
233
|
+
when 1..59
|
233
234
|
i18n.human_time.after_minutes(minutes.round)
|
234
235
|
when -1..1
|
235
236
|
i18n.human_time.now
|
data/lib/r18n-core/version.rb
CHANGED
data/locales/hu.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module R18n
|
3
|
+
class Locales::Hu < Locale
|
4
|
+
set :title => 'Magyar',
|
5
|
+
|
6
|
+
:week_start => :monday,
|
7
|
+
:wday_names => %w{vasárnap hétfő kedd szerda csütörtök péntek szombat},
|
8
|
+
:wday_abbrs => %w{vas hét ked sze csü pén szo},
|
9
|
+
|
10
|
+
:month_names => %w{január február március április május június július
|
11
|
+
augusztus szeptember október november december},
|
12
|
+
:month_abbrs => %w{jan feb már ápr máj jún júl aug sze okt nov dec},
|
13
|
+
|
14
|
+
:date_format => '%Y. %m. %d.',
|
15
|
+
:full_format => '%B %e.',
|
16
|
+
:year_format => '%Y. _',
|
17
|
+
:time_format => '%H:%M',
|
18
|
+
|
19
|
+
:number_decimal => ",",
|
20
|
+
:number_group => " "
|
21
|
+
|
22
|
+
def format_integer(integer)
|
23
|
+
str = integer.to_s
|
24
|
+
str[0] = '−' if 0 > integer # Real typographic minus
|
25
|
+
group = number_group
|
26
|
+
|
27
|
+
# only group numbers if it has at least 5 digits
|
28
|
+
# http://hu.wikisource.org/wiki/A_magyar_helyes%C3%ADr%C3%A1s_szab%C3%A1lyai/Az_%C3%ADr%C3%A1sjelek#274.
|
29
|
+
if integer.abs >= 10000
|
30
|
+
str.gsub(/(\d)(?=(\d\d\d)+(?!\d))/) do |match|
|
31
|
+
match + group
|
32
|
+
end
|
33
|
+
else
|
34
|
+
str
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def format_time_standard(time, *params)
|
39
|
+
format_date_standard(time) + ', ' + format_time(time)
|
40
|
+
end
|
41
|
+
|
42
|
+
def format_time_full(time, *params)
|
43
|
+
format_date_full(time) + ', ' + format_time(time)
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
data/locales/ja.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
module R18n
|
2
|
+
class Locales::Ja < Locale
|
3
|
+
set :title => '日本語',
|
4
|
+
|
5
|
+
:week_start => :sunday,
|
6
|
+
:wday_names => %w{日曜日 月曜日 火曜日 水曜日 木曜日 金曜日 土曜日},
|
7
|
+
:wday_abbrs => %w{日 月 火 水 木 金 土},
|
8
|
+
|
9
|
+
:month_names => %w{一月 二月 三月 四月 五月 六月 七月 八月 九月 十月 十一月 十二月},
|
10
|
+
|
11
|
+
:date_format => '%Y年%m月%d日',
|
12
|
+
:full_format => '%m月%d日',
|
13
|
+
:year_format => '%Y年_',
|
14
|
+
|
15
|
+
:number_decimal => ".",
|
16
|
+
:number_group => ","
|
17
|
+
end
|
18
|
+
end
|
data/locales/pl.rb
CHANGED
@@ -8,7 +8,7 @@ module R18n
|
|
8
8
|
:wday_abbrs => %w{nd pn wt śr czw pt sob},
|
9
9
|
|
10
10
|
:month_names => %w{stycznia lutego marca kwietnia maja czerwca lipca
|
11
|
-
sierpnia września
|
11
|
+
sierpnia września października listopada grudnia},
|
12
12
|
:month_abbrs => %w{I II III IV V VI VII VIII IX X XI XII},
|
13
13
|
:month_standalone => %w{styczeń luty marzec kwiecień maj czerwiec lipiec
|
14
14
|
sierpień wrzesień październik listopad
|
data/locales/zh.rb
CHANGED
data/spec/locale_spec.rb
CHANGED
@@ -109,6 +109,7 @@ describe R18n::Locale do
|
|
109
109
|
@ru.localize( zero + 50 * hour, *params).should == 'через 2 дня 02:00'
|
110
110
|
@ru.localize( zero + 25 * hour, *params).should == 'завтра 01:00'
|
111
111
|
@ru.localize( zero + 70 * minute, *params).should == 'через 1 час'
|
112
|
+
@ru.localize( zero + hour, *params).should == 'через 1 час'
|
112
113
|
@ru.localize( zero + 38 * minute, *params).should == 'через 38 минут'
|
113
114
|
@ru.localize( zero + 5, *params).should == 'сейчас'
|
114
115
|
@ru.localize( zero - 15, *params).should == 'сейчас'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
|
3
|
+
|
4
|
+
describe R18n::Locales::Hu do
|
5
|
+
it "should use Hungarian digits groups" do
|
6
|
+
hu = R18n::I18n.new('hu')
|
7
|
+
hu.l(1000).should == '1000'
|
8
|
+
hu.l(10000).should == '10 000'
|
9
|
+
hu.l(-10000).should == '−10 000'
|
10
|
+
hu.l(100000).should == '100 000'
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should use Hungarian time format" do
|
14
|
+
hu = R18n::I18n.new('hu')
|
15
|
+
hu.l(Time.at(0).utc).should == '1970. 01. 01., 00:00'
|
16
|
+
hu.l(Time.at(0).utc, :full).should == '1970. január 1., 00:00'
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r18n-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 1
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 4
|
8
|
-
-
|
9
|
-
version: 0.4.
|
9
|
+
- 7
|
10
|
+
version: 0.4.7
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Andrey "A.I." Sitnik
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-08-07 00:00:00 +04:00
|
18
19
|
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|
@@ -32,6 +33,7 @@ files:
|
|
32
33
|
- base/th.yml
|
33
34
|
- base/zh.yml
|
34
35
|
- base/eo.yml
|
36
|
+
- base/hu.yml
|
35
37
|
- base/pl.yml
|
36
38
|
- base/sk.yml
|
37
39
|
- base/kk.yml
|
@@ -44,6 +46,7 @@ files:
|
|
44
46
|
- base/it.yml
|
45
47
|
- base/ru.yml
|
46
48
|
- base/pt_br.yml
|
49
|
+
- base/ja.yml
|
47
50
|
- base/fr.yml
|
48
51
|
- base/cs.yml
|
49
52
|
- lib/r18n-core/version.rb
|
@@ -74,13 +77,41 @@ files:
|
|
74
77
|
- locales/lv.rb
|
75
78
|
- locales/ru.rb
|
76
79
|
- locales/en-us.rb
|
80
|
+
- locales/ja.rb
|
77
81
|
- locales/en-gb.rb
|
78
82
|
- locales/de.rb
|
83
|
+
- locales/hu.rb
|
79
84
|
- locales/pt-br.rb
|
80
85
|
- locales/ca.rb
|
81
86
|
- LICENSE
|
82
87
|
- ChangeLog
|
83
88
|
- README.rdoc
|
89
|
+
- spec/yaml_loader_spec.rb
|
90
|
+
- spec/translations/general/no-lc.yml
|
91
|
+
- spec/translations/general/en.yml
|
92
|
+
- spec/translations/general/ru.yml
|
93
|
+
- spec/translations/two/en.yml
|
94
|
+
- spec/translations/two/fr.yml
|
95
|
+
- spec/translations/extension/no-tr.yml
|
96
|
+
- spec/translations/extension/en.yml
|
97
|
+
- spec/translations/extension/deep/en.yml
|
98
|
+
- spec/spec_helper.rb
|
99
|
+
- spec/i18n_spec.rb
|
100
|
+
- spec/translation_spec.rb
|
101
|
+
- spec/locales/hu_spec.rb
|
102
|
+
- spec/locales/en-us_spec.rb
|
103
|
+
- spec/locales/cs_spec.rb
|
104
|
+
- spec/locales/sk_spec.rb
|
105
|
+
- spec/locales/ru_spec.rb
|
106
|
+
- spec/locales/fr_spec.rb
|
107
|
+
- spec/locales/th_spec.rb
|
108
|
+
- spec/locales/en_spec.rb
|
109
|
+
- spec/locales/it_spec.rb
|
110
|
+
- spec/locales/pl_spec.rb
|
111
|
+
- spec/translated_spec.rb
|
112
|
+
- spec/r18n_spec.rb
|
113
|
+
- spec/filters_spec.rb
|
114
|
+
- spec/locale_spec.rb
|
84
115
|
has_rdoc: true
|
85
116
|
homepage: http://r18n.rubyforge.org/
|
86
117
|
licenses: []
|
@@ -91,23 +122,27 @@ rdoc_options: []
|
|
91
122
|
require_paths:
|
92
123
|
- lib
|
93
124
|
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
94
126
|
requirements:
|
95
127
|
- - ">="
|
96
128
|
- !ruby/object:Gem::Version
|
129
|
+
hash: 3
|
97
130
|
segments:
|
98
131
|
- 0
|
99
132
|
version: "0"
|
100
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
|
+
none: false
|
101
135
|
requirements:
|
102
136
|
- - ">="
|
103
137
|
- !ruby/object:Gem::Version
|
138
|
+
hash: 3
|
104
139
|
segments:
|
105
140
|
- 0
|
106
141
|
version: "0"
|
107
142
|
requirements: []
|
108
143
|
|
109
144
|
rubyforge_project: r18n-core
|
110
|
-
rubygems_version: 1.3.
|
145
|
+
rubygems_version: 1.3.7
|
111
146
|
signing_key:
|
112
147
|
specification_version: 3
|
113
148
|
summary: I18n tool to translate your Ruby application.
|
@@ -124,6 +159,7 @@ test_files:
|
|
124
159
|
- spec/spec_helper.rb
|
125
160
|
- spec/i18n_spec.rb
|
126
161
|
- spec/translation_spec.rb
|
162
|
+
- spec/locales/hu_spec.rb
|
127
163
|
- spec/locales/en-us_spec.rb
|
128
164
|
- spec/locales/cs_spec.rb
|
129
165
|
- spec/locales/sk_spec.rb
|