My custom translators are ignored by Chrome extension

HI, I want to edit my web translators to customize the behavior.
But my changes are ignored, and I need your help.

For instance, I need to extract the abstract from this page:
http://jmlr.org/proceedings/papers/v37/zhaoa15.html

I'm a user of
- MacOSX (Yosemite)
- Zotero standalone (ver 4.0.27)
- Zotero connector for Chrome (ver 4.0.26)
- Zotfile (4.1.5.1)

In my environment, the translator that handles this URL seems to be located in

$ZOTERO_DATA/translators/Journal of Machine Learning Research.js

where $ZOTERO_DATA is my custom data location specified in
Preferences > Advanced > Data Directory Location > Custom .

As the first step, to verify if my changes are indeed reflected to the Chrome connector,
I edited like this (line 34 in the file).

//item.title = titlecontent.replace(/\s+$/, '');
item.title = 'aaaaaa' + titlecontent.replace(/\s+$/, '');

Then I restarted both Chrome and Zotero standalone.
I move to the URL, hit the button on the address bar,
and check the new entry on Zotero standalone, but nothing changed before the editing.

I doubt Zotero uses some form of cache rather than the real translator files,
and I found $ZOTERO_DATA/zotero.sqlite has a table 'translatorCache',
but it doesn't contain any code fragment.

I searched this forum and Google, but I couldn't find a solution.

Ideally, maybe I have to be a contributor of Zotero development and send pull-request,
but I prefer testing locally till I get confident about my changes,
and I can't wait till my changes are accepted by the community.

Any help would be appreciated. Thanks.
  • When you scroll over the Zotero URL bar icon while at http://jmlr.org/proceedings/papers/v37/zhaoa15.html, does it say "Journal of Machine Learning Research"? If no, then the detectWeb code or "target" RegExp are not matching the page (in the unmodified translator it's the latter) and the translation is actually done by Embedded Metadata translator.
  • Great, you are right, my bar icon saids "Embedded Metadata".
    I'll try to make the translator detect the page.
    Thank you very much for your help.
  • (FWIW, if you want to write more translators or contribute them, I'd strongly recommend also installing Firefox, Zotero for Firefox, and Scaffold: Using Scaffold makes testing translators much, much easier and also allows you to automatically add the automated tests we require for new translators).
  • Sure, I'll try it. Editing a translator is a bit more tough than I expected, so It'll be of great help. Thank you for informing me!

This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.

Sign In or Register to comment.