1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "files": [
10 {
11 "name": "en.json",
12 "role": "source",
13 "content": "{\"cart\":{\"title\":\"Your cart\",\"items\":\"You have {count, plural, one {# item} other {# items}}\",\"checkout\":\"Checkout\"},\"greeting\":\"Hello {name}!\",\"help\":\"See https://example.com/help\",\"save\":\"Save\"}",
14 },
15 {
16 "name": "de.json",
17 "content": "{\"cart\":{\"title\":\"Dein Einkaufswagen\",\"items\":\"Sie haben {count, plural, one {# Artikel}}\",\"checkout\":\"Zur Kasse gehen und bezahlen\"},\"greeting\":\"Hallo {nom}!\",\"help\":\"Siehe https://example.com/hilfe\",\"old\":\"Alt\"}",
18 },
19 ],
20 "glossary": [
21 {
22 "source": "cart",
23 "target": "Warenkorb",
24 "locale": "de",
25 },
26 {
27 "source": "Einkaufswagen",
28 "forbidden": True,
29 "target": "Warenkorb",
30 "locale": "de",
31 },
32 ],
33 "formality": { "de": "formal" },
34}
35
36
37run = client.actor("siteverdict/siteverdict-translation-qa").call(run_input=run_input)
38
39
40print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
41for item in client.dataset(run.default_dataset_id).iterate_items():
42 print(item)
43
44