Update Zotero plugin: adjust resource paths, enhance group selection, and improve translations

This commit is contained in:
Artur
2025-11-20 10:40:45 +03:00
parent 7f23624c0d
commit b4e8db495b
15 changed files with 52 additions and 35 deletions

View File

@ -15,6 +15,7 @@
* limitations under the License.
*
*/
/// <reference path="./zotero.js" />
/// <reference path="./csl/citation/citation.js" />
/// <reference path="./csl/styles/styles-manager.js" />
@ -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));

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -39,6 +39,7 @@
"Failed to insert bibliography": "文献引用の挿入に失敗しました",
"Failed to refresh": "リフレッシュに失敗しました",
"Search in:": "検索対象:",
"All groups": "全てのグループ",
"My Library": "私のライブラリ"
"Everywhere": "全て",
"My Library": "私のライブラリ",
"Group Libraries": "グループライブラリ"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -39,6 +39,7 @@
"Failed to insert bibliography": "Не удалось вставить библиографию",
"Failed to refresh": "Не удалось обновить",
"Search in:": "Поиск в:",
"All groups": "Все группы",
"My Library": "Моя библиотека"
"Everywhere": "Везде",
"My Library": "Моя библиотека",
"Group Libraries": "Группы библиотек"
}

View File

@ -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"
}

View File

@ -39,6 +39,7 @@
"Failed to insert bibliography": "Убациње библиографије није успело",
"Failed to refresh": "Освежавање није успело",
"Search in:": "Претражите у:",
"All groups": "Све групе",
"My Library": "Моја библиотека"
"Everywhere": "Све",
"My Library": "Моја библиотека",
"Group Libraries": "Групе библиотека"
}

View File

@ -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"
}

View File

@ -39,6 +39,7 @@
"Failed to insert bibliography": "插入參考文献失敗",
"Failed to refresh": "刷新失敗",
"Search in:": "搜索:",
"All groups": "所有群組",
"My Library": "我的圖書館"
"Everywhere": "全部",
"My Library": "我的圖書館",
"Group Libraries": "群組圖書館"
}