How do I get my new translator into Zotero standalone?

I just made a small change to a translator. I used Scaffold in Firefox which works nicely. Saved the new translator there (with a higher priority and a slightly changed name) and it is now available in Firefox.

However I do not use Firefox now. I use Chrome + Zotero standalone. How do I get the translator over there?
  • if Standalone and Zotero for Firefox share a data directory, all you need to do is restart Zotero and Chrome. If they don't, you need to copy the translator over from the translator directory of the Firefox version to that of the Standalone version.
  • Many thanks, adamsmith!

    I tried to find that information on the pages about web translators, but I did not. Is it just me, or? ;-)
  • Not sure which of the two you're referring to, but no, it's not explicitly discussed, but generally speaking, developer documentation is at a higher level of abstraction and assumes more on the part of the reader. We can hardly keep up with regular user documentation.
  • edited March 22, 2014
    I understand it is hard with the documentation, but every time something is not working the documentation becomes important. It becomes a test of the documentation so to say (and that might be valuable ;-) ).

    I can't get it to work here now. In another post I told that the data directory in Firefox had been reset to the default. (I guess some update went bad.)

    I changed it back in Firefox to the one I am using. And readded my web translator - which is just the Readability translator with some small changes. The translator works as expected in Firefox (both using Standalone and the plugin version), but in Chrome I get the old translator.

    I set the new translator priority to 99. The old has priority 100. Since it works in Firefox that should not be the problem... ;-)

    I have restarted both browsers and Zotero standalone. And I am a bit confused at the moment.
  • And I emptied the cache and deleted site cookies.
  • did you change the translator ID? Beyond that, your best bet is to look at the debug log in Chrome to figure out what's happening.
    Obviously this isn't a general issue, I've done this many times.
  • Yes, I changed the ID.

    Comparing the code in the "translators/" directory I see one difference beside my changes:

    "browserSupport": "gcsibv",

    The "v" is lacking in my version. I have no idea why and I have no idea at the moment what it stands for.

    Can I just change the code of my version (with my editor), or?
  • that doesn't matter. It stands for server, which is irrelevant for a custom translator.

    Can't tell you why this isn't working - not a general issue, obviously. You can try what happens if you move the old translator out of the directory, you can try restarting the computer.
  • It looks like a bug in cache handling to me.

    I am not sure I can reproduce it, but this is what I have seen so far.

    - The problem above persisted after rebooting my PC. (Windows 7 pro)

    - When i moved the old Readability.js out of the translators directory got my version was choosen (as expected).

    - When I moved the old version back to the translators directory my version was still choosen (which is kind of correct since it has lower priority).

    - Restarting both Chrome and Zotero standalone did not change this, i. e. my translator was still choosen.

    Any suggestions?
  • It's working now, though, no? Not sure I'd bother trying to figure this out. If you're really motivated you can see if you can replicate this reliably and then it might be worth a closer look, but if there was a general problem, no new translators would ever work for you (since update translators doesn't do anything but write new translators to the translator directory).

    Generally, I'd suggest using the term "bug" a little less liberally - it has a specific meaning and applying it to every situation where something isn't working for you is going to rub people the wrong way.
  • Oh, I am quite used to bugs. Maybe especially subtle bugs that is a bit hard to notice. I usually do not care about the more easily found bugs since other people can report them. (On a lighter side I once reported so many bugs of that sort to one of the worlds largest IT companies. I was just tired of taking care of the mess they created. The IT company replied by trying to get my employer to stop me from reporting. Until everything crashed as I told it would. My employer was a quite large company and the crash was a bit serious. I heard no more complaints from the IT company.)
  • I am not sure I can find the problem that easily here since it looks like a caching bug and I do not know how that works in the Firefox software. (I notice some people reporting problem there, but I have never looked into those problems.)
  • _if_ there is a caching problem, it would be in Chrome, not Firefox.
    Frankly, it's a lot more likely that you did something odd - (I just tried this and it works as expected) - since otherwise, as I say above, new translators in Chrome wouldn't update more generally.
    What you describe is exactly what would happen, though, with two translators with the same translatorID, so I still think it's that's the most likely thing that happened.
  • Whether I did something wrong is not important. Please see what I saw today after rebooting:

    First my translator was not selected. Moving the old one out and restarting Chrome and Zotero made it select my translator. After moving the old back and restarting Chrome and Zotero my translator was still selected.

    Yes, Chrome might be involved, of course, but as I said I emptied both the cache and site cookies there. I just do not know if Zotero standalone might do some caching. (I suppose it is written using the framework from Firefox, or?)

    I do a lot of mistakes. It is kind of a habit ;-) (since I do a lot of things), but I can't explain what I saw above with my mistakes.

    You have a good point when you say that the problems I have seen does not generally occur. Perhaps the problem has to do with my switching between Chrome and Firefox? If you are more used to developing translators than I am you probably do not do that switching to Firefox+Scaffold.
  • As I said - I just tested this (create duplicate of translator with lower priority in Scaffold, restart Chrome and Zotero) and it works.
    Please post both of your translators to gist.github.com
  • Many thanks. I just posted the version I had the trouble with here:

    https://gist.github.com/lborgman/9711515

    (It is not ready. I just installed Readability and is exploring it.)
  • Hm, now it happened again. It selects the old translator.

    All I did was closing Zotero Standalone and opened Firefox+Scaffold. Opened my new version of the translator there. Run a test on a new site where it did not work.

    Closed Firefox+Scaffold. Restarted Chrome and started Zotero Standalone.

    I will test again to see if I can make it reproducible, but I do not have time right now.
  • edited March 22, 2014
    Looks indeed like a caching problem, but in Chrome. I switched to another page, clicked the Readability button. My new translator was selected.

    Switched back to the first page where old translator was selected (after restarting, see above). Reloaded the page and clicked the Readability button. Now my new translator was selected.

    Note: The pages were on different tabs in Chrome.

    Wonder what happens. I use the Clear Cache plugin in Chrome to emtpy cache. It can clear a lot more things, but I have just selected "Cache" - since I do not understand what most of the other options are for.

    There are "App cache", "Cache", "Cookies", "Downloads", "File Systems", "Form Data", "History", "Indexed DB", "Local Storage", "Plugin Data", "Passwords", and "WebSQL". Maybe those are involved? But how is Firefox+Scaffold involved then.

    I will keep an eye on this. Some more info is welcome if anyone knows or have a good guess.
  • BTW updated the gist to the one I am using now. I have good hope this one will work and will use it for a while to see.
Sign In or Register to comment.