OC.L10N.register( "federatedfilesharing", { "Do you want to add the remote share {name} from {owner}@{remote}?" : "Czy chcesz dodać zdalne udostępnienie {name} od {owner}@{remote}?", "Remote share" : "Zdalne udostępnienie", "Remote share password" : "Hasło zdalnego udostępnienia", "Cancel" : "Anuluj", "Add remote share" : "Dodaj zdalne udostępnienie", "Copy" : "Kopiuj", "Copied!" : "Skopiowano!", "Not supported!" : "Brak wsparcia!", "Press ⌘-C to copy." : "Wciśnij ⌘-C by skopiować.", "Press Ctrl-C to copy." : "Wciśnij Ctrl-C by skopiować.", "Invalid Federated Cloud ID" : "Nieprawidłowe ID Chmury Federacyjnej", "Server to server sharing is not enabled on this server" : "Serwer do udostępniania serwera nie jest włączony na tym serwerze", "Couldn't establish a federated share." : "Nie udało się ustalić Federacyjnego udostępnienia.", "Couldn't establish a federated share, maybe the password was wrong." : "Nie udało się ustalić Federacyjnego udostępnienia, może być błędne hasło.", "Federated Share request sent, you will receive an invitation. Check your notifications." : "Wysłano żądanie Udostępniania Federacyjnego, otrzymasz zaproszenie. Sprawdzaj swoje powiadomienia.", "Couldn't establish a federated share, it looks like the server to federate with is too old (Nextcloud <= 9)." : "Nie można ustanowić współdzielenia federacyjnego. Wygląda na to, że serwer wybrany do udostępnienia jest zbyt stary (Nextcloud <= 9).", "It is not allowed to send federated group shares from this server." : "Niedozwolone jest wysyłanie grupowych udostępnień federacyjnych z tego serwera.", "Sharing %1$s failed, because this item is already shared with %2$s" : "Udostępnianie %1$s nie powiodło się, ponieważ ten element jest już współdzielony z %2$s", "Not allowed to create a federated share with the same user" : "Nie można tworzyć udostępniania federacyjnego z tym samym użytkownikiem", "File is already shared with %s" : "Plik jest już współdzielony z %s", "Sharing %1$s failed, could not find %2$s, maybe the server is currently unreachable or uses a self-signed certificate." : "Udostępnianie %1$s nie powiodło się, nie można odnaleźć %2$s, być może serwer jest nieosiągalny lub używa certyfikatu z podpisem własnym.", "Could not find share" : "Nie można znaleźć powiązania", "Federated sharing" : "Udostępnianie Federacyjne", "You received \"%3$s\" as a remote share from %4$s (%1$s) (on behalf of %5$s (%2$s))" : "Otrzymałeś \"%3$s\" zdalne udostępnienie od %4$s (%1$s) (w imieniu %5$s (%2$s))", "You received {share} as a remote share from {user} (on behalf of {behalf})" : "Otrzymałeś {share} zdalne udostępnienie od {user} (w imieniu {behalf})", "You received \"%3$s\" as a remote share from %4$s (%1$s)" : "Otrzymałeś \"%3$s\" zdalne udostępnienie od %4$s (%1$s)", "You received {share} as a remote share from {user}" : "Otrzymałeś {share} zdalne udostępnienie od {user}", "Accept" : "Akceptuj", "Decline" : "Odrzuć", "Share with me through my #Nextcloud Federated Cloud ID, see %s" : "Udostępnij mi poprzez mój ID #Nextcloud Chmury Federacyjnej, zobacz %s", "Share with me through my #Nextcloud Federated Cloud ID" : "Udostępnij mi poprzez mój ID #Nextcloud Chmury Federacyjnej", "Sharing" : "Udostępnianie", "Federated file sharing" : "Federacyjne udostępnianie plików", "Provide federated file sharing across servers" : "Zezwól na federacyjne udostępnianie plików na serwerach", "Federated Cloud Sharing" : "Udostępnianie Chmury Federacyjnej", "Open documentation" : "Otwórz dokumentację", "Adjust how people can share between servers." : "Dostosuj w jaki sposób można udostępniać serwery.", "Allow users on this server to send shares to other servers. This option also allows WebDAV access to public shares" : "Zezwalaj użytkownikom na tym serwerze na wysłanie udostępnień do innych serwerów. Ta opcja umożliwia również dostęp WebDAV do udostępnień publicznych", "Allow users on this server to receive shares from other servers" : "Zezwalaj użytkownikom na tym serwerze do otrzymania udostępnień z innych serwerów", "Allow users on this server to send shares to groups on other servers" : "Zezwalaj użytkownikom na tym serwerze na udostępnianie dla grup na innych serwerach", "Allow users on this server to receive group shares from other servers" : "Zezwalaj użytkownikom na tym serwerze na przyjmowanie udostępnienia od grupy z innych serwerów", "Search global and public address book for users" : "Wyszukiwarka globalnej i publicznej książki adresowej dla użytkowników", "Allow users to publish their data to a global and public address book" : "Zezwalaj użytkownikom publikować swoje dane w globalnej i publicznej książce adresowej", "Federated Cloud" : "Chmura Federacyjna", "You can share with anyone who uses a Nextcloud server or other Open Cloud Mesh (OCM) compatible servers and services! Just put their Federated Cloud ID in the share dialog. It looks like person@cloud.example.com" : "Możesz współdzielić z każdym, kto używa serwera Nextcloud lub innych serwerów i usług kompatybilnych z Open Cloud Mesh (OCM). Wystarczy, że wpiszesz ID Chmury Federacyjnej w oknie udostępniania, według przykładu: osoba@chmura.przykładowa.com", "Your Federated Cloud ID:" : "Twoje ID Chmury Federacyjnej:", "Share it so your friends can share files with you:" : "Udostępnij, aby Twoi znajomi mogli współdzielić pliki z Tobą:", "Add to your website" : "Dodaj do swojej strony", "Share with me via Nextcloud" : "Udostępnij mi za pomocą Nextcloud", "HTML Code:" : "Kod HTML:", "You received \"%3$s\" as a remote share from %1$s (on behalf of %2$s)" : "Otrzymałeś \"%3$s\" zdalne udostępnienie od %1$s (w imieniu %2$s)", "You received \"%3$s\" as a remote share from %1$s" : "Otrzymałeś \"%3$s\" zdalne udostępnienie od %1$s", "Allow users on this server to send shares to other servers" : "Zezwalaj użytkownikom na tym serwerze na wysłanie udostępnień do innych serwerów" }, "nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);"); /fix/uid_type Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/tests/lib/NaturalSortTest.php
blob: 50c2d0be9f0ab09a8508384421a8684db6135ee2 (plain)
1
2
3
4
5
6
7
8
9
10
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<?php
/**
 * Copyright (c) 2014 Vincent Petry <PVince81@owncloud.com>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */

namespace Test;

class NaturalSortTest extends \Test\TestCase {

	/**
	 * @dataProvider naturalSortDataProvider
	 */
	public function testNaturalSortCompare($array, $sorted)
	{
		if(!class_exists('Collator')) {
			$this->markTestSkipped('The intl module is not available, natural sorting might not work as expected.');
			return;
		}
		$comparator = \OC\NaturalSort::getInstance();
		usort($array, array($comparator, 'compare'));
		$this->assertEquals($sorted, $array);
	}

	/**
	* @dataProvider defaultCollatorDataProvider
	*/
	public function testDefaultCollatorCompare($array, $sorted)
	{
		$comparator = new \OC\NaturalSort(new \OC\NaturalSort_DefaultCollator());
		usort($array, array($comparator, 'compare'));
		$this->assertEquals($sorted, $array);
	}

	/**
	 * Data provider for natural sorting with php5-intl's Collator.
	 * Must provide the same result as in core/js/tests/specs/coreSpec.js
	 * @return array test cases
	 */
	public function naturalSortDataProvider()
	{
		return array(
			// different casing
			array(
				// unsorted
				array(
					'aaa',
					'bbb',
					'BBB',
					'AAA'
				),
				// sorted
				array(
					'aaa',
					'AAA',
					'bbb',
					'BBB'
				)
			),
			// numbers
			array(
				// unsorted
				array(
					'124.txt',
					'abc1',
					'123.txt',
					'abc',
					'abc2',
					'def (2).txt',
					'ghi 10.txt',
					'abc12',
					'def.txt',
					'def (1).txt',
					'ghi 2.txt',
					'def (10).txt',
					'abc10',
					'def (12).txt',
					'z',
					'ghi.txt',
					'za',
					'ghi 1.txt',
					'ghi 12.txt',
					'zz',
					'15.txt',
					'15b.txt',
				),
				// sorted
				array(
					'15.txt',
					'15b.txt',
					'123.txt',
					'124.txt',
					'abc',
					'abc1',
					'abc2',
					'abc10',
					'abc12',
					'def.txt',
					'def (1).txt',
					'def (2).txt',
					'def (10).txt',
					'def (12).txt',
					'ghi.txt',
					'ghi 1.txt',
					'ghi 2.txt',
					'ghi 10.txt',
					'ghi 12.txt',
					'z',
					'za',
					'zz',
				)
			),
			// chinese characters
			array(
				// unsorted
				array(
					'十.txt',
					'一.txt',
					'二.txt',
					'十 2.txt',
					'三.txt',
					'四.txt',
					'abc.txt',
					'五.txt',
					'七.txt',
					'八.txt',
					'九.txt',
					'六.txt',
					'十一.txt',
					'波.txt',
					'破.txt',
					'莫.txt',
					'啊.txt',
					'123.txt',
				),
				// sorted
				array(
					'123.txt',
					'abc.txt',
					'一.txt',
					'七.txt',
					'三.txt',
					'九.txt',
					'二.txt',
					'五.txt',
					'八.txt',
					'六.txt',
					'十.txt',
					'十 2.txt',
					'十一.txt',
					'啊.txt',
					'四.txt',
					'波.txt',
					'破.txt',
					'莫.txt',
				)
			),
			// with umlauts
			array(
				// unsorted
				array(
					'öh.txt',
					'Äh.txt',
					'oh.txt',
					'Üh 2.txt',
					'Üh.txt',
					'ah.txt',
					'Öh.txt',
					'uh.txt',
					'üh.txt',
					'äh.txt',
				),
				// sorted
				array(
					'ah.txt',
					'äh.txt',
					'Äh.txt',
					'oh.txt',
					'öh.txt',
					'Öh.txt',
					'uh.txt',
					'üh.txt',
					'Üh.txt',
					'Üh 2.txt',
				)
			),
		);
	}

	/**
	* Data provider for natural sorting with \OC\NaturalSort_DefaultCollator.
	* Must provide the same result as in core/js/tests/specs/coreSpec.js
	* @return array test cases
	*/
	public function defaultCollatorDataProvider()
	{
		return array(
			// different casing
			array(
				// unsorted
				array(
					'aaa',
					'bbb',
					'BBB',
					'AAA'
				),
				// sorted
				array(
					'aaa',
					'AAA',
					'bbb',
					'BBB'
				)
			),
			// numbers
			array(
				// unsorted
				array(
					'124.txt',
					'abc1',
					'123.txt',
					'abc',
					'abc2',
					'def (2).txt',
					'ghi 10.txt',
					'abc12',
					'def.txt',
					'def (1).txt',
					'ghi 2.txt',
					'def (10).txt',
					'abc10',
					'def (12).txt',
					'z',
					'ghi.txt',
					'za',
					'ghi 1.txt',
					'ghi 12.txt',
					'zz',
					'15.txt',
					'15b.txt',
				),
				// sorted
				array(
					'15.txt',
					'15b.txt',
					'123.txt',
					'124.txt',
					'abc',
					'abc1',
					'abc2',
					'abc10',
					'abc12',
					'def.txt',
					'def (1).txt',
					'def (2).txt',
					'def (10).txt',
					'def (12).txt',
					'ghi.txt',
					'ghi 1.txt',
					'ghi 2.txt',
					'ghi 10.txt',
					'ghi 12.txt',
					'z',
					'za',
					'zz',
				)
			),
		);
	}
}