pagy 4.9.0 → 4.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/config/pagy.rb +1 -1
- data/lib/javascripts/pagy.js +1 -1
- data/lib/locales/ar.yml +26 -0
- data/lib/locales/utils/p11n.rb +24 -8
- data/lib/pagy.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac5363f9e7c7fa6c00eda0eae38e2ce292bac8f1afede24c2bf1bf71d874d3f6
|
4
|
+
data.tar.gz: 0ab42911923b12cbcc7cbe39f2d933cac8a196299ead6c61f69fc589b9c6269e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 565141342d7be4697ae7f63422fa959597fd8a5a519739a43cfccd34a24f1df24a94df8adb0837a4986b699aed4a73efe3dd2d960a4de304fd04643de628626b
|
7
|
+
data.tar.gz: 6c99c7c414c28120d777b50a0f8555118b168d02fa53fd94d9a672be1984debb986b9cefaec9d58d2a35905ae9693cf951cbfaf88387b44557851e015e8ccfa2
|
data/lib/config/pagy.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Pagy initializer file (4.
|
3
|
+
# Pagy initializer file (4.10.0)
|
4
4
|
# Customize only what you really need and notice that Pagy works also without any of the following lines.
|
5
5
|
# Should you just cherry pick part of this file, please maintain the require-order of the extras
|
6
6
|
|
data/lib/javascripts/pagy.js
CHANGED
data/lib/locales/ar.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# :arabic pluralization (see https://github.com/ddnexus/pagy/blob/master/lib/locales/utils/p11n.rb)
|
2
|
+
|
3
|
+
ar:
|
4
|
+
pagy:
|
5
|
+
|
6
|
+
item_name:
|
7
|
+
zero: "صفر"
|
8
|
+
one: "عنصر"
|
9
|
+
two: "عنصرين"
|
10
|
+
few: "قليل"
|
11
|
+
many: "كثير"
|
12
|
+
other: "عناصر"
|
13
|
+
|
14
|
+
nav:
|
15
|
+
prev: "‹ السابق"
|
16
|
+
next: "التالي ›"
|
17
|
+
gap: "…"
|
18
|
+
|
19
|
+
info:
|
20
|
+
no_items: "لا يوجد %{item_name}"
|
21
|
+
single_page: "عرض <b>%{count}</b> %{item_name}"
|
22
|
+
multiple_pages: "عرض %{item_name} <b>%{from}-%{to}</b> من اجمالي <b>%{count}</b>"
|
23
|
+
|
24
|
+
combo_nav_js: "الصفحة %{page_input} من %{pages}"
|
25
|
+
|
26
|
+
items_selector_js: "عرض %{items_input} %{item_name} لكل صفحة"
|
data/lib/locales/utils/p11n.rb
CHANGED
@@ -19,6 +19,20 @@ from12to14 = [12,13,14].freeze
|
|
19
19
|
p11n = {
|
20
20
|
one_other: -> (n){ n == 1 ? 'one' : 'other' }, # default
|
21
21
|
|
22
|
+
arabic: lambda do |n|
|
23
|
+
n ||= 0
|
24
|
+
mod100 = n % 100
|
25
|
+
|
26
|
+
case
|
27
|
+
when n == 0 then 'zero' # rubocop:disable Style/NumericPredicate
|
28
|
+
when n == 1 then 'one'
|
29
|
+
when n == 2 then 'two'
|
30
|
+
when (3..10).to_a.include?(mod100) then 'few'
|
31
|
+
when (11..99).to_a.include?(mod100) then 'many'
|
32
|
+
else 'other'
|
33
|
+
end
|
34
|
+
end,
|
35
|
+
|
22
36
|
east_slavic: lambda do |n|
|
23
37
|
n ||= 0
|
24
38
|
mod10 = n % 10
|
@@ -32,14 +46,6 @@ p11n = {
|
|
32
46
|
end
|
33
47
|
end,
|
34
48
|
|
35
|
-
west_slavic: lambda do |n|
|
36
|
-
case n
|
37
|
-
when 1 then 'one'
|
38
|
-
when 2, 3, 4 then 'few'
|
39
|
-
else 'other'
|
40
|
-
end
|
41
|
-
end,
|
42
|
-
|
43
49
|
one_two_other: lambda do |n|
|
44
50
|
case n
|
45
51
|
when 1 then 'one'
|
@@ -63,7 +69,16 @@ p11n = {
|
|
63
69
|
when (from0to1 + from5to9).include?(mod10) || from12to14.include?(mod100) then 'many'
|
64
70
|
else 'other'
|
65
71
|
end
|
72
|
+
end,
|
73
|
+
|
74
|
+
west_slavic: lambda do |n|
|
75
|
+
case n
|
76
|
+
when 1 then 'one'
|
77
|
+
when 2, 3, 4 then 'few'
|
78
|
+
else 'other'
|
79
|
+
end
|
66
80
|
end
|
81
|
+
|
67
82
|
}
|
68
83
|
|
69
84
|
# Hash of locale/pluralization pairs
|
@@ -71,6 +86,7 @@ p11n = {
|
|
71
86
|
# The default pluralization for locales not explicitly listed here
|
72
87
|
# is the :one_other pluralization proc (used for English)
|
73
88
|
plurals = Hash.new(p11n[:one_other]).tap do |hash|
|
89
|
+
hash['ar'] = p11n[:arabic]
|
74
90
|
hash['bs'] = p11n[:east_slavic]
|
75
91
|
hash['cs'] = p11n[:west_slavic]
|
76
92
|
hash['id'] = p11n[:other]
|
data/lib/pagy.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domizio Demichelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Agnostic pagination in plain ruby: it works with any framework, ORM
|
14
14
|
and DB type, with all kinds of collections, even pre-paginated, scopes, Arrays,
|
@@ -22,6 +22,7 @@ files:
|
|
22
22
|
- LICENSE.txt
|
23
23
|
- lib/config/pagy.rb
|
24
24
|
- lib/javascripts/pagy.js
|
25
|
+
- lib/locales/ar.yml
|
25
26
|
- lib/locales/bg.yml
|
26
27
|
- lib/locales/bs.yml
|
27
28
|
- lib/locales/ca.yml
|