LRC-LIB-KEYWORDS: the Keywording panel's Enter Keywords view edits keywords as text

The Keywording box gets an Enter Keywords view (keywordView:enter) next to
Keywords, & Containing and Will Export. It shows the selected photos'
keywords as text, with commas between them and an asterisk after a keyword
only some of the photos have. Return or leaving the box applies the edit to
the photos selected when it began, as one photo.setMeta call and one undo
step: a keyword left out comes off every one of them, a name typed goes to
all of them, a marked keyword stays on the photos that have it, and without
its asterisk it goes to all of them. Esc gives the edit up, and so does
another selection. An asterisk after any other name is refused, and the
text is kept. Containing keywords and synonyms stay out of the text.

How mixed keywords are handled and when an edit applies are LightCraft's
own rules; the help pages describe the view without saying either.
This commit is contained in:
dotCooCoo
2026-10-31 02:57:16 -07:00
parent c4fd54e0a6
commit 70b620b85e
39 changed files with 400 additions and 13 deletions
+1
View File
@@ -114,6 +114,7 @@
"New Folder in “{name}”": "Nová složka v „{name}“",
"Created folder “{name}” in “{parent}”": "Vytvořena složka „{name}“ v „{parent}“",
"On {have} of {of} selected photos": "Na {have} z {of} vybraných fotografií",
"A keyword name can't end with an asterisk: “{name}”": "Název klíčového slova nemůže končit hvězdičkou: „{name}“",
"Painting “{k}”: click photos to add or remove it · Esc stops": "Nanášení „{k}“: kliknutím na fotografie přidáte nebo odeberete slovo · Esc ukončí režim",
"Paste into {n} photo{} — only settings that were copied are pasted": "Vložit do fotografií: {n}{:.0} — vloží se pouze zkopírovaná nastavení",
"Preset: {name}": "Přednastavení: {name}",
+3
View File
@@ -5,6 +5,9 @@
" · in a burst": " · v sérii",
"% of all commits": "% všech commitů",
"& Containing": "& Obsahující",
"Enter Keywords": "Zadat klíčová slova",
"Keywords, separated by commas": "Klíčová slova oddělená čárkami",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Klávesou Return úpravu použijete na vybrané fotografie, klávesou Esc ji zrušíte. Hvězdička označuje klíčové slovo, které má jen část z nich.",
"+ Group": "+ Skupina",
"+ Rule": "+ Pravidlo",
", picked": ", vybráno",
+1
View File
@@ -232,6 +232,7 @@
"Added “{keyword}” to {n} photo{}": "„{keyword}“ zu {n} Foto{} hinzugefügt",
"Add Keyword “{keywords}”": "Stichwort „{keywords}“ hinzufügen",
"On {have} of {of} selected photos": "Bei {have} von {of} ausgewählten Fotos",
"A keyword name can't end with an asterisk: “{name}”": "Ein Stichwortname darf nicht mit einem Sternchen enden: „{name}“",
"Remove “{name}”": "„{name}“ entfernen",
"There is a keyword set “{name}” already": "Es gibt bereits einen Stichwortsatz „{name}“",
"Added {n} keyword{}": "Stichwörter hinzugefügt: {n}{:.0}",
+3
View File
@@ -2059,6 +2059,9 @@
"Will Export": "Wird exportiert",
"No keywords are exported": "Es werden keine Stichwörter exportiert",
"& Containing": "& Übergeordnete",
"Enter Keywords": "Stichwörter eingeben",
"Keywords, separated by commas": "Stichwörter, durch Kommas getrennt",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Die Eingabetaste wendet die Änderung auf die ausgewählten Fotos an, Esc verwirft sie. Ein Sternchen kennzeichnet ein Stichwort, das nur einige von ihnen haben.",
"Edit Set…": "Satz bearbeiten…",
"Edit Keyword Set": "Stichwortsatz bearbeiten",
"Edit Keywords": "Stichwörter bearbeiten",
+1
View File
@@ -233,6 +233,7 @@
"Added “{keyword}” to {n} photo{}": "Se añadió “{keyword}” a {n} foto{}",
"Add Keyword “{keywords}”": "Añadir palabra clave “{keywords}”",
"On {have} of {of} selected photos": "En {have} de {of} fotos seleccionadas",
"A keyword name can't end with an asterisk: “{name}”": "El nombre de una palabra clave no puede terminar en asterisco: «{name}»",
"Remove “{name}”": "Quitar “{name}”",
"There is a keyword set “{name}” already": "Ya hay un conjunto de palabras clave “{name}”",
"Added {n} keyword{}": "Palabras clave añadidas: {n}{:.0}",
+3
View File
@@ -2088,6 +2088,9 @@
"Will Export": "Se exportará",
"No keywords are exported": "No se exporta ninguna palabra clave",
"& Containing": "y contenedoras",
"Enter Keywords": "Introducir palabras clave",
"Keywords, separated by commas": "Palabras clave separadas por comas",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Intro aplica el cambio a las fotos seleccionadas; Esc lo descarta. Un asterisco marca una palabra clave que solo tienen algunas de ellas.",
"Edit Set…": "Editar conjunto…",
"Edit Keyword Set": "Editar conjunto de palabras clave",
"Edit Keywords": "Editar palabras clave",
+1
View File
@@ -140,6 +140,7 @@
"New Folder in “{name}”": "Uusi kansio kohteessa ”{name}”",
"Created folder “{name}” in “{parent}”": "Kansio ”{name}” luotu kohteeseen ”{parent}”",
"On {have} of {of} selected photos": "{have} / {of} valitulla kuvalla",
"A keyword name can't end with an asterisk: “{name}”": "Avainsanan nimi ei voi päättyä tähteen: ”{name}”",
"Painting “{k}”: click photos to add or remove it · Esc stops": "Maalataan ”{k}”: napsauta kuvia lisätäksesi tai poistaaksesi sen · Esc lopettaa",
"Paste into {n} photo{} — only settings that were copied are pasted": "Liitä kuviin: {n}{:.0} — vain kopioidut asetukset liitetään",
"Preset: {name}": "Esiasetus: {name}",
+3
View File
@@ -5,6 +5,9 @@
" · in a burst": " · osa sarjaa",
"% of all commits": "% kaikista commiteista",
"& Containing": "& sisältää",
"Enter Keywords": "Kirjoita avainsanat",
"Keywords, separated by commas": "Avainsanat pilkuilla erotettuina",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Return tekee muutoksen valituille kuville, Esc peruu sen. Tähti merkitsee avainsanaa, joka on vain osalla niistä.",
"(not in the library)": "(ei kirjastossa)",
"+ Group": "+ Ryhmä",
"+ Rule": "+ Sääntö",
+1
View File
@@ -233,6 +233,7 @@
"Added “{keyword}” to {n} photo{}": "« {keyword} » ajouté à {n} photo{}",
"Add Keyword “{keywords}”": "Ajouter le mot-clé « {keywords} »",
"On {have} of {of} selected photos": "Sur {have} des {of} photos sélectionnées",
"A keyword name can't end with an asterisk: “{name}”": "Un nom de mot-clé ne peut pas se terminer par un astérisque : « {name} »",
"Remove “{name}”": "Retirer « {name} »",
"There is a keyword set “{name}” already": "Un jeu de mots-clés « {name} » existe déjà",
"Added {n} keyword{}": "Mots-clés ajoutés : {n}{:.0}",
+3
View File
@@ -1895,6 +1895,9 @@
"Will Export": "Sera exporté",
"No keywords are exported": "Aucun mot-clé n'est exporté",
"& Containing": "et parents",
"Enter Keywords": "Saisir des mots-clés",
"Keywords, separated by commas": "Mots-clés séparés par des virgules",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Entrée applique la modification aux photos sélectionnées, Échap l'annule. Un astérisque marque un mot-clé que seules certaines d'entre elles ont.",
"Edit Set…": "Modifier le jeu…",
"Edit Keyword Set": "Modifier le jeu de mots-clés",
"Edit Keywords": "Modifier les mots-clés",
+1
View File
@@ -236,6 +236,7 @@
"Added “{keyword}” to {n} photo{}": "“{keyword}” ditambahkan ke {n} foto{:.0}",
"Add Keyword “{keywords}”": "Tambahkan kata kunci “{keywords}”",
"On {have} of {of} selected photos": "Pada {have} dari {of} foto yang dipilih",
"A keyword name can't end with an asterisk: “{name}”": "Nama kata kunci tidak boleh diakhiri tanda bintang: “{name}”",
"Remove “{name}”": "Hapus “{name}”",
"There is a keyword set “{name}” already": "Set kata kunci “{name}” sudah ada",
"Added {n} keyword{}": "{n} kata kunci ditambahkan{:.0}",
+3
View File
@@ -6,6 +6,9 @@
"#106): a DNG is checked against the raw data, written to a temp file, synced and read back before it gets its": "#106): DNG dicocokkan dengan data raw, ditulis ke file sementara, disinkronkan, lalu dibaca ulang sebelum diberi",
"% of all commits": "% dari semua commit",
"& Containing": "& kata kunci induk",
"Enter Keywords": "Masukkan kata kunci",
"Keywords, separated by commas": "Kata kunci, dipisahkan dengan koma",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Tekan Return untuk menerapkan perubahan ke foto yang dipilih, Esc untuk membatalkannya. Tanda bintang menandai kata kunci yang hanya dimiliki sebagian foto.",
"(not in the library)": "(tidak ada di pustaka)",
"+ Group": "+ Grup",
"+ Rule": "+ Aturan",
+1
View File
@@ -229,6 +229,7 @@
"Added “{keyword}” to {n} photo{}": "Aggiunta “{keyword}” a {n} foto{:.0}",
"Add Keyword “{keywords}”": "Aggiungi parola chiave “{keywords}”",
"On {have} of {of} selected photos": "Su {have} di {of} foto selezionate",
"A keyword name can't end with an asterisk: “{name}”": "Il nome di una parola chiave non può terminare con un asterisco: “{name}”",
"Remove “{name}”": "Rimuovi “{name}”",
"There is a keyword set “{name}” already": "Esiste già un set di parole chiave “{name}”",
"Added {n} keyword{}": "Parole chiave aggiunte: {n}{:.0}",
+3
View File
@@ -2014,6 +2014,9 @@
"Will Export": "Verrà esportata",
"No keywords are exported": "Nessuna parola chiave viene esportata",
"& Containing": "e contenenti",
"Enter Keywords": "Inserisci parole chiave",
"Keywords, separated by commas": "Parole chiave separate da virgole",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Invio applica la modifica alle foto selezionate, Esc la annulla. Un asterisco indica una parola chiave che hanno solo alcune di esse.",
"Edit Set…": "Modifica set…",
"Edit Keyword Set": "Modifica set di parole chiave",
"Edit Keywords": "Modifica parole chiave",
+1
View File
@@ -237,6 +237,7 @@
"Added “{keyword}” to {n} photo{}": "写真{n}枚に「{keyword}」を追加しました{:.0}",
"Add Keyword “{keywords}”": "キーワード「{keywords}」を追加",
"On {have} of {of} selected photos": "選択した写真{of}枚のうち{have}枚",
"A keyword name can't end with an asterisk: “{name}”": "キーワード名の末尾にアスタリスクは使えません:「{name}」",
"Remove “{name}”": "「{name}」を削除",
"There is a keyword set “{name}” already": "キーワードセット「{name}」はすでにあります",
"Added {n} keyword{}": "{n}件のキーワードを追加しました{:.0}",
+3
View File
@@ -1908,6 +1908,9 @@
"Will Export": "書き出されるキーワード",
"No keywords are exported": "書き出されるキーワードはありません",
"& Containing": "と親キーワード",
"Enter Keywords": "キーワードを入力",
"Keywords, separated by commas": "キーワード (カンマ区切り)",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Return キーで選択した写真に変更を適用し、Esc キーで取り消します。アスタリスクは一部の写真だけにあるキーワードを示します。",
"Edit Set…": "セットを編集…",
"Edit Keyword Set": "キーワードセットを編集",
"Edit Keywords": "キーワードを編集",
+1
View File
@@ -115,6 +115,7 @@
"New Folder in “{name}”": "ახალი საქაღალდე „{name}“-ში",
"Created folder “{name}” in “{parent}”": "საქაღალდე „{name}“ შეიქმნა „{parent}“-ში",
"On {have} of {of} selected photos": "{of} მონიშნული ფოტოდან {have}-ზე",
"A keyword name can't end with an asterisk: “{name}”": "საკვანძო სიტყვის სახელი ვარსკვლავით ვერ დასრულდება: „{name}“",
"Painting “{k}”: click photos to add or remove it · Esc stops": "„{k}“-ის მინიჭება: დაწკაპეთ ფოტოებზე მის დასამატებლად ან მოსახსნელად · Esc ასრულებს",
"Paste into {n} photo{} — only settings that were copied are pasted": "ჩასმა ფოტოებში: {n}{:.0} — ჩაისმება მხოლოდ კოპირებული პარამეტრები",
"Preset: {name}": "პრესეტი: {name}",
+3
View File
@@ -11,6 +11,9 @@
"#106): a DNG is checked against the raw data, written to a temp file, synced and read back before it gets its": "#106): DNG მოწმდება RAW მონაცემებთან, იწერება დროებით ფაილში, სინქრონიზდება და ხელახლა იკითხება, სანამ მიიღებს",
"% of all commits": "ყველა კომიტის %",
"& Containing": "და შემცველი",
"Enter Keywords": "საკვანძო სიტყვების შეყვანა",
"Keywords, separated by commas": "საკვანძო სიტყვები, მძიმეებით გამოყოფილი",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Return ცვლილებას მონიშნულ ფოტოებს ანიჭებს, Esc კი აუქმებს. ვარსკვლავი აღნიშნავს საკვანძო სიტყვას, რომელიც მხოლოდ ზოგიერთ მათგანს აქვს.",
"(\"Failed to associate portal window with parent window\" in the portal's log): tiling compositors put it beside the": "(„Failed to associate portal window with parent window“ პორტალის ჟურნალში): ფილისებრი კომპოზიტორები მას",
"(Esc keeps the old angle; a decimal comma works too), or click the Straighten value; hovering any slider's value now says it can be typed.": "(Esc ძველ კუთხეს ტოვებს; ათწილადი მძიმეც მუშაობს), ან დაწკაპეთ გასწორების მნიშვნელობაზე; ნებისმიერი სლაიდერის მნიშვნელობაზე მიტანისას ახლა ჩანს, რომ მისი აკრეფა შეიძლება.",
"(Space, G, X, ⌫) and ⌘ shortcuts were not affected.": "(Space, G, X, ⌫) და ⌘ მალსახმობებზე ეს გავლენას არ ახდენდა.",
+1
View File
@@ -220,6 +220,7 @@
"Added “{keyword}” to {n} photo{}": "Dodano „{keyword}” do zdjęć: {n}{:.0}",
"Add Keyword “{keywords}”": "Dodaj słowo kluczowe „{keywords}”",
"On {have} of {of} selected photos": "Na {have} z {of} zaznaczonych zdjęć",
"A keyword name can't end with an asterisk: “{name}”": "Nazwa słowa kluczowego nie może kończyć się gwiazdką: „{name}”",
"Remove “{name}”": "Usuń „{name}”",
"There is a keyword set “{name}” already": "Istnieje już zestaw słów kluczowych „{name}”",
"Added {n} keyword{}": "Dodane słowa kluczowe: {n}{:.0}",
+3
View File
@@ -1847,6 +1847,9 @@
"Will Export": "Zostanie wyeksportowane",
"No keywords are exported": "Nie zostaną wyeksportowane żadne słowa kluczowe",
"& Containing": "i nadrzędne",
"Enter Keywords": "Wprowadź słowa kluczowe",
"Keywords, separated by commas": "Słowa kluczowe oddzielone przecinkami",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Return stosuje zmianę do zaznaczonych zdjęć, Esc ją odrzuca. Gwiazdka oznacza słowo kluczowe, które ma tylko część z nich.",
"Edit Set…": "Edytuj zestaw…",
"Edit Keyword Set": "Edytuj zestaw słów kluczowych",
"Edit Keywords": "Edytuj słowa kluczowe",
@@ -237,6 +237,7 @@
"Added “{keyword}” to {n} photo{}": "“{keyword}” adicionada a {n} foto{}",
"Add Keyword “{keywords}”": "Adicionar palavra-chave “{keywords}”",
"On {have} of {of} selected photos": "Em {have} de {of} fotos selecionadas",
"A keyword name can't end with an asterisk: “{name}”": "O nome de uma palavra-chave não pode terminar com asterisco: “{name}”",
"Remove “{name}”": "Remover “{name}”",
"There is a keyword set “{name}” already": "Já existe um conjunto de palavras-chave “{name}”",
"Added {n} keyword{}": "Palavras-chave adicionadas: {n}{:.0}",
+3
View File
@@ -1906,6 +1906,9 @@
"Will Export": "Será exportado",
"No keywords are exported": "Nenhuma palavra-chave é exportada",
"& Containing": "e as que as contêm",
"Enter Keywords": "Inserir palavras-chave",
"Keywords, separated by commas": "Palavras-chave separadas por vírgulas",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Enter aplica a alteração às fotos selecionadas; Esc a descarta. Um asterisco marca uma palavra-chave que só algumas delas têm.",
"Edit Set…": "Editar conjunto…",
"Edit Keyword Set": "Editar conjunto de palavras-chave",
"Edit Keywords": "Editar palavras-chave",
+1
View File
@@ -233,6 +233,7 @@
"Added “{keyword}” to {n} photo{}": "«{keyword}» добавлено к фото ({n}){:.0}",
"Add Keyword “{keywords}”": "Добавить ключевое слово «{keywords}»",
"On {have} of {of} selected photos": "На {have} из {of} выбранных фото",
"A keyword name can't end with an asterisk: “{name}”": "Имя ключевого слова не может заканчиваться звёздочкой: «{name}»",
"Remove “{name}”": "Убрать «{name}»",
"There is a keyword set “{name}” already": "Набор ключевых слов «{name}» уже есть",
"Added {n} keyword{}": "Добавлено ключевых слов: {n}{:.0}",
+3
View File
@@ -1832,6 +1832,9 @@
"Will Export": "Будет экспортировано",
"No keywords are exported": "Ключевые слова не экспортируются",
"& Containing": "и родительские",
"Enter Keywords": "Ввод ключевых слов",
"Keywords, separated by commas": "Ключевые слова через запятую",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Клавиша Enter применяет изменение к выбранным фото, Esc отменяет его. Звёздочка отмечает ключевое слово, которое есть только у некоторых из них.",
"Edit Set…": "Изменить набор…",
"Edit Keyword Set": "Изменить набор ключевых слов",
"Edit Keywords": "Изменить ключевые слова",
+1
View File
@@ -136,6 +136,7 @@
"none (CPU rendering): {why}": "ingen (CPU-rendering): {why}",
"not added to Apple Photos: {e}": "inte tillagt i Apple Photos: {e}",
"On {have} of {of} selected photos": "På {have} av {of} markerade foton",
"A keyword name can't end with an asterisk: “{name}”": "Ett nyckelordsnamn kan inte sluta med en asterisk: ”{name}”",
"Painting “{k}”: click photos to add or remove it · Esc stops": "Målar ”{k}”: klicka på foton för att lägga till eller ta bort det · Esc avslutar",
"Paste into {n} photo{} — only settings that were copied are pasted": "Klistra in i {n} foto{} – endast inställningar som kopierades klistras in",
"Preset: {name}": "Förinställning: {name}",
+3
View File
@@ -7,6 +7,9 @@
"#106): a DNG is checked against the raw data, written to a temp file, synced and read back before it gets its": "#106): en DNG kontrolleras mot rådata, skrivs till en temporär fil, synkas och läses tillbaka innan den får sitt",
"% of all commits": "% av alla commits",
"& Containing": "& innehåller",
"Enter Keywords": "Ange nyckelord",
"Keywords, separated by commas": "Nyckelord, åtskilda med kommatecken",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Retur tillämpar ändringen på de markerade fotona, Esc ångrar den. En asterisk markerar ett nyckelord som bara några av dem har.",
"(`gpuReason`, `gpuFallback`), Help ▸ System Info and Settings ▸ Performance say why the GPU isn't": "(`gpuReason`, `gpuFallback`), Hjälp → Systeminfo och Inställningar → Prestanda anger varför GPU:n inte",
"(e.g. D750, D780, D850, D7500, Z 50) no longer render nearly black or with crushed shadows: their black level was": "(t.ex. D750, D780, D850, D7500, Z 50) renderas inte längre nästan svarta eller med klippta skuggor: deras svartnivå var",
"(issue #94): an HTTP request from a web page can no longer carry a command in its body. Lines are capped at": "(ärende #94): en HTTP-begäran från en webbsida kan inte längre bära ett kommando i sin brödtext. Rader begränsas till",
+1
View File
@@ -233,6 +233,7 @@
"Added “{keyword}” to {n} photo{}": "«{keyword}» додано до фото: {n}{:.0}",
"Add Keyword “{keywords}”": "Додати ключове слово «{keywords}»",
"On {have} of {of} selected photos": "На {have} з {of} вибраних фото",
"A keyword name can't end with an asterisk: “{name}”": "Назва ключового слова не може закінчуватися зірочкою: «{name}»",
"Remove “{name}”": "Вилучити «{name}»",
"There is a keyword set “{name}” already": "Набір ключових слів «{name}» уже існує",
"Added {n} keyword{}": "Додано ключових слів: {n}{:.0}",
+3
View File
@@ -2090,6 +2090,9 @@
"Will Export": "Буде експортовано",
"No keywords are exported": "Ключові слова не експортуються",
"& Containing": "і батьківські",
"Enter Keywords": "Введення ключових слів",
"Keywords, separated by commas": "Ключові слова через кому",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Клавіша Enter застосовує зміну до вибраних фото, Esc скасовує її. Зірочка позначає ключове слово, яке є лише в деяких із них.",
"Edit Set…": "Редагувати набір…",
"Edit Keyword Set": "Редагувати набір ключових слів",
"Edit Keywords": "Редагувати ключові слова",
+1
View File
@@ -140,6 +140,7 @@
"New Folder in “{name}”": "Thư mục mới trong «{name}»",
"Created folder “{name}” in “{parent}”": "Đã tạo thư mục «{name}» trong «{parent}»",
"On {have} of {of} selected photos": "Trên {have} / {of} ảnh đã chọn",
"A keyword name can't end with an asterisk: “{name}”": "Tên từ khóa không thể kết thúc bằng dấu sao: «{name}»",
"Painting “{k}”: click photos to add or remove it · Esc stops": "Gán «{k}»: nhấp ảnh để thêm hoặc gỡ · Esc dừng",
"Paste into {n} photo{} — only settings that were copied are pasted": "Dán vào {n} ảnh{:.0} — chỉ dán các thiết lập đã sao chép",
"Preset: {name}": "Thiết lập sẵn: {name}",
+3
View File
@@ -7,6 +7,9 @@
"#106): a DNG is checked against the raw data, written to a temp file, synced and read back before it gets its": "#106): một DNG được đối chiếu với dữ liệu raw, ghi vào tệp tạm, đồng bộ và đọc lại trước khi nhận",
"% of all commits": "% tất cả commit",
"& Containing": "& Chứa",
"Enter Keywords": "Nhập từ khóa",
"Keywords, separated by commas": "Từ khóa, cách nhau bằng dấu phẩy",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Nhấn Return để áp dụng thay đổi cho các ảnh đã chọn, Esc để bỏ. Dấu sao đánh dấu từ khóa chỉ một số ảnh có.",
"(`gpuReason`, `gpuFallback`), Help ▸ System Info and Settings ▸ Performance say why the GPU isn't": "(`gpuReason`, `gpuFallback`), Trợ giúp → Thông tin hệ thống và Cài đặt → Hiệu năng giải thích vì sao GPU không",
"(e.g. D750, D780, D850, D7500, Z 50) no longer render nearly black or with crushed shadows: their black level was": "(ví dụ D750, D780, D850, D7500, Z 50) không còn hiển thị gần như đen hoặc vùng tối bị nén: mức đen của chúng đã được",
"(issue #94): an HTTP request from a web page can no longer carry a command in its body. Lines are capped at": "(issue #94): yêu cầu HTTP từ trang web không còn mang lệnh trong phần thân. Số dòng được giới hạn ở",
@@ -237,6 +237,7 @@
"Added “{keyword}” to {n} photo{}": "已将“{keyword}”添加到 {n} 张照片{:.0}",
"Add Keyword “{keywords}”": "添加关键字“{keywords}”",
"On {have} of {of} selected photos": "所选 {of} 张照片中的 {have} 张",
"A keyword name can't end with an asterisk: “{name}”": "关键字名称不能以星号结尾:“{name}”",
"Remove “{name}”": "移除“{name}”",
"There is a keyword set “{name}” already": "已有关键字集“{name}”",
"Added {n} keyword{}": "已添加 {n} 个关键字{:.0}",
+3
View File
@@ -1900,6 +1900,9 @@
"Will Export": "将导出",
"No keywords are exported": "没有要导出的关键字",
"& Containing": "及上级",
"Enter Keywords": "输入关键字",
"Keywords, separated by commas": "关键字,用逗号分隔",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "按回车键将修改应用到所选照片,按 Esc 键放弃。星号表示只有部分照片带有的关键字。",
"Edit Set…": "编辑关键字集…",
"Edit Keyword Set": "编辑关键字集",
"Edit Keywords": "编辑关键字",
@@ -237,6 +237,7 @@
"Added “{keyword}” to {n} photo{}": "已將「{keyword}」加入 {n} 張照片{:.0}",
"Add Keyword “{keywords}”": "加入關鍵字「{keywords}」",
"On {have} of {of} selected photos": "選取的 {of} 張照片中的 {have} 張",
"A keyword name can't end with an asterisk: “{name}”": "關鍵字名稱不能以星號結尾:「{name}」",
"Remove “{name}”": "移除「{name}」",
"There is a keyword set “{name}” already": "已有關鍵字集「{name}」",
"Added {n} keyword{}": "已加入 {n} 個關鍵字{:.0}",
+3
View File
@@ -1906,6 +1906,9 @@
"Will Export": "將匯出",
"No keywords are exported": "沒有要匯出的關鍵字",
"& Containing": "及上層",
"Enter Keywords": "輸入關鍵字",
"Keywords, separated by commas": "關鍵字,以逗號分隔",
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "按 Return 鍵將修改套用到選取的照片,按 Esc 鍵放棄。星號表示只有部分照片帶有的關鍵字。",
"Edit Set…": "編輯關鍵字集…",
"Edit Keyword Set": "編輯關鍵字集",
"Edit Keywords": "編輯關鍵字",
+133 -5
View File
@@ -9,14 +9,17 @@ use crate::LightcraftApp;
use crate::theme::Tokens;
use crate::widgets::register;
/// The Keywording box's view: the keywords (chips), them with the keywords containing them, or
/// what exported files will carry.
/// The Keywording box's view: the keywords as text (Enter Keywords), the keywords (chips), them
/// with the keywords containing them, or what exported files will carry.
pub fn view_switch(app: &mut LightcraftApp, ui: &mut egui::Ui) {
use crate::state::KeywordingView as V;
ui.horizontal_wrapped(|ui| {
for (view, id, label) in
[(V::Keywords, "keywords", "Keywords"), (V::Containing, "containing", "& Containing"), (V::WillExport, "willExport", "Will Export")]
{
for (view, id, label) in [
(V::Enter, "enter", "Enter Keywords"),
(V::Keywords, "keywords", "Keywords"),
(V::Containing, "containing", "& Containing"),
(V::WillExport, "willExport", "Will Export"),
] {
let r = ui.selectable_label(app.ui.keywording_view == view, crate::i18n::tr(label));
register(ui, format!("keywordView:{id}"), r.rect);
if r.clicked() {
@@ -708,6 +711,62 @@ pub(crate) fn chips(catalog: &Catalog, photos: &[PhotoId]) -> Vec<Chip> {
have.into_values().map(|(k, n)| Chip { path: catalog.listed_path(&k).map(str::to_string).unwrap_or(k), have: n, of: photos.len() }).collect()
}
/// The Enter Keywords text of the selection's keywords `chips`: each keyword's path, with commas
/// between them and an asterisk after a keyword only some of the selected photos have.
pub(crate) fn entered_text(chips: &[Chip]) -> String {
chips.iter().map(|c| if c.on_all() { c.path.clone() } else { format!("{}*", c.path) }).collect::<Vec<_>>().join(", ")
}
/// What an edit of the Enter Keywords text gives to and takes off the selected photos.
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub(crate) struct Entered {
/// Keywords for every selected photo.
pub add: Vec<String>,
/// Keywords taken off every selected photo.
pub remove: Vec<String>,
}
impl Entered {
/// The edit changes no photo.
pub fn is_empty(&self) -> bool {
self.add.is_empty() && self.remove.is_empty()
}
}
/// Reads the Enter Keywords `text` against `start`, the selection's keywords when the edit began.
/// Keywords are separated by commas or new lines. A keyword of `start` left out of the text is
/// taken off every selected photo. A name without an asterisk goes to every selected photo (a
/// keyword of `start` keeps its spelling, and a new name goes where `Catalog::typed_keyword` puts
/// it). A keyword only some photos have, still marked with its asterisk, stays on those photos
/// only. An asterisk after any other name is refused: the error is the name as typed.
pub(crate) fn entered(catalog: &Catalog, start: &[Chip], text: &str) -> Result<Entered, String> {
use lightcraft_catalog::keywords::{clean, same};
let mut kept: Vec<String> = Vec::new();
let mut add: Vec<String> = Vec::new();
for token in text.split([',', '\n']).map(str::trim).filter(|t| !t.is_empty()) {
if let Some(marked) = token.strip_suffix('*') {
let name = clean(marked);
let partial = start.iter().find(|c| !c.on_all() && same(&c.path, &name)).ok_or_else(|| token.to_string())?;
kept.push(partial.path.clone());
continue;
}
let typed = clean(token);
let (name, on_all) = match start.iter().find(|c| same(&c.path, &typed)) {
Some(c) => (c.path.clone(), c.on_all()),
None => (catalog.typed_keyword(token), false),
};
if name.is_empty() {
continue;
}
if !on_all && !add.iter().any(|a| same(a, &name)) {
add.push(name.clone());
}
kept.push(name);
}
let remove = start.iter().filter(|c| !kept.iter().any(|k| same(k, &c.path))).map(|c| c.path.clone()).collect();
Ok(Entered { add, remove })
}
#[cfg(test)]
mod tests {
use lightcraft_catalog::{Op, Photo, Source};
@@ -1007,4 +1066,73 @@ mod tests {
let (c, ids) = library(&[&["travel|Italy|Rome", "travel|Spain"], &["travel|Italy"]]);
assert_eq!(shown(&with_containing(&c, &ids)), [("Italy", 2, 2), ("Rome", 1, 2), ("Spain", 1, 2), ("travel", 2, 2)]);
}
fn edit(add: &[&str], remove: &[&str]) -> Entered {
Entered { add: add.iter().map(|s| s.to_string()).collect(), remove: remove.iter().map(|s| s.to_string()).collect() }
}
/// The Enter Keywords text is the selection's keywords with their paths, commas between them, and
/// an asterisk after one only some of the selected photos have; left as it is, it changes nothing.
#[test]
fn the_entered_text_is_the_selections_keywords() {
let (c, ids) = library(&[&["Places|Lisbon", "beach"], &["beach"]]);
let start = chips(&c, &ids);
let text = entered_text(&start);
assert_eq!(text, "beach, Places|Lisbon*");
assert_eq!(entered(&c, &start, &text), Ok(Entered::default()));
assert_eq!(entered(&c, &start, " beach ,\nPlaces | Lisbon * "), Ok(Entered::default()), "spaces and new lines");
assert_eq!(entered(&c, &start, "BEACH, places|lisbon*"), Ok(Entered::default()), "another case is the same keyword");
assert_eq!(entered_text(&[]), "");
}
/// A keyword left out of the text is taken off every selected photo; a name typed goes to every
/// one of them; a partial keyword without its asterisk goes to all of them.
#[test]
fn an_edit_adds_and_removes_for_every_selected_photo() {
let (c, ids) = library(&[&["Places|Lisbon", "beach"], &["beach", "sea"]]);
let start = chips(&c, &ids);
assert_eq!(entered(&c, &start, "Places|Lisbon*, sea*"), Ok(edit(&[], &["beach"])));
assert_eq!(entered(&c, &start, "beach, Places|Lisbon*, sea*, harbour, Places|Porto"), Ok(edit(&["harbour", "Places|Porto"], &[])));
assert_eq!(entered(&c, &start, "beach, Places|Lisbon, sea*"), Ok(edit(&["Places|Lisbon"], &[])), "made common");
assert_eq!(entered(&c, &start, "beach, harbour, HARBOUR"), Ok(edit(&["harbour"], &["Places|Lisbon", "sea"])), "named once");
assert_eq!(entered(&c, &start, ""), Ok(edit(&[], &["beach", "Places|Lisbon", "sea"])), "an empty box clears them");
assert_eq!(entered(&c, &start, " , | ,"), Ok(edit(&[], &["beach", "Places|Lisbon", "sea"])), "nothing but separators");
}
/// Containing keywords and synonyms are not part of the text: they stay derived, and an edit
/// never assigns them.
#[test]
fn containing_keywords_and_synonyms_stay_out_of_the_text() {
use lightcraft_catalog::keywords::KeywordInfo;
let (mut c, ids) = library(&[&["Places|Lisbon"]]);
c.apply(Op::SetKeyword {
path: "Places|Lisbon".into(),
info: Some(KeywordInfo { synonyms: vec!["Lisboa".into()], ..KeywordInfo::default() }),
})
.unwrap();
let start = chips(&c, &ids);
assert_eq!(entered_text(&start), "Places|Lisbon");
assert_eq!(entered(&c, &start, &entered_text(&start)), Ok(Entered::default()));
}
/// An asterisk marks a keyword only some photos have; after any other name it is refused, and the
/// error names what was typed.
#[test]
fn an_asterisk_after_another_name_is_refused() {
let (c, ids) = library(&[&["beach", "sea"], &["beach"]]);
let start = chips(&c, &ids);
assert_eq!(entered(&c, &start, "beach*, sea*"), Err("beach*".to_string()), "every photo has beach");
assert_eq!(entered(&c, &start, "beach, sea*, harbour*"), Err("harbour*".to_string()), "a new name");
assert_eq!(entered(&c, &start, "beach, *"), Err("*".to_string()));
}
/// A new name goes inside the default parent, as one typed in the Add keyword box does.
#[test]
fn a_new_name_goes_inside_the_default_parent() {
use lightcraft_catalog::keywords::KeywordInfo;
let (mut c, ids) = library(&[&["beach"]]);
c.apply(Op::SetKeyword { path: "Inbox".into(), info: Some(KeywordInfo { new_keywords_inside: true, ..KeywordInfo::default() }) }).unwrap();
let start = chips(&c, &ids);
assert_eq!(entered(&c, &start, "beach, harbour"), Ok(edit(&["Inbox|harbour"], &[])));
}
}
+100 -5
View File
@@ -138,10 +138,10 @@ fn keywording(app: &mut LightcraftApp, ui: &mut egui::Ui) {
crate::panels::keywording::view_switch(app, ui);
ui.add_space(4.0);
crate::panels::keywording::scope(app, ui, &selection);
if app.ui.keywording_view == crate::state::KeywordingView::Keywords {
crate::panels::keywording::chip_row(app, ui, &selection);
} else {
crate::panels::keywording::names_row(app, ui);
match app.ui.keywording_view {
crate::state::KeywordingView::Enter => enter_keywords(app, ui, &selection),
crate::state::KeywordingView::Keywords => crate::panels::keywording::chip_row(app, ui, &selection),
_ => crate::panels::keywording::names_row(app, ui),
}
ui.add_space(10.0);
keyword_set(app, ui);
@@ -198,6 +198,101 @@ fn keywording(app: &mut LightcraftApp, ui: &mut egui::Ui) {
});
}
/// An edit of the Enter Keywords box: its text, and the selection it was started on.
#[derive(Clone)]
struct EnterEdit {
text: String,
/// The selection's keywords when the edit started.
start: Vec<crate::panels::keywording::Chip>,
/// The photos the edit is for (`photo.setMeta` `ids`).
ids: Vec<u64>,
/// The selection the edit was started on (`key_of`).
selection: u64,
/// The last try to apply it was refused: the text stays to be put right.
refused: bool,
}
impl EnterEdit {
fn new(chips: &[crate::panels::keywording::Chip], selection: &[PhotoId], key: u64) -> Self {
let mut seen = std::collections::HashSet::new();
EnterEdit {
text: crate::panels::keywording::entered_text(chips),
start: chips.to_vec(),
ids: selection.iter().filter(|id| seen.insert(**id)).map(|id| id.0).collect(),
selection: key,
refused: false,
}
}
}
/// Enter Keywords: the selection's keywords as text, separated by commas, one only some of the
/// photos have marked with an asterisk. Return or leaving the box applies the edit to the photos
/// selected when it started, as one undo step; Esc gives it up. Another selection while the box is
/// being edited gives the edit up too. A refused edit keeps its text and says why.
fn enter_keywords(app: &mut LightcraftApp, ui: &mut egui::Ui, selection: &[PhotoId]) {
const FIELD: &str = "field:enterKeywords";
let id = egui::Id::unique("kw-enter");
let key = crate::key_of(selection);
let chips = app.caches.keyword_chips(&app.session.catalog, selection);
let fid = crate::text_field::id(FIELD);
let focused = ui.memory(|m| m.has_focus(fid));
let kept: Option<EnterEdit> = ui.data(|d| d.get_temp(id));
// (an edit of another selection is given up, never applied to this one)
if kept.as_ref().is_some_and(|e| e.selection != key) && focused {
ui.memory_mut(|m| m.surrender_focus(fid));
}
let mut edit = kept.filter(|e| e.selection == key).unwrap_or_else(|| EnterEdit::new(&chips, selection, key));
// Return applies the edit (Shift+Return or a pasted line break separates keywords as a comma does)
let returned = focused
&& ui.input_mut(|i| {
let plain =
|e: &egui::Event| matches!(e, egui::Event::Key { key: egui::Key::Enter, pressed: true, modifiers, .. } if modifiers.is_none());
let found = i.events.iter().any(plain);
i.events.retain(|e| !plain(e));
found
});
let r = crate::text_field::TextField::multiline(FIELD, &mut edit.text)
.hint(crate::i18n::tr("Keywords, separated by commas"))
.label(crate::i18n::tr("Enter Keywords"))
.rows(2)
.width(f32::INFINITY)
.show(ui);
r.response.clone().on_hover_text(crate::i18n::tr(
"Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.",
));
if r.cancelled() {
ui.data_mut(|d| d.remove::<EnterEdit>(id));
return;
}
let mut done = false;
if returned || r.committed() {
let applied = match crate::panels::keywording::entered(&app.session.catalog, &edit.start, &edit.text) {
Ok(change) if change.is_empty() => true,
Ok(change) => match app.run("photo.setMeta", json!({"ids": edit.ids, "addKeywords": change.add, "removeKeywords": change.remove})) {
Ok(_) => true,
Err(e) => {
app.toast_error(ui.ctx(), e);
false
}
},
Err(name) => {
app.toast_error(ui.ctx(), crate::i18n::tr_format!("A keyword name can't end with an asterisk: “{name}”", name = name));
false
}
};
edit.refused = !applied;
done = applied;
if applied && returned {
ui.memory_mut(|m| m.surrender_focus(fid));
}
}
if !done && (r.editing || returned || edit.refused) {
ui.data_mut(|d| d.insert_temp(id, edit));
} else {
ui.data_mut(|d| d.remove::<EnterEdit>(id));
}
}
/// Keeps the Keyword List where it is on screen when the Keywords box above it (starting at
/// `top`) grows or shrinks: a keyword ticked or unticked in the list, another selection. Without it
/// a long tree slides away from under the pointer by a row of chips each time. It holds only while
@@ -218,7 +313,7 @@ fn hold_list_in_place(ui: &mut egui::Ui, top: f32) {
// (only the part of it in sight: the pointer on the top bar above a half-hidden box isn't on it)
let old_box = Rect::from_x_y_ranges(ui.max_rect().x_range(), top..=top + before).intersect(ui.clip_rect());
let on_box = ui.input(|i| i.pointer.latest_pos()).is_some_and(|p| old_box.contains(p));
let typing = ui.memory(|m| m.has_focus(crate::text_field::id("field:keyword")));
let typing = ui.memory(|m| ["field:keyword", "field:enterKeywords"].iter().any(|f| m.has_focus(crate::text_field::id(f))));
if on_box || typing {
return;
}
+4 -2
View File
@@ -367,11 +367,13 @@ pub const RIGHT_WIDTH: PanelWidth = PanelWidth { min: 250.0, default: 270.0, max
/// The photo area the side panels always leave free (as far as their minimum widths allow).
pub const MIN_PHOTO_WIDTH: f32 = 360.0;
/// What the Keywording box shows: the keywords (chips to edit), them with the keywords containing
/// them, or what exported files will carry (read only).
/// What the Keywording box shows: the keywords as text to edit (Enter Keywords), the keywords
/// (chips to edit), them with the keywords containing them, or what exported files will carry
/// (read only).
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum KeywordingView {
Enter,
#[default]
Keywords,
Containing,
+94
View File
@@ -949,3 +949,97 @@ fn open_dialogs_count_once_per_library_change() {
}
assert_eq!(h.app.caches.dialog_count_scans, before + 3, "another dialog counts its own photos, once");
}
/// Enter Keywords, with everything in its box replaced by `text`.
fn enter(h: &mut Headless, text: &str) {
ask(h, "ui.clickWidget", json!({"id": "keywordView:enter"}));
ask(h, "ui.clickWidget", json!({"id": "field:enterKeywords"}));
ask(h, "ui.key", json!({"key": "A", "cmd": true}));
ask(h, "ui.key", json!({"key": "Backspace"}));
if !text.is_empty() {
ask(h, "ui.text", json!({"text": text}));
}
}
fn enter_focused(h: &Headless) -> bool {
h.view.ctx.memory(|m| m.has_focus(crate::text_field::id("field:enterKeywords")))
}
/// Given two selected photos, when Enter Keywords is chosen, then the box shows their keywords as
/// text in place of the chips; Return applies an edit to both photos as one undo step, and gives up
/// the cursor.
#[test]
fn enter_keywords_edits_the_selections_keywords_as_text() {
let (mut h, ids) = two_selected();
ask(&mut h, "ui.clickWidget", json!({"id": "keywordView:enter"}));
assert!(has(&h, "field:enterKeywords") && !has(&h, "keywordChip:beach"), "the text gives the chips way");
enter(&mut h, "beach, Weddings*, harbour");
ask(&mut h, "ui.key", json!({"key": "Enter"}));
assert_eq!(keywords_of(&h, ids[0]), ["beach", "Weddings", "harbour"]);
assert_eq!(keywords_of(&h, ids[1]), ["beach", "harbour"], "Weddings stays on the photo that had it");
assert!(!enter_focused(&h), "Return gave up the cursor");
ask(&mut h, "engine.execute", json!({"command": "edit.undo", "params": {}}));
assert_eq!(keywords_of(&h, ids[0]), ["beach", "Weddings"], "one undo takes the edit back");
assert_eq!(keywords_of(&h, ids[1]), ["beach"]);
ask(&mut h, "ui.clickWidget", json!({"id": "keywordView:keywords"}));
assert!(has(&h, "keywordChip:beach") && !has(&h, "field:enterKeywords"), "Keywords brings the chips back");
}
/// A keyword left out of the text is taken off every selected photo, a partial one keeps its photos
/// while its asterisk stays, and without its asterisk it goes to all of them.
#[test]
fn enter_keywords_removes_and_makes_a_partial_keyword_common() {
let (mut h, ids) = two_selected();
enter(&mut h, "Weddings*");
ask(&mut h, "ui.key", json!({"key": "Enter"}));
assert_eq!(keywords_of(&h, ids[0]), ["Weddings"]);
assert!(keywords_of(&h, ids[1]).is_empty(), "beach went from both");
enter(&mut h, "Weddings");
ask(&mut h, "ui.key", json!({"key": "Enter"}));
assert_eq!(keywords_of(&h, ids[1]), ["Weddings"], "without its asterisk it goes to both");
enter(&mut h, "");
ask(&mut h, "ui.key", json!({"key": "Enter"}));
assert!(ids.iter().all(|id| keywords_of(&h, *id).is_empty()), "an empty box takes every keyword off");
}
/// Esc gives the edit up; leaving the box applies it, as Return does.
#[test]
fn enter_keywords_escape_gives_up_and_leaving_applies() {
let (mut h, ids) = two_selected();
enter(&mut h, "sea");
ask(&mut h, "ui.key", json!({"key": "Escape"}));
assert_eq!(keywords_of(&h, ids[0]), ["beach", "Weddings"], "Esc changed nothing");
assert_eq!(keywords_of(&h, ids[1]), ["beach"]);
enter(&mut h, "beach, Weddings*, sea");
ask(&mut h, "ui.key", json!({"key": "Tab"}));
assert!(all_have(&h, &ids, "sea"), "leaving the box applied it");
}
/// An asterisk after a name that is not a keyword only some photos have is refused: the photos keep
/// their keywords, the box keeps the cursor and its text, and the refusal is said.
#[test]
fn enter_keywords_refuses_a_name_ending_in_an_asterisk() {
let (mut h, ids) = two_selected();
enter(&mut h, "beach, Weddings*, sea*");
ask(&mut h, "ui.key", json!({"key": "Enter"}));
assert_eq!(keywords_of(&h, ids[0]), ["beach", "Weddings"]);
assert_eq!(keywords_of(&h, ids[1]), ["beach"]);
assert!(enter_focused(&h), "the box keeps the cursor to put it right");
assert!(h.app.ui.toast.as_ref().is_some_and(|(t, ..)| t.contains("asterisk") && t.contains("sea*")), "{:?}", h.app.ui.toast);
ask(&mut h, "ui.key", json!({"key": "Backspace"}));
ask(&mut h, "ui.key", json!({"key": "Enter"}));
assert!(all_have(&h, &ids, "sea"), "the text was kept and put right");
}
/// Another selection while the box is being edited gives the edit up: what was typed goes neither to
/// the photos it was typed for nor to the new selection.
#[test]
fn enter_keywords_gives_up_an_edit_when_the_selection_changes() {
let (mut h, ids) = two_selected();
enter(&mut h, "beach, Weddings*, harbour");
ask(&mut h, "engine.execute", json!({"command": "library.select", "params": {"ids": [ids[1]]}}));
ask(&mut h, "ui.key", json!({"key": "Enter"}));
let every: Vec<u64> = h.app.session.visible_cloned().iter().map(|p| p.0).collect();
assert!(every.iter().all(|id| !keywords_of(&h, *id).contains(&"harbour".to_string())), "nobody got harbour");
assert_eq!(keywords_of(&h, ids[0]), ["beach", "Weddings"]);
}
File diff suppressed because one or more lines are too long