diegodlh / zotero-cita

Cita: a Wikidata addon for Zotero with citations metadata support
GNU General Public License v3.0
218 stars 10 forks source link

Citations pane fails to render when language set to standard English #247

Closed chenboshuo closed 1 day ago

chenboshuo commented 1 year ago
  1. I added citations to some articles, however, these items appeared in the "Related" field, not the "Citations" field.
  2. Showing the local citation network is not working. image image

the software versions can find in https://github.com/diegodlh/zotero-cita/issues/241#issuecomment-1484028452_

Dominic-DallOsto commented 1 year ago
  1. This is working for me again now. Are you on the latest version (0.5.5)?
  2. This only works when you have 2 or more items selected (Ctrl + click to select multiple items). Does it work for you then?

On 26/03/2023 10:20 am, boshuo chen wrote:

  1. I added citations to some articles, however, these items appeared in the "Related" field, not the "Citations" field.
  2. Showing the local citation network is not working. image https://user-images.githubusercontent.com/43953268/227763647-08099b4d-9ecb-42b0-bc7a-e1da3dc3074d.png image https://user-images.githubusercontent.com/43953268/227763667-b56f93ee-bffb-400d-b3f6-844b20c099fd.png

/Originally posted by @chenboshuo https://github.com/chenboshuo in

241 (comment)

https://github.com/diegodlh/zotero-cita/issues/241#issuecomment-1484028452/

— Reply to this email directly, view it on GitHub https://github.com/diegodlh/zotero-cita/issues/247, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGM5S3DMGECPLW3PRV2RVWTW5733VANCNFSM6AAAAAAWIBEU7M. You are receiving this because you are subscribed to this thread.Message ID: @.***>

chenboshuo commented 1 year ago
  1. This is working for me again now. Are you on the latest version (0.5.5)?

Yes image

  1. This only works when you have 2 or more items selected (Ctrl + click to select multiple items). Does it work for you then?

Yes, it works , however I also don't know how to show links of items in different collections.

Thanks you for your attention.

Dominic-DallOsto commented 1 year ago

Hmm. in 1 it looks like the whole citations tab is failing to render properly. Do you see the citations note saved under the item when you add the citations?

For 2. I guess use the "my library" view to show all your items then select the ones you want. Or use a search to return just the items you're interested in, then select those. At least for me on Windows it isn't possible to Ctrl + click to highlight multiple collections at once, so we can only really show one selected collection at a time in the local citation graph.

On 27/03/2023 3:31 am, boshuo chen wrote:

 1. This is working for me again now. Are you on the latest
    version (0.5.5)?

Yes image https://user-images.githubusercontent.com/43953268/227819415-4724ce1c-f6ee-4715-a894-8baaccb4fc19.png

 2. This only works when you have 2 or more items selected (Ctrl +
    click
    to select multiple items). Does it work for you then?

Yes, it works , however I also don't know how to show links of items in different collections.

Thanks you for your attention.

— Reply to this email directly, view it on GitHub https://github.com/diegodlh/zotero-cita/issues/247#issuecomment-1484336706, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGM5S3DWFHLXIDE5NXMBKE3W6DUWBANCNFSM6AAAAAAWIBEU7M. You are receiving this because you commented.Message ID: @.***>

chenboshuo commented 1 year ago

Hmm. in 1 it looks like the whole citations tab is failing to render properly. Do you see the citations note saved under the item when you add the citations?

the citations were saved in Related tab, and show properly in the network

For 2. I guess use the "my library" view to show all your items then select the ones you want. Or use a search to return just the items you're interested in, then select those. At least for me on Windows it isn't possible to Ctrl + click to highlight multiple collections at once, so we can only really show one selected collection at a time in the local citation graph.

Yes, I get it

diegodlh commented 1 year ago

Hi, @chenboshuo! I've tried Cita v0.5.5 on Zotero 6.0.26 on Linux Mint 19.2 and I'm not being able to reproduce your problem.

I wonder whether it's because of an interaction with another addon? Could you try disabling all but Cita and see what happens?

If that doesn't solve the issue, maybe you can share a debug output log with us:

  1. Enable logging: in Zotero, go to Help > Debug Output Logging > Enable.
  2. Follow the steps to reproduce the behavior described above.
  3. Go to Help > Debug Output Logging > View Output.
  4. On the window that opens, go to File > Save to save the log. Attach this file to this bug report.
  5. Close the Debug Output window and disable logging: Help > Debug Output Logging > Disable.
marbris commented 1 year ago

@diegodlh, I'm having the same problem as @chenboshuo. I disabled all other add-ons. My log outputs the following every time I press the Citations tab:

(3)(+0005105): Viewing item in pane 6

(3)(+0000000): {Cita} Tue Apr 25 2023 16:35:51 GMT-0700 (PDT): Refreshing citations pane... (zotero-editpane-tabs)

(3)(+0000001): {Cita} Tue Apr 25 2023 16:35:51 GMT-0700 (PDT): CitationsBoxContainer will render...

(3)(+0000025): {Cita} Tue Apr 25 2023 16:35:51 GMT-0700 (PDT): Getting citations from source item took 24.461381999979494

I'm using Cita 0.5.5, Zotero 6.0.26, and Ubuntu 22.04

Just like for chenboshuo, the citations end up in the Related tab. However, adding items to the Related tab does not add them to the Citations Note.

I appreciate the help.

diegodlh commented 1 year ago

Hi, @marbris. Thanks for your feedback. So I assume both you and @chenboshuo see the "Add" button in the "Citations" pane before adding any citations to an item? Or how do you add citations?

If yes, then the citations pane content disappears after a citation is added, correct?

Could you share the content of one of the "Citations" attachment notes? You should find it as an attachment in one of the items you are having trouble with.

Thanks!

marbris commented 1 year ago

@diegodlh . There is no "Add" button in the Citations pane. I have to add citations by going to the cited item and clicking "add as citation(s) to...". When I do, an item is added to the Related Pane and a Citations Note is created. The Related pane does have an "add" button, but it doesn't add things to the Citations Note.

Citations_Pane

Related_Pane

Here's the Citation Note:

Citations

Do not edit this note manually!

[
  {
    "item": {
      "itemType": "journalArticle",
      "creators": [
        {
          "firstName": "Kevin G.",
          "lastName": "Gallagher",
          "creatorType": "author"
        },
        {
          "firstName": "Stephen E.",
          "lastName": "Trask",
          "creatorType": "author"
        },
        {
          "firstName": "Christoph",
          "lastName": "Bauer",
          "creatorType": "author"
        },
        {
          "firstName": "Thomas",
          "lastName": "Woehrle",
          "creatorType": "author"
        },
        {
          "firstName": "Simon F.",
          "lastName": "Lux",
          "creatorType": "author"
        },
        {
          "firstName": "Matthias",
          "lastName": "Tschech",
          "creatorType": "author"
        },
        {
          "firstName": "Peter",
          "lastName": "Lamp",
          "creatorType": "author"
        },
        {
          "firstName": "Bryant J.",
          "lastName": "Polzin",
          "creatorType": "author"
        },
        {
          "firstName": "Seungbum",
          "lastName": "Ha",
          "creatorType": "author"
        },
        {
          "firstName": "Brandon",
          "lastName": "Long",
          "creatorType": "author"
        },
        {
          "firstName": "Qingliu",
          "lastName": "Wu",
          "creatorType": "author"
        },
        {
          "firstName": "Wenquan",
          "lastName": "Lu",
          "creatorType": "author"
        },
        {
          "firstName": "Dennis W.",
          "lastName": "Dees",
          "creatorType": "author"
        },
        {
          "firstName": "Andrew N.",
          "lastName": "Jansen",
          "creatorType": "author"
        }
      ],
      "title": "Optimizing Areal Capacities through Understanding the Limitations of Lithium-Ion Electrodes",
      "abstractNote": "Increasing the areal capacity or electrode thickness in lithium ion batteries is one possible means to increase pack level energy density while simultaneously lowering cost. The physics that limit use of high areal capacity as a function of battery power to energy ratio are poorly understood and thus most currently produced automotive lithium ion cells utilize modest loadings to ensure long life over the vehicle battery operation. Here we show electrolyte transport limits the utilization of the positive electrode at critical C-rates during discharge; whereas, a combination of electrolyte transport and polarization lead to lithium plating in the graphite electrode during charge. Experimental measurements are compared with theoretical predictions based on concentrated solution and porous electrode theories. An analytical expression is derived to provide design criteria for long lived operation based on the physical properties of the electrode and electrolyte. Finally, a guideline is proposed that graphite cells should avoid charge current densities near or above 4 mA/cm2 unless additional precautions have been made to avoid deleterious side reaction.",
      "date": "2016-11-10",
      "url": "https://iopscience.iop.org/article/10.1149/2.0321602jes",
      "accessDate": "2021-10-04",
      "extra": "Publisher: The Electrochemical Society\nQID: Q57457262",
      "volume": "163",
      "pages": "A138-A149",
      "publicationTitle": "Journal of The Electrochemical Society",
      "DOI": "10.1149/2.0321602jes",
      "issue": "2",
      "ISSN": "0013-4651"
    },
    "ocis": [
      "010117846185-01057457262"
    ],
    "zotero": "533VATI4"
  }
]
Dominic-DallOsto commented 1 year ago

Thanks for the details. Just to check does the Citations tab look the same for every item you select? Or just this one? What about items that don't have any citations?

On 26/04/2023 5:43 pm, marbris wrote:

There is no "Add" button in the Citations pane. I have to add citations by going to the cited item and clicking "add as citation(s) to...". When I do, an item is added to the Related Pane and a Citations Note is created. The Related pane does have an "add" button, but it doesn't add things to the Citations Note.

Citations_Pane https://user-images.githubusercontent.com/81988043/234627223-26438f43-a83e-4989-b00f-4af92e54a9d3.png

Related_Pane https://user-images.githubusercontent.com/81988043/234627835-fb4ea9fd-4997-427b-93a9-6c92c40d372b.png

Here's the Citation Note:

Citations

Do not edit this note manually!

|[  {    "item": {      "itemType": "journalArticle",      "creators": [        {          "firstName": "Kevin G.",          "lastName": "Gallagher",          "creatorType": "author"        },        {          "firstName": "Stephen E.",          "lastName": "Trask",          "creatorType": "author"        },        {          "firstName": "Christoph",          "lastName": "Bauer",          "creatorType": "author"        },        {          "firstName": "Thomas",          "lastName": "Woehrle",          "creatorType": "author"        },        {          "firstName": "Simon F.",          "lastName": "Lux",          "creatorType": "author"        },        {          "firstName": "Matthias",          "lastName": "Tschech",          "creatorType": "author"        },        {          "firstName": "Peter",          "lastName": "Lamp",          "creatorType": "author"        },        {          "firstName": "Bryant J.",          "lastName": "Polzin",          "creatorType": "author"        },        {          "firstName": "Seungbum",          "lastName": "Ha",          "creatorType": "author"        },        {          "firstName": "Brandon",          "lastName": "Long",          "creatorType": "author"        },        {          "firstName": "Qingliu",          "lastName": "Wu",          "creatorType": "author"        },        {          "firstName": "Wenquan",          "lastName": "Lu",          "creatorType": "author"        },        {          "firstName": "Dennis W.",          "lastName": "Dees",          "creatorType": "author"        },        {          "firstName": "Andrew N.",          "lastName": "Jansen",          "creatorType": "author"        }      ],      "title": "Optimizing Areal Capacities through Understanding the Limitations of Lithium-Ion Electrodes",      "abstractNote": "Increasing the areal capacity or electrode thickness in lithium ion batteries is one possible means to increase pack level energy density while simultaneously lowering cost. The physics that limit use of high areal capacity as a function of battery power to energy ratio are poorly understood and thus most currently produced automotive lithium ion cells utilize modest loadings to ensure long life over the vehicle battery operation. Here we show electrolyte transport limits the utilization of the positive electrode at critical C-rates during discharge; whereas, a combination of electrolyte transport and polarization lead to lithium plating in the graphite electrode during charge. Experimental measurements are compared with theoretical predictions based on concentrated solution and porous electrode theories. An analytical expression is derived to provide design criteria for long lived operation based on the physical properties of the electrode and electrolyte. Finally, a guideline is proposed that graphite cells should avoid charge current densities near or above 4 mA/cm2 unless additional precautions have been made to avoid deleterious side reaction.",      "date": "2016-11-10",      "url": "https://iopscience.iop.org/article/10.1149/2.0321602jes",      "accessDate": "2021-10-04",      "extra": "Publisher: The Electrochemical Society\nQID: Q57457262",      "volume": "163",      "pages": "A138-A149",      "publicationTitle": "Journal of The Electrochemical Society",      "DOI": "10.1149/2.0321602jes",      "issue": "2",      "ISSN": "0013-4651"    },    "ocis": [      "010117846185-01057457262"    ],    "zotero": "533VATI4"  } ] |

— Reply to this email directly, view it on GitHub https://github.com/diegodlh/zotero-cita/issues/247#issuecomment-1523641507, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGM5S3FNLGJVQBPT3YCR2JLXDE7B5ANCNFSM6AAAAAAWIBEU7M. You are receiving this because you commented.Message ID: @.***>

marbris commented 1 year ago

@Dominic-DallOsto The tabs look the same for all items, including ones without Citations.

Dominic-DallOsto commented 1 year ago

I just checked the debugging log for my own instance of Cita and got this:

Just to check you never get the Rendering CitationsBoxContainer took line in your debug logs?

(3)(+0086376): itemTree.render(). Displaying Item Tree

(3)(+0000038): Viewing item in pane 6

(3)(+0000039): {Cita} Wed Apr 26 2023 17:55:59 GMT+0200 (W. Europe Summer Time): Refreshing citations pane... (item-tree-main-default)

(3)(+0000002): {Cita} Wed Apr 26 2023 17:55:59 GMT+0200 (W. Europe Summer Time): CitationsBoxContainer will render...

(3)(+0000015): {Cita} Wed Apr 26 2023 17:55:59 GMT+0200 (W. Europe Summer Time): Getting citations from source item took 14.787300005555153

(1)(+0000009): Localized string not available for More...

(3)(+0000021): {Cita} Wed Apr 26 2023 17:55:59 GMT+0200 (W. Europe Summer Time): Rendering CitationsBoxContainer took 45.868599995970726ms.

(4)(+0000103): Unregistering notifier observer in notifier with id 'citationsBox_Wr'

(3)(+0000003): {Cita} Wed Apr 26 2023 17:55:59 GMT+0200 (W. Europe Summer Time): First run, or props.item has changed
marbris commented 1 year ago

@Dominic-DallOsto . yes. The log ends after "Getting citations from source item took XX.X"

marbris commented 1 year ago

@Dominic-DallOsto @diegodlh . I just found the Error Console. Here's the error I get when pressing the Citations tab:

[JavaScript Error: "Error: Localized string not available for More..." {file: "chrome://zotero/content/xpcom/intl.js" line: 137}] Zotero.Intl</this.getString@chrome://zotero/content/xpcom/intl.js:137:15 this.getString@chrome://zotero/content/xpcom/zotero.js:1323:34 get text@chrome://zotero/content/components/button.js:134:340 render@chrome://zotero/content/components/button.js:137:5 finishClassComponent@chrome://cita/content/main.js:29775:22 updateClassComponent@chrome://cita/content/main.js:29725:24 beginWork@chrome://cita/content/main.js:31363:16 callCallback@chrome://cita/content/main.js:16235:9 invokeGuardedCallbackDev@chrome://cita/content/main.js:16284:7 invokeGuardedCallback@chrome://cita/content/main.js:16346:3 beginWork$1@chrome://cita/content/main.js:36249:7 performUnitOfWork@chrome://cita/content/main.js:35064:12 workLoopSync@chrome://cita/content/main.js:34992:5 renderRootSync@chrome://cita/content/main.js:34955:7 performSyncWorkOnRoot@chrome://cita/content/main.js:34578:18 ./node_modules/react-dom/cjs/react-dom.development.js/flushSyncCallbackQueueImpl/<@chrome://cita/content/main.js:23617:26 unstable_runWithPriority@chrome://cita/content/main.js:41996:12 runWithPriority$1@chrome://cita/content/main.js:23566:10 flushSyncCallbackQueueImpl@chrome://cita/content/main.js:23612:9 flushSyncCallbackQueue@chrome://cita/content/main.js:23599:3 scheduleUpdateOnFiber@chrome://cita/content/main.js:34178:9 updateContainer@chrome://cita/content/main.js:37767:3 legacyRenderSubtreeIntoContainer@chrome://cita/content/main.js:38322:5 render@chrome://cita/content/main.js:38388:10 refreshCitationsPane@chrome://cita/content/main.js:6761:9 refreshCitationsPane@chrome://cita/content/main.js:6121:3 set_selectedIndex@chrome://global/content/bindings/tabbox.xml:395:15 set_selectedItem@chrome://global/content/bindings/tabbox.xml:420:34 _selectNewTab@chrome://global/content/bindings/tabbox.xml:465:11 onxblmousedown@chrome://global/content/bindings/tabbox.xml:774:11

Dominic-DallOsto commented 1 year ago

I think the issue comes from this change here - https://github.com/diegodlh/zotero-cita/pull/242/files#diff-696fbdb6810c9001e0b8a27f808632396389131c08925b7d50cf8fbae528245d

Now we resolve the localised string (to More...), then Zotero tries to localise it again and fails. For me this doesn't cause an error though - it appears in the Debug output but not in the error console with Zotero 6.0.26 on Windows.

If I revert the change, Zotero tries to localise the string instead of Cita, which also doesn't work.

Dominic-DallOsto commented 1 year ago

I guess these might be options to fix this:

But first it would be interesting to find why this causes an error on Ubuntu and Mac but not Windows or Linux Mint...

diegodlh commented 1 year ago

But first it would be interesting to find why this causes an error on Ubuntu and Mac but not Windows or Linux Mint...

I think it may be unrelated to operative system but to Zotero language instead. I managed to reproduce the issue changing the Zotero language to standard English. It was not showing with Zotero set to Spanish. I assume you may not be using English as well, @Dominic-DallOsto?

Assuming @chenboshuo and @marbris are using Zotero in standard English, could you check if changing the language to another version of English (such as English UK) solves the problem, as a workaround until this bug is fixed?

Thanks!

drewx0r commented 1 year ago

@diegodlh I changed my Zotero language from English to English (Canada) and the plug-in started behaving as expected!

marbris commented 1 year ago

The plug-in works as expected when I change the language from English to English (Canada)

Dominic-DallOsto commented 1 day ago

Fixed in v1.0.0