r18n-core 2.0.4 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +7 -0
- data/base/fa.yml +31 -0
- data/base/{mn.rb → mn.yml} +0 -0
- data/base/vi.yml +19 -0
- data/lib/r18n-core/locale.rb +7 -7
- data/lib/r18n-core/version.rb +1 -1
- data/locales/bg.rb +2 -2
- data/locales/ca.rb +2 -2
- data/locales/cs.rb +2 -2
- data/locales/da.rb +2 -2
- data/locales/de.rb +2 -2
- data/locales/en-us.rb +1 -1
- data/locales/en.rb +2 -2
- data/locales/eo.rb +2 -2
- data/locales/es-us.rb +2 -2
- data/locales/es.rb +2 -2
- data/locales/fa.rb +50 -0
- data/locales/fi.rb +4 -4
- data/locales/fr.rb +2 -2
- data/locales/gl.rb +2 -2
- data/locales/hr.rb +2 -2
- data/locales/hu.rb +7 -10
- data/locales/id.rb +2 -2
- data/locales/it.rb +3 -3
- data/locales/ja.rb +6 -2
- data/locales/kk.rb +2 -2
- data/locales/lv.rb +2 -2
- data/locales/mn.rb +2 -2
- data/locales/nb.rb +2 -2
- data/locales/nl.rb +2 -2
- data/locales/no.rb +2 -2
- data/locales/pl.rb +2 -2
- data/locales/pt.rb +2 -2
- data/locales/ru.rb +2 -2
- data/locales/sk.rb +2 -3
- data/locales/sr-latn.rb +2 -2
- data/locales/sv-se.rb +2 -2
- data/locales/th.rb +6 -2
- data/locales/tr.rb +7 -3
- data/locales/vi.rb +26 -0
- data/locales/zh.rb +6 -2
- data/spec/locales/fa_spec.rb +10 -0
- data/spec/locales/th_spec.rb +1 -1
- data/spec/locales/vi_spec.rb +8 -0
- metadata +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bb0f68d184f4e8e36b9c3b0710b7bcda32e9dbc
|
4
|
+
data.tar.gz: c0e10b3c35f008b31e2d8173bef0047d2c478e6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f91f3a5de1bf85cabf0b6b6e8b922c0b1458016acde513f805c1d8cd00939170d98be77207975f50d57fe0f092cfad70df2275ffab28e8a56780d141d3aa909
|
7
|
+
data.tar.gz: 074759b4e79f377f18a901eaeaf55f347bc078620349eb68b4aaceb7e54572774c09e74920612cc546c69b25898f0fe214966651083d596b8cfacdf90934b7df
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 2.1 (Một)
|
2
|
+
* Add Vietnamese locale (by Nguyễn Văn Được).
|
3
|
+
* Add Persian locale.
|
4
|
+
* Allow to change date/time order in locales.
|
5
|
+
* Fix pluralization in locales without plural forms.
|
6
|
+
* Fix Mongolian base translations.
|
7
|
+
|
1
8
|
## 2.0.4 (Ikkuna)
|
2
9
|
* Fix Windows support (by janahanEDH).
|
3
10
|
|
data/base/fa.yml
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
ok: 'باشه'
|
2
|
+
save: 'ذخیر'
|
3
|
+
cancel: 'لغو'
|
4
|
+
'yes': 'بله'
|
5
|
+
'no': 'هیچ'
|
6
|
+
exit: 'خروج'
|
7
|
+
delete: 'حذف'
|
8
|
+
|
9
|
+
human_time:
|
10
|
+
after_days: !!pl
|
11
|
+
1: 'بعد از %1 روز'
|
12
|
+
n: 'پس از %1 روز'
|
13
|
+
tomorrow: 'فردا'
|
14
|
+
after_hours: !!pl
|
15
|
+
1: 'بعد از %1 ساعت'
|
16
|
+
n: 'پس از %1 ساعت'
|
17
|
+
after_minutes: !!pl
|
18
|
+
1: 'بعد از %1 دقیقه'
|
19
|
+
n: 'بپس از %1 دقیقه'
|
20
|
+
now: 'اکنون'
|
21
|
+
today: 'امروز'
|
22
|
+
minutes_ago: !!pl
|
23
|
+
1: '%1 دقیقه قبل'
|
24
|
+
n: '%1 دقیقه پیش'
|
25
|
+
hours_ago: !!pl
|
26
|
+
1: '%1 ساعت پیش'
|
27
|
+
n: '%1 ساعت پیش'
|
28
|
+
yesterday: 'دیروز'
|
29
|
+
days_ago: !!pl
|
30
|
+
1: '%1 روز قبل'
|
31
|
+
n: '%1 روز پیش'
|
data/base/{mn.rb → mn.yml}
RENAMED
File without changes
|
data/base/vi.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
ok: 'OK'
|
2
|
+
save: 'Lưu'
|
3
|
+
cancel: 'Hủy'
|
4
|
+
'yes': 'Đồng ý'
|
5
|
+
'no': 'Không'
|
6
|
+
exit: 'Thoát'
|
7
|
+
delete: 'Xóa'
|
8
|
+
|
9
|
+
human_time:
|
10
|
+
after_days: 'Sau %1 ngày'
|
11
|
+
tomorrow: 'ngày mai'
|
12
|
+
after_hours: 'Sau %1 giờ'
|
13
|
+
after_minutes: 'Sau %1 phút'
|
14
|
+
now: 'Ngay bây giờ'
|
15
|
+
today: 'ngày hôm nay'
|
16
|
+
minutes_ago: '%1 phút trước'
|
17
|
+
hours_ago: '%1 giờ trước'
|
18
|
+
yesterday: 'ngày hôm qua'
|
19
|
+
days_ago: '%1 ngày trước'
|
data/lib/r18n-core/locale.rb
CHANGED
@@ -115,7 +115,7 @@ module R18n
|
|
115
115
|
week_start: :monday,
|
116
116
|
time_am: 'AM',
|
117
117
|
time_pm: 'PM',
|
118
|
-
time_format: ' %H:%M',
|
118
|
+
time_format: '_ %H:%M',
|
119
119
|
full_format: '%e %B',
|
120
120
|
year_format: '_ %Y'
|
121
121
|
|
@@ -215,9 +215,9 @@ module R18n
|
|
215
215
|
time.strftime(translated)
|
216
216
|
end
|
217
217
|
|
218
|
-
# Format +time+
|
219
|
-
def format_time(time)
|
220
|
-
strftime(time, time_format)
|
218
|
+
# Format +time+ and set +date+
|
219
|
+
def format_time(date, time)
|
220
|
+
strftime(time, time_format).sub('_', date.to_s)
|
221
221
|
end
|
222
222
|
|
223
223
|
# Format +time+ in human usable form. For example “5 minutes ago” or
|
@@ -227,7 +227,7 @@ module R18n
|
|
227
227
|
minutes = (time - now) / 60.0
|
228
228
|
diff = minutes.abs
|
229
229
|
if (diff > 24 * 60) or (time.mday != now.mday and diff > 12 * 24)
|
230
|
-
format_date_human(time.to_date, i18n, now.to_date)
|
230
|
+
format_time(format_date_human(time.to_date, i18n, now.to_date), time)
|
231
231
|
else
|
232
232
|
if -1 < minutes and 1 > minutes
|
233
233
|
i18n.human_time.now
|
@@ -245,13 +245,13 @@ module R18n
|
|
245
245
|
|
246
246
|
# Format +time+ in compact form. For example, “12/31/09 12:59”.
|
247
247
|
def format_time_standard(time, *params)
|
248
|
-
format_date_standard(time)
|
248
|
+
format_time(format_date_standard(time), time)
|
249
249
|
end
|
250
250
|
|
251
251
|
# Format +time+ in most official form. For example, “December 31st, 2009
|
252
252
|
# 12:59”. For special cases you can replace it in locale’s class.
|
253
253
|
def format_time_full(time, *params)
|
254
|
-
format_date_full(time)
|
254
|
+
format_time(format_date_full(time), time)
|
255
255
|
end
|
256
256
|
|
257
257
|
# Format +date+ in human usable form. For example “5 days ago” or
|
data/lib/r18n-core/version.rb
CHANGED
data/locales/bg.rb
CHANGED
data/locales/ca.rb
CHANGED
data/locales/cs.rb
CHANGED
data/locales/da.rb
CHANGED
data/locales/de.rb
CHANGED
data/locales/en-us.rb
CHANGED
data/locales/en.rb
CHANGED
data/locales/eo.rb
CHANGED
data/locales/es-us.rb
CHANGED
data/locales/es.rb
CHANGED
data/locales/fa.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
module R18n
|
2
|
+
class Locales::Fa < Locale
|
3
|
+
set title: 'فارْسِى',
|
4
|
+
|
5
|
+
wday_names: %w{یکشنبه دوشنبه سهشنبه چهارشنبه پنجشنبه جمعه شنبه},
|
6
|
+
wday_abbrs: %w{ی د س چ پ ج ش},
|
7
|
+
|
8
|
+
month_names: %w{ژانویه فوریه مارس آوریل مه ژوئن ژوئیه اوت سپتامبر اکتبر نوامبر دسامبر},
|
9
|
+
month_abbrs: %w{ژانویه فوریه مارس آوریل مه ژوئن ژوئیه اوت سپتامبر اکتبر نوامبر دسامبر},
|
10
|
+
|
11
|
+
date_format: '%Y/%m/%d',
|
12
|
+
full_format: '%e %B',
|
13
|
+
year_format: '_ %Y',
|
14
|
+
|
15
|
+
number_decimal: '٫',
|
16
|
+
number_group: '٬'
|
17
|
+
|
18
|
+
# Change direction
|
19
|
+
def ltr?; false; end
|
20
|
+
|
21
|
+
# Change numerals to Persian
|
22
|
+
def format_integer(integer)
|
23
|
+
persian_numerals super
|
24
|
+
end
|
25
|
+
|
26
|
+
# Change numerals to Persian
|
27
|
+
def format_float(integer)
|
28
|
+
persian_numerals super
|
29
|
+
end
|
30
|
+
|
31
|
+
# Change numerals to Persian
|
32
|
+
def strftime(time, format)
|
33
|
+
persian_numerals super
|
34
|
+
end
|
35
|
+
|
36
|
+
# Replace western numerals to Persian
|
37
|
+
def persian_numerals(str)
|
38
|
+
str.gsub('0', '۰')
|
39
|
+
.gsub('1', '۱')
|
40
|
+
.gsub('2', '۲')
|
41
|
+
.gsub('3', '۳')
|
42
|
+
.gsub('4', '۴')
|
43
|
+
.gsub('5', '۵')
|
44
|
+
.gsub('6', '۶')
|
45
|
+
.gsub('7', '۷')
|
46
|
+
.gsub('8', '۸')
|
47
|
+
.gsub('9', '۹')
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/locales/fi.rb
CHANGED
@@ -15,14 +15,14 @@ module R18n
|
|
15
15
|
marraskuu joulukuu},
|
16
16
|
|
17
17
|
date_format: '%d.%m.%Y',
|
18
|
-
time_format: ' %H.%M',
|
19
18
|
full_format: '%e. %B',
|
19
|
+
time_format: '_ %H.%M',
|
20
20
|
|
21
|
-
number_decimal:
|
22
|
-
number_group:
|
21
|
+
number_decimal: ',',
|
22
|
+
number_group: ''
|
23
23
|
|
24
24
|
def format_time_full(time, *params)
|
25
|
-
format_date_full(time) + ' kello'
|
25
|
+
format_time(format_date_full(time) + ' kello', time)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/locales/fr.rb
CHANGED
data/locales/gl.rb
CHANGED
data/locales/hr.rb
CHANGED
data/locales/hu.rb
CHANGED
@@ -13,9 +13,14 @@ module R18n
|
|
13
13
|
date_format: '%Y. %m. %d.',
|
14
14
|
full_format: '%B %e.',
|
15
15
|
year_format: '%Y. _',
|
16
|
+
time_format: '_, %H:%M',
|
16
17
|
|
17
|
-
number_decimal:
|
18
|
-
number_group:
|
18
|
+
number_decimal: ',',
|
19
|
+
number_group: ' '
|
20
|
+
|
21
|
+
def pluralize(n)
|
22
|
+
'n'
|
23
|
+
end
|
19
24
|
|
20
25
|
def format_integer(integer)
|
21
26
|
str = integer.to_s
|
@@ -32,13 +37,5 @@ module R18n
|
|
32
37
|
str
|
33
38
|
end
|
34
39
|
end
|
35
|
-
|
36
|
-
def format_time_standard(time, *params)
|
37
|
-
format_date_standard(time) + ',' + format_time(time)
|
38
|
-
end
|
39
|
-
|
40
|
-
def format_time_full(time, *params)
|
41
|
-
format_date_full(time) + ',' + format_time(time)
|
42
|
-
end
|
43
40
|
end
|
44
41
|
end
|
data/locales/id.rb
CHANGED
data/locales/it.rb
CHANGED
@@ -12,13 +12,13 @@ module R18n
|
|
12
12
|
|
13
13
|
date_format: '%d/%m/%Y',
|
14
14
|
|
15
|
-
number_decimal:
|
16
|
-
number_group:
|
15
|
+
number_decimal: ',',
|
16
|
+
number_group: ' '
|
17
17
|
|
18
18
|
def format_date_full(date, year = true, *params)
|
19
19
|
full = super(date, year)
|
20
20
|
if ' 1' == full[0..1]
|
21
|
-
|
21
|
+
'1º' + full[2..-1]
|
22
22
|
else
|
23
23
|
full
|
24
24
|
end
|
data/locales/ja.rb
CHANGED
data/locales/kk.rb
CHANGED
data/locales/lv.rb
CHANGED
data/locales/mn.rb
CHANGED
data/locales/nb.rb
CHANGED
data/locales/nl.rb
CHANGED
data/locales/no.rb
CHANGED
data/locales/pl.rb
CHANGED
data/locales/pt.rb
CHANGED
data/locales/ru.rb
CHANGED
data/locales/sk.rb
CHANGED
@@ -17,8 +17,8 @@ module R18n
|
|
17
17
|
date_format: '%d.%m.%Y',
|
18
18
|
full_format: '%e. %B',
|
19
19
|
|
20
|
-
number_decimal:
|
21
|
-
number_group:
|
20
|
+
number_decimal: ',',
|
21
|
+
number_group: ' '
|
22
22
|
|
23
23
|
def pluralize(n)
|
24
24
|
case n
|
@@ -34,4 +34,3 @@ module R18n
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
37
|
-
|
data/locales/sr-latn.rb
CHANGED
data/locales/sv-se.rb
CHANGED
data/locales/th.rb
CHANGED
@@ -15,8 +15,12 @@ module R18n
|
|
15
15
|
full_format: '%e %B',
|
16
16
|
year_format: '_, %Y',
|
17
17
|
|
18
|
-
number_decimal:
|
19
|
-
number_group:
|
18
|
+
number_decimal: '.',
|
19
|
+
number_group: ','
|
20
|
+
|
21
|
+
def pluralize(n)
|
22
|
+
'n'
|
23
|
+
end
|
20
24
|
|
21
25
|
def strftime(time, format)
|
22
26
|
year = (time.year + 543).to_s
|
data/locales/tr.rb
CHANGED
@@ -12,9 +12,13 @@ module R18n
|
|
12
12
|
date_format: '%d.%m.%Y',
|
13
13
|
full_format: '%B %e.',
|
14
14
|
year_format: '%Y. _',
|
15
|
-
time_format: '%H:%M',
|
15
|
+
time_format: '_%H:%M',
|
16
16
|
|
17
|
-
number_decimal:
|
18
|
-
number_group:
|
17
|
+
number_decimal: '.',
|
18
|
+
number_group: ','
|
19
|
+
|
20
|
+
def pluralize(n)
|
21
|
+
'n'
|
22
|
+
end
|
19
23
|
end
|
20
24
|
end
|
data/locales/vi.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module R18n
|
2
|
+
class Locales::Vi < Locale
|
3
|
+
set title: 'Tiếng Việt',
|
4
|
+
|
5
|
+
wday_names: ['Chủ nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm',
|
6
|
+
'Thứ Sáu', 'Thứ Bảy'],
|
7
|
+
wday_abbrs: %w{CN T2 T3 T4 T5 T6 T7},
|
8
|
+
|
9
|
+
month_names: ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5',
|
10
|
+
'tháng 6', 'tháng 7', 'tháng 8',' tháng 9', 'tháng 10',
|
11
|
+
'tháng 11', 'tháng 12'],
|
12
|
+
month_abbrs: %w{th1 th2 th3 th4 th5 th6 th7 th8 th9 th10 th11 th12},
|
13
|
+
|
14
|
+
date_format: '%d/%m/%Y',
|
15
|
+
full_format: 'ngày %e %B',
|
16
|
+
year_format: '_ năm %Y',
|
17
|
+
time_format: '%H:%M, _',
|
18
|
+
|
19
|
+
number_decimal: '.',
|
20
|
+
number_group: ','
|
21
|
+
|
22
|
+
def pluralize(n)
|
23
|
+
'n'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/locales/zh.rb
CHANGED
@@ -0,0 +1,10 @@
|
|
1
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe R18n::Locales::Fa do
|
4
|
+
it "formats Persian numerals" do
|
5
|
+
fa = R18n::I18n.new('fa')
|
6
|
+
expect(fa.l(1234567890)).to eq('۱٬۲۳۴٬۵۶۷٬۸۹۰')
|
7
|
+
expect(fa.l(10.123)).to eq('۱۰٫۱۲۳')
|
8
|
+
expect(fa.l(Date.parse('2009-05-01'))).to eq('۲۰۰۹/۰۵/۰۱')
|
9
|
+
end
|
10
|
+
end
|
data/spec/locales/th_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r18n-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Sitnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
R18n is a i18n tool to translate your Ruby application.
|
@@ -37,6 +37,7 @@ files:
|
|
37
37
|
- base/en.yml
|
38
38
|
- base/eo.yml
|
39
39
|
- base/es.yml
|
40
|
+
- base/fa.yml
|
40
41
|
- base/fi.yml
|
41
42
|
- base/fr.yml
|
42
43
|
- base/gl.yml
|
@@ -47,7 +48,7 @@ files:
|
|
47
48
|
- base/ja.yml
|
48
49
|
- base/kk.yml
|
49
50
|
- base/lv.yml
|
50
|
-
- base/mn.
|
51
|
+
- base/mn.yml
|
51
52
|
- base/nb.yml
|
52
53
|
- base/nl.yml
|
53
54
|
- base/pl.yml
|
@@ -59,6 +60,7 @@ files:
|
|
59
60
|
- base/th.yml
|
60
61
|
- base/tr.yml
|
61
62
|
- base/uk.yml
|
63
|
+
- base/vi.yml
|
62
64
|
- base/zh.yml
|
63
65
|
- lib/r18n-core.rb
|
64
66
|
- lib/r18n-core/filter_list.rb
|
@@ -87,6 +89,7 @@ files:
|
|
87
89
|
- locales/eo.rb
|
88
90
|
- locales/es-us.rb
|
89
91
|
- locales/es.rb
|
92
|
+
- locales/fa.rb
|
90
93
|
- locales/fi.rb
|
91
94
|
- locales/fr.rb
|
92
95
|
- locales/gl.rb
|
@@ -111,6 +114,7 @@ files:
|
|
111
114
|
- locales/th.rb
|
112
115
|
- locales/tr.rb
|
113
116
|
- locales/uk.rb
|
117
|
+
- locales/vi.rb
|
114
118
|
- locales/zh-cn.rb
|
115
119
|
- locales/zh-tw.rb
|
116
120
|
- locales/zh.rb
|
@@ -121,6 +125,7 @@ files:
|
|
121
125
|
- spec/locales/cs_spec.rb
|
122
126
|
- spec/locales/en-us_spec.rb
|
123
127
|
- spec/locales/en_spec.rb
|
128
|
+
- spec/locales/fa_spec.rb
|
124
129
|
- spec/locales/fr_spec.rb
|
125
130
|
- spec/locales/hu_spec.rb
|
126
131
|
- spec/locales/it_spec.rb
|
@@ -128,6 +133,7 @@ files:
|
|
128
133
|
- spec/locales/ru_spec.rb
|
129
134
|
- spec/locales/sk_spec.rb
|
130
135
|
- spec/locales/th_spec.rb
|
136
|
+
- spec/locales/vi_spec.rb
|
131
137
|
- spec/r18n_spec.rb
|
132
138
|
- spec/spec_helper.rb
|
133
139
|
- spec/translated_spec.rb
|
@@ -172,6 +178,7 @@ test_files:
|
|
172
178
|
- spec/locales/cs_spec.rb
|
173
179
|
- spec/locales/en-us_spec.rb
|
174
180
|
- spec/locales/en_spec.rb
|
181
|
+
- spec/locales/fa_spec.rb
|
175
182
|
- spec/locales/fr_spec.rb
|
176
183
|
- spec/locales/hu_spec.rb
|
177
184
|
- spec/locales/it_spec.rb
|
@@ -179,6 +186,7 @@ test_files:
|
|
179
186
|
- spec/locales/ru_spec.rb
|
180
187
|
- spec/locales/sk_spec.rb
|
181
188
|
- spec/locales/th_spec.rb
|
189
|
+
- spec/locales/vi_spec.rb
|
182
190
|
- spec/r18n_spec.rb
|
183
191
|
- spec/spec_helper.rb
|
184
192
|
- spec/translated_spec.rb
|