Skip to content

Commit f7935c8

Browse files
committed
chore: update Zotero submodules
1 parent 7c01516 commit f7935c8

4 files changed

Lines changed: 54 additions & 40 deletions

File tree

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "translators/zotero"]
22
path = translators/zotero
3-
url = https://github.com/zotero/translators
3+
url = https://github.com/tobiasdiez/translators.git
44
[submodule "sources/zotero-translate"]
55
path = sources/zotero-translate
66
url = https://github.com/tobiasdiez/translate.git

scripts/import_and_patch_translators.py

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
ROOT = Path(__file__).resolve().parents[1]
1818
TARGET = ROOT / "translators" / "zotero"
1919
ZOTERO_REPO = "https://github.com/zotero/translators"
20+
ZOTERO_SUBMODULES = {
21+
"translators/zotero": "esm",
22+
"sources/zotero-translate": "async-sandbox",
23+
"sources/zotero-utilities": "fix-import",
24+
}
2025

2126
SANDBOX_PATH = "../../sources/sandbox.js"
2227
REQUIRED_SANDBOX_IMPORTS = [
@@ -57,8 +62,15 @@ def run(cmd, **kwargs):
5762

5863

5964
def ensure_repo():
60-
run(["git", "submodule", "update", "--init"])
61-
65+
for submodule, branch in ZOTERO_SUBMODULES.items():
66+
submodule_path = str(ROOT / submodule)
67+
run(["git", "-C", submodule_path, "fetch", "upstream", "master"])
68+
run(["git", "-C", submodule_path, "checkout", "master"])
69+
run(["git", "-C", submodule_path, "pull", "--ff-only", "upstream", "master"])
70+
run(["git", "-C", submodule_path, "push", "origin", "master"])
71+
run(["git", "-C", submodule_path, "checkout", branch])
72+
73+
run(["git", "submodule", "update", "--remote", "--merge"])
6274

6375
def export_translator_info(text: str) -> tuple[str, bool]:
6476
# Keep idempotent if already prefixed
@@ -313,37 +325,13 @@ def generate_manifest():
313325
except Exception as e:
314326
print("Failed to write manifest:", e)
315327

316-
317-
def delete_ignored():
318-
"""Delete files and directories that should be ignored under TARGET.
319-
Removes dot-directories and specific files like `jsconfig.json` and `AGENTS.md`.
320-
"""
321-
for p in sorted(TARGET.rglob("*")):
322-
try:
323-
if should_ignore(p):
324-
if p.is_dir():
325-
print("Removing directory", p)
326-
shutil.rmtree(p)
327-
elif p.is_file():
328-
print("Removing file", p)
329-
p.unlink()
330-
except Exception as e:
331-
print("Failed to remove", p, e)
332-
333-
334328
def main():
335329
try:
336330
ensure_repo()
337331
except Exception as e:
338332
print("Error ensuring repo:", e)
339333
sys.exit(1)
340334

341-
# Remove ignored files/directories before patching and manifest generation
342-
try:
343-
delete_ignored()
344-
except Exception as e:
345-
print("delete_ignored failed:", e)
346-
347335
patch_all()
348336
generate_manifest()
349337

translators/manifest.json

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,7 @@
20872087
"translatorType": 4,
20882088
"creator": "Abe Jellinek",
20892089
"priority": 100,
2090-
"lastUpdated": "2025-05-13 13:34:42",
2090+
"lastUpdated": "2026-01-23 15:59:51",
20912091
"minVersion": "2.1.9",
20922092
"maxVersion": ""
20932093
},
@@ -2501,7 +2501,7 @@
25012501
"translatorType": 4,
25022502
"creator": "Sebastian Karcher",
25032503
"priority": 100,
2504-
"lastUpdated": "2025-12-22 18:11:41",
2504+
"lastUpdated": "2026-03-09 16:01:06",
25052505
"minVersion": "5.0",
25062506
"maxVersion": ""
25072507
},
@@ -2967,7 +2967,7 @@
29672967
"translatorType": 4,
29682968
"creator": "Bin Liu",
29692969
"priority": 100,
2970-
"lastUpdated": "2025-10-16 16:05:06",
2970+
"lastUpdated": "2026-02-09 15:53:01",
29712971
"minVersion": "5.0",
29722972
"maxVersion": ""
29732973
},
@@ -3403,12 +3403,12 @@
34033403
"path": "translators/zotero/Google Scholar.js",
34043404
"label": "Google Scholar",
34053405
"translatorID": "57a00950-f0d1-4b41-b6ba-44ff0fc30289",
3406-
"target": "^https?://scholar[-.]google[-.](com|cat|(com?[-.])?[a-z]{2})(\\.[^/]+)?/(scholar(_case)?\\?|citations\\?)",
3406+
"target": "^https?://scholar[-.]google[-.](com|cat|(com?[-.])?[a-z]{2})(\\.[^/]+)?/(scholar(_case|_labs/search/session/\\d+)?\\?|citations\\?)",
34073407
"browserSupport": "gcsibv",
34083408
"translatorType": 4,
34093409
"creator": "Simon Kornblith, Frank Bennett, Aurimas Vinckevicius",
34103410
"priority": 100,
3411-
"lastUpdated": "2023-07-11 07:58:52",
3411+
"lastUpdated": "2025-12-11 15:26:53",
34123412
"minVersion": "3.0",
34133413
"maxVersion": ""
34143414
},
@@ -4334,6 +4334,19 @@
43344334
"minVersion": "3.0",
43354335
"maxVersion": ""
43364336
},
4337+
{
4338+
"path": "translators/zotero/KiM.js",
4339+
"label": "KiM",
4340+
"translatorID": "429936dd-ad60-4e23-b346-569c85d17e0b",
4341+
"target": "^https?://[^/]*kimnet\\.nl/document",
4342+
"browserSupport": "gcsibv",
4343+
"translatorType": 4,
4344+
"creator": "Ewout ter Hoeven",
4345+
"priority": 100,
4346+
"lastUpdated": "2026-01-02 16:28:12",
4347+
"minVersion": "5.0",
4348+
"maxVersion": ""
4349+
},
43374350
{
43384351
"path": "translators/zotero/KitapYurdu.com.js",
43394352
"label": "KitapYurdu.com",
@@ -4590,7 +4603,7 @@
45904603
"translatorType": 4,
45914604
"creator": "Tim Sherratt (tim@timsherratt.org)",
45924605
"priority": 100,
4593-
"lastUpdated": "2025-01-28 03:36:38",
4606+
"lastUpdated": "2026-03-04 06:44:20",
45944607
"minVersion": "5.0",
45954608
"maxVersion": ""
45964609
},
@@ -5575,6 +5588,19 @@
55755588
"minVersion": "3.0",
55765589
"maxVersion": ""
55775590
},
5591+
{
5592+
"path": "translators/zotero/National Archives UK Case Law.js",
5593+
"label": "National Archives UK Case Law",
5594+
"translatorID": "be076b36-b2ef-41e3-afd9-3ab9da626ff1",
5595+
"target": "^https?://caselaw\\.nationalarchives\\.gov\\.uk/",
5596+
"browserSupport": "gcsibv",
5597+
"translatorType": 4,
5598+
"creator": "Michael Veale",
5599+
"priority": 100,
5600+
"lastUpdated": "2026-02-03 19:39:24",
5601+
"minVersion": "3.0",
5602+
"maxVersion": ""
5603+
},
55785604
{
55795605
"path": "translators/zotero/National Bureau of Economic Research.js",
55805606
"label": "National Bureau of Economic Research",
@@ -6114,7 +6140,7 @@
61146140
"translatorType": 12,
61156141
"creator": "Simon Kornblith, Sebastian Karcher, Abe Jellinek",
61166142
"priority": 100,
6117-
"lastUpdated": "2025-07-09 19:22:44",
6143+
"lastUpdated": "2026-02-12 16:29:52",
61186144
"minVersion": "5.0",
61196145
"maxVersion": ""
61206146
},
@@ -6862,7 +6888,7 @@
68626888
"translatorType": 1,
68636889
"creator": "Simon Kornblith, Michael Berkowitz, Avram Lyon, and Rintze Zelle",
68646890
"priority": 100,
6865-
"lastUpdated": "2021-07-21 03:05:39",
6891+
"lastUpdated": "2026-01-22 17:48:12",
68666892
"minVersion": "2.1.9",
68676893
"maxVersion": ""
68686894
},
@@ -6978,7 +7004,7 @@
69787004
"translatorType": 1,
69797005
"creator": "Simon Kornblith",
69807006
"priority": 100,
6981-
"lastUpdated": "2025-08-06 22:48:30",
7007+
"lastUpdated": "2026-03-06 21:44:09",
69827008
"minVersion": "2.1.9",
69837009
"maxVersion": ""
69847010
},
@@ -7236,7 +7262,7 @@
72367262
"translatorType": 4,
72377263
"creator": "Sebastian Karcher",
72387264
"priority": 100,
7239-
"lastUpdated": "2023-06-09 21:19:36",
7265+
"lastUpdated": "2026-02-24 16:20:02",
72407266
"minVersion": "3.0",
72417267
"maxVersion": ""
72427268
},
@@ -8959,7 +8985,7 @@
89598985
"translatorType": 4,
89608986
"creator": "czar",
89618987
"priority": 100,
8962-
"lastUpdated": "2021-03-30 19:51:18",
8988+
"lastUpdated": "2026-01-23 16:11:56",
89638989
"minVersion": "3.0",
89648990
"maxVersion": ""
89658991
},
@@ -9153,7 +9179,7 @@
91539179
"translatorType": 2,
91549180
"creator": "Simon Kornblith",
91559181
"priority": 25,
9156-
"lastUpdated": "2021-01-25 06:49:57",
9182+
"lastUpdated": "2026-03-06 21:33:15",
91579183
"minVersion": "1.0.0b4.r1",
91589184
"maxVersion": ""
91599185
},

translators/zotero

Submodule zotero updated 754 files

0 commit comments

Comments
 (0)