Skip to content

Commit bce9f4e

Browse files
authored
fix: timestamp query for translation request (crowdin#56)
1 parent 32ba1c0 commit bce9f4e

File tree

3 files changed

+45
-90
lines changed

3 files changed

+45
-90
lines changed

example/pubspec.lock

Lines changed: 40 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ packages:
55
dependency: transitive
66
description:
77
name: app_links
8-
sha256: "96e677810b83707ff5e10fac11e4839daa0ea4e0123c35864c092699165eb3db"
8+
sha256: eb83c2b15b78a66db04e95132678e910fcdb8dc3a9b0aed0c138f50b2bef0dae
99
url: "https://pub.dev"
1010
source: hosted
11-
version: "6.1.1"
11+
version: "3.4.5"
1212
args:
1313
dependency: transitive
1414
description:
@@ -21,10 +21,10 @@ packages:
2121
dependency: transitive
2222
description:
2323
name: async
24-
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
24+
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
2525
url: "https://pub.dev"
2626
source: hosted
27-
version: "2.11.0"
27+
version: "2.10.0"
2828
boolean_selector:
2929
dependency: transitive
3030
description:
@@ -37,10 +37,10 @@ packages:
3737
dependency: transitive
3838
description:
3939
name: characters
40-
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
40+
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
4141
url: "https://pub.dev"
4242
source: hosted
43-
version: "1.3.0"
43+
version: "1.2.1"
4444
clock:
4545
dependency: transitive
4646
description:
@@ -53,34 +53,18 @@ packages:
5353
dependency: transitive
5454
description:
5555
name: collection
56-
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
56+
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
5757
url: "https://pub.dev"
5858
source: hosted
59-
version: "1.18.0"
59+
version: "1.17.0"
6060
connectivity_plus:
6161
dependency: transitive
6262
description:
6363
name: connectivity_plus
64-
sha256: "63b6c0cfcefc2b81f803f04ff033d614f4969ed74ac369643455d5829947908a"
64+
sha256: "224a77051d52a11fbad53dd57827594d3bd24f945af28bd70bab376d68d437f0"
6565
url: "https://pub.dev"
6666
source: hosted
67-
version: "2.1.0"
68-
connectivity_plus_linux:
69-
dependency: transitive
70-
description:
71-
name: connectivity_plus_linux
72-
sha256: "3caf859d001f10407b8e48134c761483e4495ae38094ffcca97193f6c271f5e2"
73-
url: "https://pub.dev"
74-
source: hosted
75-
version: "1.3.1"
76-
connectivity_plus_macos:
77-
dependency: transitive
78-
description:
79-
name: connectivity_plus_macos
80-
sha256: "488d2de1e47e1224ad486e501b20b088686ba1f4ee9c4420ecbc3b9824f0b920"
81-
url: "https://pub.dev"
82-
source: hosted
83-
version: "1.2.6"
67+
version: "5.0.2"
8468
connectivity_plus_platform_interface:
8569
dependency: transitive
8670
description:
@@ -89,22 +73,6 @@ packages:
8973
url: "https://pub.dev"
9074
source: hosted
9175
version: "1.2.4"
92-
connectivity_plus_web:
93-
dependency: transitive
94-
description:
95-
name: connectivity_plus_web
96-
sha256: "81332be1b4baf8898fed17bb4fdef27abb7c6fd990bf98c54fd978478adf2f1a"
97-
url: "https://pub.dev"
98-
source: hosted
99-
version: "1.2.5"
100-
connectivity_plus_windows:
101-
dependency: transitive
102-
description:
103-
name: connectivity_plus_windows
104-
sha256: "535b0404b4d5605c4dd8453d67e5d6d2ea0dd36e3b477f50f31af51b0aeab9dd"
105-
url: "https://pub.dev"
106-
source: hosted
107-
version: "1.2.2"
10876
crowdin_sdk:
10977
dependency: "direct main"
11078
description:
@@ -188,14 +156,6 @@ packages:
188156
description: flutter
189157
source: sdk
190158
version: "0.0.0"
191-
gtk:
192-
dependency: transitive
193-
description:
194-
name: gtk
195-
sha256: e8ce9ca4b1df106e4d72dad201d345ea1a036cc12c360f1a7d5a758f78ffa42c
196-
url: "https://pub.dev"
197-
source: hosted
198-
version: "2.1.0"
199159
http:
200160
dependency: transitive
201161
description:
@@ -216,18 +176,18 @@ packages:
216176
dependency: "direct main"
217177
description:
218178
name: intl
219-
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
179+
sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91"
220180
url: "https://pub.dev"
221181
source: hosted
222-
version: "0.18.1"
182+
version: "0.17.0"
223183
js:
224184
dependency: transitive
225185
description:
226186
name: js
227-
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
187+
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
228188
url: "https://pub.dev"
229189
source: hosted
230-
version: "0.6.7"
190+
version: "0.6.5"
231191
lints:
232192
dependency: transitive
233193
description:
@@ -240,26 +200,26 @@ packages:
240200
dependency: transitive
241201
description:
242202
name: matcher
243-
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
203+
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
244204
url: "https://pub.dev"
245205
source: hosted
246-
version: "0.12.16"
206+
version: "0.12.13"
247207
material_color_utilities:
248208
dependency: transitive
249209
description:
250210
name: material_color_utilities
251-
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
211+
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
252212
url: "https://pub.dev"
253213
source: hosted
254-
version: "0.5.0"
214+
version: "0.2.0"
255215
meta:
256216
dependency: transitive
257217
description:
258218
name: meta
259-
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
219+
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
260220
url: "https://pub.dev"
261221
source: hosted
262-
version: "1.10.0"
222+
version: "1.8.0"
263223
nm:
264224
dependency: transitive
265225
description:
@@ -272,18 +232,18 @@ packages:
272232
dependency: transitive
273233
description:
274234
name: oauth2
275-
sha256: c4013ef62be37744efdc0861878fd9e9285f34db1f9e331cc34100d7674feb42
235+
sha256: "1e8376c222651904caf7785fd2fa01b1e2be608c94bec842a94e116deca88f13"
276236
url: "https://pub.dev"
277237
source: hosted
278-
version: "2.0.2"
238+
version: "2.0.1"
279239
path:
280240
dependency: transitive
281241
description:
282242
name: path
283-
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
243+
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
284244
url: "https://pub.dev"
285245
source: hosted
286-
version: "1.8.3"
246+
version: "1.8.2"
287247
path_provider_linux:
288248
dependency: transitive
289249
description:
@@ -328,10 +288,10 @@ packages:
328288
dependency: transitive
329289
description:
330290
name: plugin_platform_interface
331-
sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a
291+
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
332292
url: "https://pub.dev"
333293
source: hosted
334-
version: "2.1.3"
294+
version: "2.1.6"
335295
process:
336296
dependency: transitive
337297
description:
@@ -397,26 +357,26 @@ packages:
397357
dependency: transitive
398358
description:
399359
name: source_span
400-
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
360+
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
401361
url: "https://pub.dev"
402362
source: hosted
403-
version: "1.10.0"
363+
version: "1.9.1"
404364
stack_trace:
405365
dependency: transitive
406366
description:
407367
name: stack_trace
408-
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
368+
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
409369
url: "https://pub.dev"
410370
source: hosted
411-
version: "1.11.1"
371+
version: "1.11.0"
412372
stream_channel:
413373
dependency: transitive
414374
description:
415375
name: stream_channel
416-
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
376+
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
417377
url: "https://pub.dev"
418378
source: hosted
419-
version: "2.1.2"
379+
version: "2.1.1"
420380
string_scanner:
421381
dependency: transitive
422382
description:
@@ -437,10 +397,10 @@ packages:
437397
dependency: transitive
438398
description:
439399
name: test_api
440-
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
400+
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
441401
url: "https://pub.dev"
442402
source: hosted
443-
version: "0.6.1"
403+
version: "0.4.16"
444404
typed_data:
445405
dependency: transitive
446406
description:
@@ -453,10 +413,10 @@ packages:
453413
dependency: transitive
454414
description:
455415
name: url_launcher
456-
sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27"
416+
sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3
457417
url: "https://pub.dev"
458418
source: hosted
459-
version: "6.1.14"
419+
version: "6.1.11"
460420
url_launcher_android:
461421
dependency: transitive
462422
description:
@@ -469,10 +429,10 @@ packages:
469429
dependency: transitive
470430
description:
471431
name: url_launcher_ios
472-
sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3
432+
sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a"
473433
url: "https://pub.dev"
474434
source: hosted
475-
version: "6.2.1"
435+
version: "6.2.0"
476436
url_launcher_linux:
477437
dependency: transitive
478438
description:
@@ -521,14 +481,6 @@ packages:
521481
url: "https://pub.dev"
522482
source: hosted
523483
version: "2.1.4"
524-
web:
525-
dependency: transitive
526-
description:
527-
name: web
528-
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
529-
url: "https://pub.dev"
530-
source: hosted
531-
version: "0.3.0"
532484
web_socket_channel:
533485
dependency: transitive
534486
description:
@@ -570,5 +522,5 @@ packages:
570522
source: hosted
571523
version: "3.1.1"
572524
sdks:
573-
dart: ">=3.2.0 <4.0.0"
574-
flutter: ">=3.16.0"
525+
dart: ">=2.19.0 <3.0.0"
526+
flutter: ">=3.7.0"

lib/src/crowdin.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ class Crowdin {
146146

147147
distribution = await _api.loadTranslations(
148148
path: _distributionsMap[mappedLocale.toLanguageTag()][0] as String,
149-
distributionHash: _distributionHash);
149+
distributionHash: _distributionHash,
150+
timeStamp: _timestamp.toString());
150151
if (distribution != null) {
151152
/// todo remove when distribution file locale will be fixed
152153
distribution['@@locale'] = locale.toString();

lib/src/crowdin_api.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import 'crowdin_logger.dart';
77
class CrowdinApi {
88
Future<Map<String, dynamic>?> loadTranslations({
99
required String distributionHash,
10+
required String timeStamp,
1011
String? path,
1112
}) async {
1213
try {
1314
var response = await http.get(
14-
Uri.parse('https://distributions.crowdin.net/$distributionHash$path'),
15+
Uri.https('distributions.crowdin.net', '/$distributionHash$path',
16+
{'timestamp': timeStamp}),
1517
);
1618
Map<String, dynamic> responseDecoded =
1719
jsonDecode(utf8.decode(response.bodyBytes));

0 commit comments

Comments
 (0)