From b4e8db495b06bc98898def8a0fc6b2b604cbfbde Mon Sep 17 00:00:00 2001 From: Artur Date: Thu, 20 Nov 2025 10:40:45 +0300 Subject: [PATCH] Update Zotero plugin: adjust resource paths, enhance group selection, and improve translations --- sdkjs-plugins/content/zotero/scripts/code.js | 17 ++++++++++------- .../content/zotero/translations/cs-CS.json | 5 +++-- .../content/zotero/translations/de-DE.json | 5 +++-- .../content/zotero/translations/es-ES.json | 5 +++-- .../content/zotero/translations/fr-FR.json | 5 +++-- .../content/zotero/translations/it-IT.json | 5 +++-- .../content/zotero/translations/ja-JA.json | 5 +++-- .../content/zotero/translations/nl-NL.json | 5 +++-- .../content/zotero/translations/pt-BR.json | 5 +++-- .../content/zotero/translations/pt-PT.json | 5 +++-- .../content/zotero/translations/ru-RU.json | 5 +++-- .../content/zotero/translations/sq-AL.json | 5 +++-- .../content/zotero/translations/sr-Cyrl-RS.json | 5 +++-- .../content/zotero/translations/sr-Latn-RS.json | 5 +++-- .../content/zotero/translations/zh-ZH.json | 5 +++-- 15 files changed, 52 insertions(+), 35 deletions(-) diff --git a/sdkjs-plugins/content/zotero/scripts/code.js b/sdkjs-plugins/content/zotero/scripts/code.js index be2adea3..62b49257 100644 --- a/sdkjs-plugins/content/zotero/scripts/code.js +++ b/sdkjs-plugins/content/zotero/scripts/code.js @@ -15,6 +15,7 @@ * limitations under the License. * */ + /// /// /// @@ -244,9 +245,11 @@ function loadGroups() { sdk.getUserGroups().then(function (groups) { groups = [ - {id: "all", name: getMessage("All groups")}, - {id: "my_library", name: getMessage("My Library")} + {id: "all", name: getMessage("Everywhere")}, + {id: "my_library", name: getMessage("My Library")}, + {id: "group_libraries", name: getMessage("Group Libraries")} ].concat(groups); + for (var i = 0; i < groups.length; i++) { var id = groups[i].id; var name = groups[i].name; @@ -254,7 +257,7 @@ el.setAttribute("data-value", id); el.textContent = name; elements.searchLibrary.appendChild(el); - if (id === "my_library") { + if (id === "all") { el.setAttribute("selected", ""); library.value = name; library.setAttribute("data-value", id); @@ -284,14 +287,14 @@ } /** - * @return {number|"all"|"my_library"} + * @return {number|"all"|"my_library"|"group_libraries"} */ getSelectedGroup = function () { for (var i = 0; i < elements.searchLibrary.children.length; i++) { const option = elements.searchLibrary.children[i]; if (option.hasAttribute("selected")) { const id = option.getAttribute("data-value"); - if (id == "my_library" || id == "all") return id; + if (["my_library", "group_libraries", "all"].indexOf(id) >= 0) return id; return Number(id); } } @@ -414,6 +417,7 @@ groups = []; break; case "all": + case "group_libraries": groups = userGroups.map(function (group) { return group.id; }); @@ -426,8 +430,7 @@ const append = true; let showLoader = true; let hideLoader = !groups.length; - let isGroup = false; - const bCount = true + const bCount = true; if (selectedGroup === "my_library" || selectedGroup === "all") { promises.push(loadLibrary(sdk.getItems(text), append, showLoader, hideLoader, false, bCount)); diff --git a/sdkjs-plugins/content/zotero/translations/cs-CS.json b/sdkjs-plugins/content/zotero/translations/cs-CS.json index b00a42d7..338c1f73 100644 --- a/sdkjs-plugins/content/zotero/translations/cs-CS.json +++ b/sdkjs-plugins/content/zotero/translations/cs-CS.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Nepodarilo se vložit bibliografii", "Failed to refresh": "Nepodarilo se aktualizovat", "Search in:": "Vyhledat v:", - "All groups": "Vsechny skupiny", - "My Library": "Moje knihovna" + "Everywhere": "Vезде", + "My Library": "Moje knihovna", + "Group Libraries": "Skupinové knihovny" } diff --git a/sdkjs-plugins/content/zotero/translations/de-DE.json b/sdkjs-plugins/content/zotero/translations/de-DE.json index bb3e52e2..42a97f57 100644 --- a/sdkjs-plugins/content/zotero/translations/de-DE.json +++ b/sdkjs-plugins/content/zotero/translations/de-DE.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Fehler beim Einfügen der Bibliographie", "Failed to refresh": "Fehler beim Aktualisieren", "Search in:": "Suche in:", - "All groups": "Alle Gruppen", - "My Library": "Meine Bibliothek" + "Everywhere": "Alle", + "My Library": "Meine Bibliothek", + "Group Libraries": "Gruppenbibliotheken" } diff --git a/sdkjs-plugins/content/zotero/translations/es-ES.json b/sdkjs-plugins/content/zotero/translations/es-ES.json index 285ff2cb..65c820a2 100644 --- a/sdkjs-plugins/content/zotero/translations/es-ES.json +++ b/sdkjs-plugins/content/zotero/translations/es-ES.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Fallo al insertar la bibliografía", "Failed to refresh": "Fallo al actualizar", "Search in:": "Buscar en:", - "All groups": "Todos los grupos", - "My Library": "Mi biblioteca" + "Everywhere": "Todo", + "My Library": "Mi biblioteca", + "Group Libraries": "Bibliotecas de grupos" } diff --git a/sdkjs-plugins/content/zotero/translations/fr-FR.json b/sdkjs-plugins/content/zotero/translations/fr-FR.json index 3604ac6a..be8c3f2a 100644 --- a/sdkjs-plugins/content/zotero/translations/fr-FR.json +++ b/sdkjs-plugins/content/zotero/translations/fr-FR.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Échec de l'insertion de la bibliographie", "Failed to refresh": "Échec de la mise à jour", "Search in:": "Rechercher dans:", - "All groups": "Tous les groupes", - "My Library": "Ma bibliothèque" + "Everywhere": "Partout", + "My Library": "Ma bibliothèque", + "Group Libraries": "Bibliothèques de groupes" } diff --git a/sdkjs-plugins/content/zotero/translations/it-IT.json b/sdkjs-plugins/content/zotero/translations/it-IT.json index 1a9c8306..ea221dbc 100644 --- a/sdkjs-plugins/content/zotero/translations/it-IT.json +++ b/sdkjs-plugins/content/zotero/translations/it-IT.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Impossibile inserire la bibliografia", "Failed to refresh": "Impossibile aggiornare", "Search in:": "Cerca in:", - "All groups": "Tutti i gruppi", - "My Library": "La mia biblioteca" + "Everywhere": "Tutto", + "My Library": "La mia biblioteca", + "Group Libraries": "Biblioteca dei gruppi" } diff --git a/sdkjs-plugins/content/zotero/translations/ja-JA.json b/sdkjs-plugins/content/zotero/translations/ja-JA.json index 8ddbee8f..ecfc138b 100644 --- a/sdkjs-plugins/content/zotero/translations/ja-JA.json +++ b/sdkjs-plugins/content/zotero/translations/ja-JA.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "文献引用の挿入に失敗しました", "Failed to refresh": "リフレッシュに失敗しました", "Search in:": "検索対象:", - "All groups": "全てのグループ", - "My Library": "私のライブラリ" + "Everywhere": "全て", + "My Library": "私のライブラリ", + "Group Libraries": "グループライブラリ" } diff --git a/sdkjs-plugins/content/zotero/translations/nl-NL.json b/sdkjs-plugins/content/zotero/translations/nl-NL.json index 3c3b3e61..c39ea9c3 100644 --- a/sdkjs-plugins/content/zotero/translations/nl-NL.json +++ b/sdkjs-plugins/content/zotero/translations/nl-NL.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Het invoegen van de bibliografie is mislukt", "Failed to refresh": "Het vernieuwen is mislukt", "Search in:": "Zoeken in:", - "All groups": "Alle groepen", - "My Library": "Mijn bibliotheek" + "Everywhere": "Elke plaats", + "My Library": "Mijn bibliotheek", + "Group Libraries": "Groepsbibliotheek" } diff --git a/sdkjs-plugins/content/zotero/translations/pt-BR.json b/sdkjs-plugins/content/zotero/translations/pt-BR.json index b66312f0..cfd4b606 100644 --- a/sdkjs-plugins/content/zotero/translations/pt-BR.json +++ b/sdkjs-plugins/content/zotero/translations/pt-BR.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Falha ao inserir bibliografia", "Failed to refresh": "Falha ao atualizar", "Search in:": "Procurar em:", - "All groups": "Todos os grupos", - "My Library": "A minha biblioteca" + "Everywhere": "Todos os lugares", + "My Library": "A minha biblioteca", + "Group Libraries": "Grupos de bibliotecas" } diff --git a/sdkjs-plugins/content/zotero/translations/pt-PT.json b/sdkjs-plugins/content/zotero/translations/pt-PT.json index 34420395..afdb7fee 100644 --- a/sdkjs-plugins/content/zotero/translations/pt-PT.json +++ b/sdkjs-plugins/content/zotero/translations/pt-PT.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Falha ao inserir bibliografia", "Failed to refresh": "Falha ao actualizar", "Search in:": "Procurar em:", - "All groups": "Todos os grupos", - "My Library": "A minha biblioteca" + "Everywhere": "Todos os lugares", + "My Library": "A minha biblioteca", + "Group Libraries": "Grupos de bibliotecas" } diff --git a/sdkjs-plugins/content/zotero/translations/ru-RU.json b/sdkjs-plugins/content/zotero/translations/ru-RU.json index cdc69764..295ee852 100644 --- a/sdkjs-plugins/content/zotero/translations/ru-RU.json +++ b/sdkjs-plugins/content/zotero/translations/ru-RU.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Не удалось вставить библиографию", "Failed to refresh": "Не удалось обновить", "Search in:": "Поиск в:", - "All groups": "Все группы", - "My Library": "Моя библиотека" + "Everywhere": "Везде", + "My Library": "Моя библиотека", + "Group Libraries": "Группы библиотек" } diff --git a/sdkjs-plugins/content/zotero/translations/sq-AL.json b/sdkjs-plugins/content/zotero/translations/sq-AL.json index 784f7d23..5da80e9e 100644 --- a/sdkjs-plugins/content/zotero/translations/sq-AL.json +++ b/sdkjs-plugins/content/zotero/translations/sq-AL.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Zbatimi i bibliografise dështoi", "Failed to refresh": "Rifreskimi dështoi", "Search in:": "Kerkoni sipas:", - "All groups": "Te gjitha grupat", - "My Library": "Kutia mija" + "Everywhere": "Gjithashtu", + "My Library": "Kutia mija", + "Group Libraries": "Kutia e grupave" } diff --git a/sdkjs-plugins/content/zotero/translations/sr-Cyrl-RS.json b/sdkjs-plugins/content/zotero/translations/sr-Cyrl-RS.json index b6b36354..a4468937 100644 --- a/sdkjs-plugins/content/zotero/translations/sr-Cyrl-RS.json +++ b/sdkjs-plugins/content/zotero/translations/sr-Cyrl-RS.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Убациње библиографије није успело", "Failed to refresh": "Освежавање није успело", "Search in:": "Претражите у:", - "All groups": "Све групе", - "My Library": "Моја библиотека" + "Everywhere": "Све", + "My Library": "Моја библиотека", + "Group Libraries": "Групе библиотека" } diff --git a/sdkjs-plugins/content/zotero/translations/sr-Latn-RS.json b/sdkjs-plugins/content/zotero/translations/sr-Latn-RS.json index 0205bb9b..601a10a0 100644 --- a/sdkjs-plugins/content/zotero/translations/sr-Latn-RS.json +++ b/sdkjs-plugins/content/zotero/translations/sr-Latn-RS.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "Neuspelo ubacivanje bibliografije", "Failed to refresh": "Neuspelo osvežavanje", "Search in:": "Pretražite u:", - "All groups": "Sve grupe", - "My Library": "Moja biblioteka" + "Everywhere": "Sve", + "My Library": "Moja biblioteka", + "Group Libraries": "Grupe biblioteka" } diff --git a/sdkjs-plugins/content/zotero/translations/zh-ZH.json b/sdkjs-plugins/content/zotero/translations/zh-ZH.json index 3d9b0ac0..694f7625 100644 --- a/sdkjs-plugins/content/zotero/translations/zh-ZH.json +++ b/sdkjs-plugins/content/zotero/translations/zh-ZH.json @@ -39,6 +39,7 @@ "Failed to insert bibliography": "插入參考文献失敗", "Failed to refresh": "刷新失敗", "Search in:": "搜索:", - "All groups": "所有群組", - "My Library": "我的圖書館" + "Everywhere": "全部", + "My Library": "我的圖書館", + "Group Libraries": "群組圖書館" }