Browser standalone zotero translator
转到文件
WaitSpring 34a0ebe3c8 Merge pull request '`Zotero.setTimeout()` → `setTimeout()` in translator tester' (#1) from Mirror/zotero-translate:master into master
Reviewed-on: https://git.qiuwen.wiki/Fork/zotero-translate/pulls/1
2023-08-03 12:09:10 +08:00
example Update example with localized date parsing from utilities date code 2021-08-20 16:05:38 +03:00
modules Update utilities submodule 2023-04-20 04:36:49 -04:00
src Replace all uses of `loadDocuments` with HiddenBrowser and add artificial delay (#15) 2023-04-13 17:41:07 -04:00
testTranslators `Zotero.setTimeout()` → `setTimeout()` in translator tester 2023-06-01 06:07:42 -04:00
.gitmodules Fix submodule URL to use HTTPS 2021-08-04 05:09:50 -04:00
COPYING Add COPYING 2021-07-26 10:37:26 +03:00
README.md Add a note about initializing Zotero.Date to README.md 2021-08-20 16:17:28 +03:00

README.md

Zotero Translate

This repository contains the Zotero translation architecture code responsible for parsing Zotero translators and running them on live and static web pages to retrieve Zotero items.

A consumer of this repository needs to implement the following interfaces:

  • Zotero.Translators found in translators.js
  • Zotero.HTTP found in http.js
  • Zotero.Translate.ItemSaver found in translation/translate_item.js

You also need to:

  • Call Zotero.Schema.init(data) with Zotero schema.json.
  • Call Zotero.Date.init(json) with the JSON from utilities/resource/dateFormats.json
  • If running in a ModuleJS environment (e.g. Node.js) call require('../utilities/cachedTypes').setTypeSchema(typeSchema) with the result of utilities/resource/zoteroTypeSchemaData.js.

Please bundle translators and Zotero schema with the translation architecture. Do not load them from a remote server.

You may also want to reimplement or modify:

  • Zotero.Repo found in repo.js to set up periodic translator update retrieval
  • Zotero.Debug found in debug.js to customize debug logging
  • Zotero and Zotero.Prefs found in zotero.js to set up the environment and long-term preference storage
  • Zotero.Translate.ItemGetter found in translation/translate_item.js for export translation
  • Zotero.Translate.SandboxManager found in translation/sandboxManager.js for a tighter Sandbox environment if available on your the platform

Example

See example/index.html for file loading order.

To run the example:

$ git submodule update --init
$ google-chrome --disable-web-security --user-data-dir=/tmp/chromeTemvar

Open example/index.html in the CORS ignoring Google Chrome