Browser standalone zotero translator
Go to file
Abe Jellinek c9bbad0e68 Translator tester: Add _cookieSandbox setter, pass to HiddenBrowser 2024-03-26 14:19:21 -04: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 request(): Make headers lowercase 2024-03-25 13:05:02 -04:00
testTranslators Translator tester: Add _cookieSandbox setter, pass to HiddenBrowser 2024-03-26 14:19:21 -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