A custom translator does not work although Scafold verifies it.
Hello,
I have made a custom web translator for Zotero using Scafold.
https://github.com/kouichi-c-nakamura/Zotero-translator-SfN-2016
Although both detectWeb and doWeb of Scafold run successfully, the same translator does not detect relevant web pages and Zotero icon on browser toolbar stays in the default data type (Web page) rather than the specified data type (Conference Article), and I'm wondering why. Restarting both Zotero and the browser didn't help.
Any suggestions?
Best,
Kouichi
I have made a custom web translator for Zotero using Scafold.
https://github.com/kouichi-c-nakamura/Zotero-translator-SfN-2016
Although both detectWeb and doWeb of Scafold run successfully, the same translator does not detect relevant web pages and Zotero icon on browser toolbar stays in the default data type (Web page) rather than the specified data type (Conference Article), and I'm wondering why. Restarting both Zotero and the browser didn't help.
Any suggestions?
Best,
Kouichi
Look at Z.monitorDOMChanges to address this (unfortunately not well documented I think, but there are a number of examples in existing translators)
@dstillman
You're right. "Test regex" button actually resulted in "false", and I found an obvious error and fixed it. Now the toolbar icon is "Conference Paper" as expected, even before the page is loaded properly.
@adamsmith
I noticed the slow loading of the pages, too. Even `"defer": true` did not work for tests.
Thanks for Z.monitorDOMChanges:
https://github.com/zuphilip/translators/wiki/Useful-functions#monitor-dom-changes
===
Now, the import is working, but I'm facing another issue.
In case of https://www.abstractsonline.com/pp8/#!/4376/presentation/30154, I use the poster number for Pages field; "282.18/B8" is expected to appear in the Pages field of the imported Zotero item.
When I ran
Zotero.debug(item.pages);
it showed "282.18/B8" properly in the Scaffold.
Also, `Returned item:` output shows `"pages": "282.18/B8"` in Scaffold.
However, the Pages field of imported Zotero item is empty. This does not make sense to me. Do you have any suggestions?
Because other fields seem to be fine, this is probably not due to the slow loading of the page.
Thanks in advance.
Best,
Kouichi
That said, the correct item type for presentations/posters in Zotero is "presentation" not "conferencePaper", which is intended for papers published in conference proceedings.
Can you elaborate more about debugging? I want to pin down why the information about Pages is lost during import.
Did you mean Help > Debug Output Logging > Enable?
(To get a new version of the translator to the Connector, you have to save to Zotero in Scaffold and then update or reset translators in the Connector preferences.)
For example, in the case of https://www.abstractsonline.com/pp8/#!/4376/presentation/30154, the poster has the number "282.18 / B8", that is associated.
The number "282.18" is used for citation in papers, whereas "B8" is the ID for the poster board.
So, currently, when I cite it, it appears as
Yakoubi R, Rollenhagen A, Lübke J, Lehe M von, Miller D, Walkenfort B, Hasenberg M, Sätzler K (2019) Ultrastructural heterogeneity of human layer 4 excitatory synaptic boutons in the adult temporal lobe neocortex. In: Society for Neuroscience Abstract, pp 037.01/B74
In fact, "pp" should be removed. But this has to be done by editing CSL and that can cause another issue.
Also, maybe "B74" should be removed as well. But the is the best compromise I've come up with so far.
https://gist.github.com/kouichi-c-nakamura/869cfeb8c286e8b9bb88fdff1fd0f8f1
a) make sure you're running the right version of the translator and
b) understand what's not working with the current version.
Anyway, I changed a regular expression, and the problem has been solved for now,