diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index d9e3466611..72b2dce09a 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -361,3 +361,13 @@ mod tests { } } } + +#[cfg(test)] +mod feature_name_tests { + #[test] + fn perspective_labels_keep_existing_command_ids() { + for (id, label) in [("geometry.upright", "Perspective Correction"), ("geometry.guides", "Perspective Guides")] { + assert_eq!(super::find_command(id).expect("existing command").label, label); + } + } +} diff --git a/crates/engine/src/cmd/develop.rs b/crates/engine/src/cmd/develop.rs index 5223710ed6..7338bb35b3 100644 --- a/crates/engine/src/cmd/develop.rs +++ b/crates/engine/src/cmd/develop.rs @@ -1065,7 +1065,7 @@ pub fn specs() -> Vec { // ---- geometry: Upright cmd!( "geometry.upright", - "Upright", + "Perspective Correction", [], None, "{mode: off|auto|guided|level|vertical|full} — analyses the photo (line segments → vanishing points) and stores the correction; run again to update after lens changes", @@ -1083,7 +1083,7 @@ pub fn specs() -> Vec { Some(lightcraft_pipeline::upright::auto_transform(&src, &info, &d, m)) } }; - edit(s, "geometry.upright", "Upright", |d| { + edit(s, "geometry.upright", "Perspective Correction", |d| { d.geometry.upright = mode; d.geometry.upright_transform = transform; Ok(()) @@ -1093,10 +1093,10 @@ pub fn specs() -> Vec { ), cmd!( "geometry.guides", - "Guided Upright Guides", + "Perspective Guides", [], None, - "{guides: [[x0,y0,x1,y1], …] (≤ 4, normalized coords of the lens-corrected image), add?: bool (append one guide, dropping the oldest beyond 4)} — switches Upright to Guided", + "{guides: [[x0,y0,x1,y1], …] (≤ 4, normalized coords of the lens-corrected image), add?: bool (append one guide, dropping the oldest beyond 4)} — switches Perspective Correction to Guided", has_active, |s, p| { let parse = |v: &Value| -> Option<(Point, Point)> { @@ -1106,7 +1106,7 @@ pub fn specs() -> Vec { let guides: Vec<(Point, Point)> = p.get("guides").and_then(Value::as_array).map(|a| a.iter().filter_map(parse).collect()).unwrap_or_default(); let add = bool_or(p, "add", false); - edit(s, "geometry.guides", "Guided Upright", |d| { + edit(s, "geometry.guides", "Guided Perspective", |d| { if add { d.geometry.guides.extend(guides); } else { diff --git a/crates/ui-egui/locales/cs.json b/crates/ui-egui/locales/cs.json index 5ba9c5098f..d55dcd0312 100644 --- a/crates/ui-egui/locales/cs.json +++ b/crates/ui-egui/locales/cs.json @@ -832,8 +832,8 @@ "Group into Stack": "Seskupit do sady", "Group name": "Název skupiny", "Guided": "S vodítky", - "Guided Upright": "Narovnání perspektivy s vodítky", - "Guided Upright Guides": "Vodítka narovnání perspektivy", + "Guided Perspective": "Perspektiva s vodítky", + "Perspective Guides": "Vodítka perspektivy", "HDR": "HDR", "HDR Merge": "Sloučit do HDR", "HDR Merge Preview": "Náhled sloučení do HDR", @@ -1998,7 +1998,7 @@ "Update Version with Current Settings": "Aktualizovat verzi podle aktuálního nastavení", "Update with Current Settings": "Aktualizovat podle aktuálního nastavení", "Updated the edits saved in the external editor": "Úpravy uložené v externím editoru byly aktualizovány", - "Upright": "Narovnání perspektivy", + "Perspective Correction": "Korekce perspektivy", "Urban": "Městská krajina", "Use": "Použít", "Use Keyword Set": "Použít sadu klíčových slov", diff --git a/crates/ui-egui/locales/de.json b/crates/ui-egui/locales/de.json index 70fa252dc8..ce7e116dbe 100644 --- a/crates/ui-egui/locales/de.json +++ b/crates/ui-egui/locales/de.json @@ -651,8 +651,8 @@ "Group into Stack": "Zu Stapel gruppieren", "Group name": "Gruppenname", "Guided": "Mit Hilfslinien", - "Guided Upright": "Perspektivkorrektur mit Hilfslinien", - "Guided Upright Guides": "Hilfslinien der Perspektivkorrektur", + "Guided Perspective": "Geführte Perspektive", + "Perspective Guides": "Perspektivhilfslinien", "HDR Merge": "Zu HDR zusammenfügen", "HDR Merge Preview": "Vorschau der HDR-Zusammenfügung", "HDR Panorama Merge": "Zu HDR-Panorama zusammenfügen", @@ -1611,7 +1611,7 @@ "Update Version with Current Settings": "Version mit aktuellen Einstellungen aktualisieren", "Update with Current Settings": "Mit aktuellen Einstellungen aktualisieren", "Updated the edits saved in the external editor": "Im externen Editor gespeicherte Bearbeitungen aktualisiert", - "Upright": "Perspektivkorrektur", + "Perspective Correction": "Perspektivkorrektur", "Urban": "Städtisch", "Use Keyword Set": "Stichwortsatz verwenden", "Use Library Folder": "Bibliotheksordner verwenden", @@ -1850,7 +1850,7 @@ "− harder border · + softer border": "− härterer Rand · + weicherer Rand", "≤ at most": "≤ höchstens", "≥ at least": "≥ mindestens", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘-Ziehen zum Geraderichten, ⇧G für Perspektivkorrektur mit Hilfslinien und ein Raster beim Transformieren.", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘-Ziehen zum Geraderichten, ⇧G für Geführte Perspektive und ein Raster beim Transformieren.", "日本語": "日本語", "繁體中文(台灣)": "繁體中文(台灣)", "Any camera": "Jede Kamera", diff --git a/crates/ui-egui/locales/es.json b/crates/ui-egui/locales/es.json index 7b07c40a1f..ff9e7355ff 100644 --- a/crates/ui-egui/locales/es.json +++ b/crates/ui-egui/locales/es.json @@ -657,8 +657,8 @@ "Group into Stack": "Agrupar en pila", "Group name": "Nombre del grupo", "Guided": "Guiado", - "Guided Upright": "Vertical guiado", - "Guided Upright Guides": "Guías de vertical guiado", + "Guided Perspective": "Perspectiva guiada", + "Perspective Guides": "Guías de perspectiva", "HDR Merge": "Combinación HDR", "HDR Merge Preview": "Vista previa de combinación HDR", "HDR Panorama Merge": "Combinación de panorámica HDR", @@ -1709,7 +1709,7 @@ "with a counterpart here come along, the rest is listed.": "con un equivalente aquí se incluyen, el resto se enumera.", "written by a newer LightCraft is refused with \"this library was written by a newer version of LightCraft\" and left": "escrita por un LightCraft más reciente se rechaza con «this library was written by a newer version of LightCraft» y se deja", "written by a newer LightCraft), LightCraft says so and why, and offers Try Again, Choose Another Library…, Continue": "escrita por un LightCraft más reciente), LightCraft lo indica con el motivo y ofrece Reintentar, Elegir otra biblioteca…, Continuar", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘-arrastrar para enderezar, ⇧G Vertical guiado, una cuadrícula al transformar.", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘-arrastrar para enderezar, ⇧G Perspectiva guiada, una cuadrícula al transformar.", "Unrated": "Sin valorar", "Unreadable": "Ilegible", "Update": "Actualizar", @@ -1720,7 +1720,7 @@ "Update Version with Current Settings": "Actualizar versión con los ajustes actuales", "Update with Current Settings": "Actualizar con los ajustes actuales", "Updated the edits saved in the external editor": "Se actualizaron las ediciones guardadas en el editor externo", - "Upright": "Vertical", + "Perspective Correction": "Corrección de perspectiva", "Urban": "Urbano", "Use Keyword Set": "Usar conjunto de palabras clave", "Use Library Folder": "Usar carpeta de la biblioteca", diff --git a/crates/ui-egui/locales/fi.json b/crates/ui-egui/locales/fi.json index f06ce0d4d2..e971f91c99 100644 --- a/crates/ui-egui/locales/fi.json +++ b/crates/ui-egui/locales/fi.json @@ -829,8 +829,8 @@ "Grouped by parent": "Ryhmitelty ylätason mukaan", "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "Ryhmitelty: saman avainsanan sisällä olevat avainsanat jakavat sen nimeävän rivin, ja pitkät luettelot ja ehdotukset lyhennetään.", "Guided": "Ohjattu", - "Guided Upright": "Ohjattu Upright", - "Guided Upright Guides": "Ohjatun Uprightin apuviivat", + "Guided Perspective": "Ohjattu perspektiivi", + "Perspective Guides": "Perspektiivin apuviivat", "HDR": "HDR", "HDR Headroom": "HDR-varakorkeus", "HDR Merge": "HDR-yhdistäminen", @@ -2117,7 +2117,7 @@ "Update to Current Process": "Päivitä nykyiseen prosessiin", "Update with Current Settings": "Päivitä nykyisillä asetuksilla", "Updated the edits saved in the external editor": "Ulkoisessa muokkausohjelmassa tallennetut muokkaukset päivitetty", - "Upright": "Upright", + "Perspective Correction": "Perspektiivin korjaus", "Urban": "Urbaani", "Use": "Käytä", "Use Keyword Set": "Käytä avainsanajoukkoa", diff --git a/crates/ui-egui/locales/fr.json b/crates/ui-egui/locales/fr.json index e946c67346..17dd17bd3f 100644 --- a/crates/ui-egui/locales/fr.json +++ b/crates/ui-egui/locales/fr.json @@ -616,8 +616,8 @@ "Group into Stack": "Grouper en pile", "Group name": "Nom du groupe", "Guided": "Guidé", - "Guided Upright": "Upright guidé", - "Guided Upright Guides": "Repères de l'Upright guidé", + "Guided Perspective": "Perspective guidée", + "Perspective Guides": "Repères de perspective", "HDR Merge": "Fusion HDR", "HDR Merge Preview": "Aperçu de la fusion HDR", "HDR Panorama Merge": "Fusion de panorama HDR", @@ -1540,7 +1540,7 @@ "Update Version with Current Settings": "Mettre à jour la version avec les réglages actuels", "Update with Current Settings": "Mettre à jour avec les réglages actuels", "Updated the edits saved in the external editor": "Retouches enregistrées dans l'éditeur externe mises à jour", - "Upright": "Upright", + "Perspective Correction": "Correction de perspective", "Urban": "Urbain", "Use Keyword Set": "Utiliser le jeu de mots-clés", "Use Library Folder": "Utiliser le dossier de la bibliothèque", @@ -2209,7 +2209,7 @@ "with a counterpart here come along, the rest is listed.": "qui ont un équivalent ici suivent, le reste est listé.", "written by a newer LightCraft is refused with \"this library was written by a newer version of LightCraft\" and left": "écrite par une version plus récente de LightCraft est refusée avec « cette bibliothèque a été écrite par une version plus récente de LightCraft » et laissée", "written by a newer LightCraft), LightCraft says so and why, and offers Try Again, Choose Another Library…, Continue": "écrite par une version plus récente de LightCraft), LightCraft le signale avec la raison et propose Réessayer, Choisir une autre bibliothèque…, Continuer", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘-glisser pour redresser, ⇧G Upright guidé, une grille pendant la transformation.", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘-glisser pour redresser, ⇧G Perspective guidée, une grille pendant la transformation.", "No graphics processor found: LightCraft renders on the CPU, which is much slower. Details in Help → System Info.": "Aucun processeur graphique trouvé : LightCraft effectue le rendu sur le processeur, ce qui est beaucoup plus lent. Détails dans Aide → Informations système.", "On NixOS, start it from `nix develop`.": "Sous NixOS, lancez-le depuis `nix develop`.", "Files with the same content as another file in this import: only the first is imported.": "Fichiers au contenu identique à un autre fichier de cette importation : seul le premier est importé.", diff --git a/crates/ui-egui/locales/id.json b/crates/ui-egui/locales/id.json index aac5874ad6..a72b718fd5 100644 --- a/crates/ui-egui/locales/id.json +++ b/crates/ui-egui/locales/id.json @@ -831,8 +831,8 @@ "Grouped by parent": "Dikelompokkan menurut induk", "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "Dikelompokkan: kata kunci di bawah induk yang sama ditampilkan dalam satu baris berlabel nama induknya; daftar panjang dan saran dipersingkat.", "Guided": "Terpandu", - "Guided Upright": "Tegakkan terpandu", - "Guided Upright Guides": "Garis panduan Tegakkan terpandu", + "Guided Perspective": "Perspektif Terpandu", + "Perspective Guides": "Garis Panduan Perspektif", "HDR": "HDR", "HDR Headroom": "Ruang HDR", "HDR Merge": "Gabung HDR", @@ -2111,7 +2111,7 @@ "Update to Current Process": "Perbarui ke versi proses terbaru", "Update with Current Settings": "Perbarui dengan pengaturan saat ini", "Updated the edits saved in the external editor": "Edit yang disimpan di editor eksternal diperbarui", - "Upright": "Tegakkan", + "Perspective Correction": "Koreksi Perspektif", "Urban": "Urban", "Use": "Gunakan", "Use Keyword Set": "Gunakan set kata kunci", diff --git a/crates/ui-egui/locales/it.json b/crates/ui-egui/locales/it.json index 743b94e890..2ddcf037fd 100644 --- a/crates/ui-egui/locales/it.json +++ b/crates/ui-egui/locales/it.json @@ -617,8 +617,8 @@ "Group into Stack": "Raggruppa in una pila", "Group name": "Nome gruppo", "Guided": "Guidato", - "Guided Upright": "Raddrizzamento guidato", - "Guided Upright Guides": "Guide del raddrizzamento guidato", + "Guided Perspective": "Prospettiva guidata", + "Perspective Guides": "Guide prospettiche", "HDR Merge": "Unione HDR", "HDR Merge Preview": "Anteprima unione HDR", "HDR Panorama Merge": "Unione panorama HDR", @@ -1571,7 +1571,7 @@ "Update Version with Current Settings": "Aggiorna la versione con le impostazioni correnti", "Update with Current Settings": "Aggiorna con le impostazioni correnti", "Updated the edits saved in the external editor": "Modifiche salvate nell'editor esterno aggiornate", - "Upright": "Raddrizzamento", + "Perspective Correction": "Correzione prospettica", "Urban": "Urbano", "Use Keyword Set": "Usa set di parole chiave", "Use Library Folder": "Usa la cartella della libreria", diff --git a/crates/ui-egui/locales/ja.json b/crates/ui-egui/locales/ja.json index 6c83e8aaa3..04db1f164a 100644 --- a/crates/ui-egui/locales/ja.json +++ b/crates/ui-egui/locales/ja.json @@ -523,7 +523,7 @@ "Gritty Street": "ざらついたストリート", "Group by Date: Automatic": "日付でグループ化:自動", "Group name": "グループ名", - "Guided Upright Guides": "ガイド付き遠近補正のガイド", + "Perspective Guides": "遠近補正ガイド", "HDR Merge Preview": "HDR合成のプレビュー", "HDR Panorama Merge Preview": "HDRパノラマ合成のプレビュー", "HDR Panorama with Last Settings": "前回の設定でHDRパノラマ合成", @@ -808,7 +808,7 @@ "Group by date": "日付でグループ化", "Group into Stack": "スタックにまとめる", "Guided": "ガイド付き", - "Guided Upright": "ガイド付き遠近補正", + "Guided Perspective": "ガイド付き遠近補正", "HDR Merge": "HDR合成", "HDR Panorama Merge": "HDRパノラマ合成", "HDR Panorama…": "HDRパノラマ合成…", @@ -1469,7 +1469,7 @@ "Update Version with Current Settings": "現在の設定でバージョンを更新", "Update with Current Settings": "現在の設定で更新", "Updated the edits saved in the external editor": "外部エディターで保存した編集内容を更新しました", - "Upright": "遠近補正", + "Perspective Correction": "遠近補正", "Urban": "アーバン", "Use Keyword Set": "キーワードセットを使用", "Use Library Folder": "ライブラリのフォルダを使用", @@ -2212,7 +2212,7 @@ "with a counterpart here come along, the rest is listed.": "対応するものがあれば取り込み、残りは一覧に表示します。", "written by a newer LightCraft is refused with \"this library was written by a newer version of LightCraft\" and left": "新しい LightCraft で書かれたものは「このライブラリは新しいバージョンの LightCraft で書かれました」として拒否され、", "written by a newer LightCraft), LightCraft says so and why, and offers Try Again, Choose Another Library…, Continue": "新しい LightCraft で書かれた)、LightCraft はその旨と理由を示し、「再試行」「別のライブラリを選択…」「続行」を提示します", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘ ドラッグで角度補正、⇧G ガイド付き遠近補正、変形中のグリッド。", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘ ドラッグで角度補正、⇧G ガイド付き遠近補正、変形中のグリッド。", "No graphics processor found: LightCraft renders on the CPU, which is much slower. Details in Help → System Info.": "グラフィックプロセッサが見つかりません。LightCraftはCPUで描画するため、かなり遅くなります。詳細は「ヘルプ → システム情報」を参照してください。", "On NixOS, start it from `nix develop`.": "NixOSでは `nix develop` から起動してください。", "Files with the same content as another file in this import: only the first is imported.": "この読み込み内の別のファイルと内容が同じファイルです。最初のファイルだけが読み込まれます。", diff --git a/crates/ui-egui/locales/ka.json b/crates/ui-egui/locales/ka.json index 423ea1cc47..9791131d88 100644 --- a/crates/ui-egui/locales/ka.json +++ b/crates/ui-egui/locales/ka.json @@ -900,8 +900,8 @@ "Group into Stack": "დასტაში გაერთიანება", "Group name": "ჯგუფის სახელი", "Guided": "მართვადი", - "Guided Upright": "მართვადი Upright", - "Guided Upright Guides": "მართვადი Upright-ის დამხმარე ხაზები", + "Guided Perspective": "მართვადი პერსპექტივა", + "Perspective Guides": "პერსპექტივის დამხმარე ხაზები", "HDR": "HDR", "HDR Headroom": "HDR მარაგი", "HDR Merge": "HDR გაერთიანება", @@ -2224,7 +2224,7 @@ "Update with Current Settings": "განახლება მიმდინარე პარამეტრებით", "Updated the edits saved in the external editor": "გარე რედაქტორში შენახული ცვლილებები განახლდა", "Upgrading from a Windows installer older than 0.6 (such as 0.5.0) keeps LightCraft in the folder it was installed": "0.6-ზე ძველი Windows-ის ინსტალერიდან (მაგ., 0.5.0) განახლებისას LightCraft რჩება იმ საქაღალდეში, სადაც", - "Upright": "Upright", + "Perspective Correction": "პერსპექტივის კორექცია", "Urban": "ქალაქური", "Use": "გამოყენება", "Use Keyword Set": "საკვანძო სიტყვების ნაკრების გამოყენება", @@ -2748,7 +2748,7 @@ "− harder border · + softer border": "− უფრო მკვეთრი საზღვარი · + უფრო რბილი საზღვარი", "≤ at most": "≤ არაუმეტეს", "≥ at least": "≥ არანაკლებ", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘-გადათრევა გასასწორებლად, ⇧G მართვადი Upright, ბადე გარდაქმნისას.", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘-გადათრევა გასასწორებლად, ⇧G მართვადი პერსპექტივა, ბადე გარდაქმნისას.", "日本語": "日本語", "繁體中文(台灣)": "繁體中文(台灣)", "Blur Amount": "ბუნდოვნების რაოდენობა", diff --git a/crates/ui-egui/locales/pl.json b/crates/ui-egui/locales/pl.json index c4954eb3a8..9fb5e33695 100644 --- a/crates/ui-egui/locales/pl.json +++ b/crates/ui-egui/locales/pl.json @@ -601,8 +601,8 @@ "Group into Stack": "Zgrupuj w stos", "Group name": "Nazwa grupy", "Guided": "Z prowadnicami", - "Guided Upright": "Korekcja perspektywy z prowadnicami", - "Guided Upright Guides": "Prowadnice korekcji perspektywy", + "Guided Perspective": "Perspektywa z prowadnicami", + "Perspective Guides": "Prowadnice perspektywy", "HDR Merge": "Scalanie HDR", "HDR Merge Preview": "Podgląd scalania HDR", "HDR Panorama Merge": "Scal panoramę HDR", @@ -1507,7 +1507,7 @@ "Update Version with Current Settings": "Zaktualizuj wersję bieżącymi ustawieniami", "Update with Current Settings": "Zaktualizuj bieżącymi ustawieniami", "Updated the edits saved in the external editor": "Zaktualizowano edycje zapisane w edytorze zewnętrznym", - "Upright": "Korekcja perspektywy", + "Perspective Correction": "Korekcja perspektywy", "Urban": "Miejski", "Use Keyword Set": "Użyj zestawu słów kluczowych", "Use Library Folder": "Użyj folderu biblioteki", @@ -1652,7 +1652,7 @@ "− harder border · + softer border": "− ostrzejsza krawędź · + bardziej miękka krawędź", "≤ at most": "≤ co najwyżej", "≥ at least": "≥ co najmniej", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘ i przeciągnij, aby wyprostować, ⇧G: korekcja perspektywy z liniami pomocniczymi; podczas przekształcania wyświetlana jest siatka.", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘ i przeciągnij, aby wyprostować, ⇧G: korekcja perspektywy z liniami pomocniczymi; podczas przekształcania wyświetlana jest siatka.", "Any camera": "Dowolny aparat", "Any lens": "Dowolny obiektyw", "Any keyword": "Dowolne słowo kluczowe", diff --git a/crates/ui-egui/locales/pt-br.json b/crates/ui-egui/locales/pt-br.json index c1e59c59a4..e815f09a47 100644 --- a/crates/ui-egui/locales/pt-br.json +++ b/crates/ui-egui/locales/pt-br.json @@ -625,8 +625,8 @@ "Group into Stack": "Agrupar em pilha", "Group name": "Nome do grupo", "Guided": "Guiado", - "Guided Upright": "Vertical guiado", - "Guided Upright Guides": "Guias do vertical guiado", + "Guided Perspective": "Perspectiva guiada", + "Perspective Guides": "Guias de perspectiva", "HDR Merge": "Mesclagem HDR", "HDR Merge Preview": "Prévia da mesclagem HDR", "HDR Panorama Merge": "Mesclagem de panorama HDR", @@ -1564,7 +1564,7 @@ "Update Version with Current Settings": "Atualizar versão com as configurações atuais", "Update with Current Settings": "Atualizar com as configurações atuais", "Updated the edits saved in the external editor": "As edições salvas no editor externo foram atualizadas", - "Upright": "Vertical", + "Perspective Correction": "Correção de perspectiva", "Urban": "Urbano", "Use Keyword Set": "Usar conjunto de palavras-chave", "Use Library Folder": "Usar pasta da biblioteca", diff --git a/crates/ui-egui/locales/ru.json b/crates/ui-egui/locales/ru.json index 258dae60bf..b7bb62e7d6 100644 --- a/crates/ui-egui/locales/ru.json +++ b/crates/ui-egui/locales/ru.json @@ -713,8 +713,8 @@ "Group by date": "Группировать по дате", "Group into Stack": "Сгруппировать в стопку", "Guided": "Направляемый", - "Guided Upright": "Направляемое выравнивание", - "Guided Upright Guides": "Направляющие выравнивания", + "Guided Perspective": "Перспектива по направляющим", + "Perspective Guides": "Направляющие перспективы", "HDR Merge": "Слияние HDR", "HDR Panorama Merge": "Слияние HDR-панорамы", "HDR Panorama with Last Settings": "HDR-панорама с последними настройками", @@ -1522,7 +1522,7 @@ "Update Version": "Обновить версию", "Update Version with Current Settings": "Обновить версию текущими настройками", "Update with Current Settings": "Обновить текущими настройками", - "Upright": "Выравнивание (Upright)", + "Perspective Correction": "Коррекция перспективы", "Urban": "Урбан", "Use Keyword Set": "Использовать набор ключевых слов", "Use Library Folder": "Использовать папку библиотеки", @@ -2415,7 +2415,7 @@ "© Your Name": "© Ваше имя", "≤ at most": "≤ не более", "≥ at least": "≥ не менее", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘+перетаскивание — выровнять, ⇧G — направляемое выравнивание, сетка при трансформации.", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘+перетаскивание — выровнять, ⇧G — направляемое выравнивание, сетка при трансформации.", "Add to Apple Photos": "Добавить в Apple Фото", "Adding to Apple Photos…": "Добавление в Apple Фото…", "not added to Apple Photos (cancelled)": "не добавлено в Apple Фото (отменено)", diff --git a/crates/ui-egui/locales/sv.json b/crates/ui-egui/locales/sv.json index 8b454e0b2d..6092355c95 100644 --- a/crates/ui-egui/locales/sv.json +++ b/crates/ui-egui/locales/sv.json @@ -884,8 +884,8 @@ "Grouped by parent": "Grupperade efter överordnad", "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "Grupperat: nyckelord inom samma nyckelord delar en rad som namnger det, och långa listor och förslagen förkortas.", "Guided": "Guidad", - "Guided Upright": "Guidad upprätning", - "Guided Upright Guides": "Stödlinjer för guidad upprätning", + "Guided Perspective": "Guidad perspektiv", + "Perspective Guides": "Perspektivstödlinjer", "Has Edits": "Har redigeringar", "Has GPS": "Har GPS", "has open — on this computer or another one sharing the folder — says who has it (\"already open in LightCraft (process": "har öppet – på den här datorn eller en annan som delar mappen – anger vem som har det (\"redan öppet i LightCraft (process", @@ -2297,7 +2297,7 @@ "Update Version with Current Settings": "Uppdatera version med aktuella inställningar", "Update with Current Settings": "Uppdatera med aktuella inställningar", "Updated the edits saved in the external editor": "Uppdaterade redigeringarna som sparats i den externa redigeraren", - "Upright": "Uppräta", + "Perspective Correction": "Perspektivkorrigering", "Urban": "Urban", "Use": "Använd", "Use camera-specific defaults": "Använd kameraspecifika standardvärden", @@ -2433,7 +2433,7 @@ "− harder border · + softer border": "− hårdare kant · + mjukare kant", "≤ at most": "≤ högst", "≥ at least": "≥ minst", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘-dra för att räta upp, ⇧G guidad upprätning, ett rutnät under transformering.", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘-dra för att räta upp, ⇧G guidad upprätning, ett rutnät under transformering.", "★ Favorites": "★ Favoriter", "日本語": "日本語", "繁體中文(台灣)": "繁體中文(台灣)", diff --git a/crates/ui-egui/locales/uk.json b/crates/ui-egui/locales/uk.json index b4d3e50020..09e5b0e1e8 100644 --- a/crates/ui-egui/locales/uk.json +++ b/crates/ui-egui/locales/uk.json @@ -772,7 +772,7 @@ "Green label": "Зелена мітка", "Gritty Street": "Груба вулиця", "Group by Date: Automatic": "Групування за датою: автоматично", - "Guided Upright Guides": "Напрямні керованого випрямлення", + "Perspective Guides": "Напрямні перспективи", "HDR Merge Preview": "Попередній перегляд об’єднання HDR", "HDR Panorama Merge Preview": "Попередній перегляд об’єднання HDR-панорами", "HDR Panorama with Last Settings": "HDR-панорама з останніми налаштуваннями", @@ -998,7 +998,7 @@ "Group by date": "Групувати за датою", "Group into Stack": "Об’єднати в стос", "Guided": "Кероване", - "Guided Upright": "Кероване випрямлення", + "Guided Perspective": "Перспектива за напрямними", "HDR Merge": "Об’єднання HDR", "HDR Panorama Merge": "Об’єднання HDR-панорами", "HDR Panorama…": "HDR-панорама…", @@ -1509,7 +1509,7 @@ "Update Version with Current Settings": "Оновити версію поточними налаштуваннями", "Update with Current Settings": "Оновити поточними налаштуваннями", "Updated the edits saved in the external editor": "Зміни, збережені в зовнішньому редакторі, оновлено", - "Upright": "Випрямлення", + "Perspective Correction": "Корекція перспективи", "Urban": "Міське", "Use Keyword Set": "Використовувати набір ключових слів", "Use Library Folder": "Використовувати теку бібліотеки", @@ -1938,7 +1938,7 @@ "with a counterpart here come along, the rest is listed.": "з відповідником тут переносяться, решта перелічується.", "written by a newer LightCraft is refused with \"this library was written by a newer version of LightCraft\" and left": "створена новішим LightCraft, відхиляється з повідомленням «цю бібліотеку створено новішою версією LightCraft» і залишається", "written by a newer LightCraft), LightCraft says so and why, and offers Try Again, Choose Another Library…, Continue": "створена новішим LightCraft), LightCraft пояснює причину й пропонує Спробувати знову, Вибрати іншу бібліотеку…, Продовжити", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘-перетягування для випрямлення, ⇧G для керованого випрямлення, сітка під час трансформування.", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘-перетягування для випрямлення, ⇧G для керованого випрямлення, сітка під час трансформування.", "Sort Albums A–Z": "Сортувати альбоми А–Я", "Go back to listing them by name": "Повернутися до списку за назвою", "Sort Contents A–Z": "Сортувати вміст А–Я", diff --git a/crates/ui-egui/locales/vi.json b/crates/ui-egui/locales/vi.json index 5840e84b5f..d31e48dff2 100644 --- a/crates/ui-egui/locales/vi.json +++ b/crates/ui-egui/locales/vi.json @@ -761,8 +761,8 @@ "Group into Stack": "Gom thành chồng", "Group name": "Tên nhóm", "Guided": "Có hướng dẫn", - "Guided Upright": "Chỉnh thẳng có hướng dẫn", - "Guided Upright Guides": "Đường hướng dẫn chỉnh thẳng", + "Guided Perspective": "Phối cảnh có hướng dẫn", + "Perspective Guides": "Đường dẫn phối cảnh", "HDR": "HDR", "HDR Headroom": "Dự trữ HDR", "HDR Merge": "Ghép HDR", @@ -1929,7 +1929,7 @@ "Update to Current Process": "Cập nhật lên quy trình hiện tại", "Update with Current Settings": "Cập nhật bằng thiết lập hiện tại", "Updated the edits saved in the external editor": "Đã cập nhật chỉnh sửa lưu trong trình soạn ngoài", - "Upright": "Chỉnh thẳng", + "Perspective Correction": "Hiệu chỉnh phối cảnh", "Urban": "Đô thị", "Use": "Dùng", "Use Keyword Set": "Dùng bộ từ khóa", @@ -2243,7 +2243,7 @@ "− harder border · + softer border": "− viền cứng hơn · + viền mềm hơn", "≤ at most": "≤ tối đa", "≥ at least": "≥ tối thiểu", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘-kéo để chỉnh thẳng, ⇧G Chỉnh thẳng có hướng dẫn, lưới khi biến đổi.", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘-kéo để chỉnh thẳng, ⇧G Phối cảnh có hướng dẫn, lưới khi biến đổi.", "日本語": "日本語", "繁體中文(台灣)": "繁體中文(台灣)", "Blur Amount": "Mức làm mờ", diff --git a/crates/ui-egui/locales/zh-hans.json b/crates/ui-egui/locales/zh-hans.json index ec20786825..766d982552 100644 --- a/crates/ui-egui/locales/zh-hans.json +++ b/crates/ui-egui/locales/zh-hans.json @@ -762,8 +762,8 @@ "Group by date": "按日期分组", "Group into Stack": "合并为堆叠", "Guided": "引导式", - "Guided Upright": "引导式透视校正", - "Guided Upright Guides": "引导式垂直校正参考线", + "Guided Perspective": "引导式透视", + "Perspective Guides": "透视辅助线", "HDR Merge": "HDR 合并", "HDR Panorama Merge": "HDR 全景合并", "HDR Panorama with Last Settings": "使用上次设置合并 HDR 全景", @@ -1540,7 +1540,7 @@ "Update Version with Current Settings": "使用当前设置更新版本", "Update with Current Settings": "使用当前设置更新", "Updated the edits saved in the external editor": "已更新在外部编辑器中保存的编辑", - "Upright": "垂直校正", + "Perspective Correction": "透视校正", "Urban": "都市", "Use Keyword Set": "使用关键字集", "Use Library Folder": "使用图库文件夹", @@ -2416,7 +2416,7 @@ "Without Saving and Quit (issue #100). It no longer quietly starts a demo session that looked like a reset library and": "不保存并退出(问题 #100)。它不再静默启动一个看似已重置图库的演示会话,", "written by a newer LightCraft is refused with \"this library was written by a newer version of LightCraft\" and left": "由更新版本 LightCraft 写入的目录会被拒绝,提示“此图库由更新版本的 LightCraft 写入”,并保持", "written by a newer LightCraft), LightCraft says so and why, and offers Try Again, Choose Another Library…, Continue": "由更新版本 LightCraft 写入),LightCraft 会说明情况和原因,并提供 重试、选择其他图库…、继续", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘-拖拽进行拉直,⇧G 引导式垂直校正,变换时显示网格。", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘-拖拽进行拉直,⇧G 引导式垂直校正,变换时显示网格。", "on the card after Review Import is reported instead of being imported with stale details. Checking an export path": "在“审阅导入”后在存储卡上发生的更改会被报告,而不会以过时信息导入。检查导出路径", "one by one — they can always be exported again, and on a USB drive or a NAS that per-file sync dominated a large": "逐个进行——它们随时可以重新导出,而在 USB 硬盘或 NAS 上,逐文件同步曾占用了大量", "over a same-name same-size look-alike, and skips (and reports) photos it can't tell apart instead of guessing.": "而不是同名同大小的相似文件,并且会跳过(并报告)无法区分的照片,而不是猜测。", diff --git a/crates/ui-egui/locales/zh-hant.json b/crates/ui-egui/locales/zh-hant.json index f84f851102..26ec3e8f61 100644 --- a/crates/ui-egui/locales/zh-hant.json +++ b/crates/ui-egui/locales/zh-hant.json @@ -763,8 +763,8 @@ "Group by date": "依日期分組", "Group into Stack": "分組為堆疊", "Guided": "引導式", - "Guided Upright": "引導式透視校正", - "Guided Upright Guides": "引導式透視校正參考線", + "Guided Perspective": "引導式透視", + "Perspective Guides": "透視輔助線", "HDR Merge": "HDR 合併", "HDR Panorama Merge": "HDR 全景合併", "HDR Panorama with Last Settings": "使用上次設定合併 HDR 全景", @@ -1546,7 +1546,7 @@ "Update Version with Current Settings": "以目前設定更新版本", "Update with Current Settings": "以目前設定更新", "Updated the edits saved in the external editor": "已更新在外部編輯器中儲存的編輯內容", - "Upright": "透視校正", + "Perspective Correction": "透視校正", "Urban": "城市", "Use Keyword Set": "使用關鍵字集", "Use Library Folder": "使用照片庫資料夾", @@ -2421,7 +2421,7 @@ "Without Saving and Quit (issue #100). It no longer quietly starts a demo session that looked like a reset library and": "不儲存並結束(問題 #100)。它不再靜默啟動一個看似已重設圖庫的示範工作階段,", "written by a newer LightCraft is refused with \"this library was written by a newer version of LightCraft\" and left": "由更新版本 LightCraft 寫入的目錄會被拒絕,提示「此圖庫由更新版本的 LightCraft 寫入」,並保持", "written by a newer LightCraft), LightCraft says so and why, and offers Try Again, Choose Another Library…, Continue": "由更新版本 LightCraft 寫入),LightCraft 會說明情況和原因,並提供 重試、選擇其他圖庫…、繼續", - "⌘-drag to straighten, ⇧G Guided Upright, a grid while transforming.": "⌘-拖曳進行拉直,⇧G 引導式垂直校正,變換時顯示網格。", + "⌘-drag to straighten, ⇧G Guided Perspective, a grid while transforming.": "⌘-拖曳進行拉直,⇧G 引導式垂直校正,變換時顯示網格。", "Face recognition is on": "臉部辨識已開啟", "Face recognition is off. Turn it on to get name suggestions and see look-alike faces together.": "臉部辨識已關閉。開啟後可取得姓名建議,並將相似的臉孔放在一起檢視。", "Turn on": "開啟", diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 0b7f31cf9e..47af31e2c6 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -1295,3 +1295,13 @@ fn polish_switches_formats_dates_and_reads_every_count() { assert_polish_glyphs(&ctx); set_language(Locale::En); } + +#[test] +fn perspective_labels_are_translated_in_every_shipped_locale() { + for locale in Locale::ALL.iter().filter(|locale| **locale != Locale::En) { + for source in ["Perspective Correction", "Guided Perspective", "Perspective Guides"] { + assert!(locale.catalog().contains_key(source), "{}: {source}", locale.code()); + assert!(!locale.tr(source).contains("Upright"), "{}: {source}", locale.code()); + } + } +} diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index e9deed4601..fb83b3a746 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -65,7 +65,7 @@ pub const UI_COMMANDS: &[UiCommand] = &[ // G: Photo Grid ↔ Square Grid (from other views: the photo grid) ("view.gridToggle", "Grid", Some("G"), ""), ("library.selectOnlyActive", "Select Only Active Photo", Some("Cmd+Shift+D"), "Edit"), - ("tool.guidedUpright", "Guided Upright", Some("Shift+G"), "Window>Tools"), + ("tool.guidedUpright", "Guided Perspective", Some("Shift+G"), "Window>Tools"), ("view.detail", "Detail View", Some("D"), "View"), ("view.compare", "Compare", Some("Shift+C"), "View"), ("view.survey", "Survey", Some("N"), "View"), diff --git a/crates/ui-egui/src/panels/right/crop.rs b/crates/ui-egui/src/panels/right/crop.rs index 0b71fffe8a..f2e72be0cb 100644 --- a/crates/ui-egui/src/panels/right/crop.rs +++ b/crates/ui-egui/src/panels/right/crop.rs @@ -211,7 +211,7 @@ pub(super) fn crop(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) { divider(ui); header(ui, "Geometry"); padded(ui, |ui| { - ui.label(crate::i18n::tr("Upright")); + ui.label(crate::i18n::tr("Perspective Correction")); { use lightcraft_develop::Upright; let modes = [ diff --git a/crates/ui-egui/tests/display_names.rs b/crates/ui-egui/tests/display_names.rs new file mode 100644 index 0000000000..a1b312da96 --- /dev/null +++ b/crates/ui-egui/tests/display_names.rs @@ -0,0 +1,178 @@ +//! Guard the production display surfaces without banning compatibility identifiers or notices. +use std::path::{Path, PathBuf}; + +const BANNED: &[&str] = &["Upright"]; +const ALLOWED: &[&str] = &[]; +const ROOTS: &[&str] = &["src", "../engine/src/cmd"]; + +fn is_word(c: char) -> bool { + c.is_alphanumeric() || c == '_' +} + +fn banned_display(text: &str) -> bool { + if ALLOWED.contains(&text) || text.starts_with("Lightroom geometry for {path} ") { + return false; + } + BANNED.iter().any(|banned| { + text.match_indices(banned) + .any(|(at, _)| !text[..at].chars().next_back().is_some_and(is_word) && !text[at + banned.len()..].chars().next().is_some_and(is_word)) + }) +} + +// Read ordinary and raw Rust string literals, ignoring comments. No compiler dependency is +// needed, so this guard can also run by itself when a full application build is unavailable. +#[allow(clippy::cognitive_complexity)] // This small test-only lexer keeps raw-string/comment state together. +fn literals(source: &str) -> Vec { + let chars: Vec = source.chars().collect(); + let mut out = Vec::new(); + let mut at = 0; + let mut test_module = false; + let mut test_depth = 0_usize; + while at < chars.len() { + if chars.get(at..at + 12) == Some(&['#', '[', 'c', 'f', 'g', '(', 't', 'e', 's', 't', ')', ']']) { + at += 12; + let rest: String = chars[at..].iter().collect(); + if rest.trim_start().starts_with("mod ") { + test_module = true; + } + } else if chars.get(at..at + 2) == Some(&['/', '/']) { + while at < chars.len() && chars[at] != '\n' { + at += 1; + } + } else if chars.get(at..at + 2) == Some(&['/', '*']) { + at += 2; + let mut depth = 1; + while at < chars.len() && depth > 0 { + if chars.get(at..at + 2) == Some(&['/', '*']) { + depth += 1; + at += 2; + } else if chars.get(at..at + 2) == Some(&['*', '/']) { + depth -= 1; + at += 2; + } else { + at += 1; + } + } + } else if chars[at] == 'r' && matches!(chars.get(at + 1), Some('"' | '#')) { + let start = at; + at += 1; + while chars.get(at) == Some(&'#') { + at += 1; + } + let hashes = at - start - 1; + if chars.get(at) != Some(&'"') { + continue; + } + at += 1; + let begin = at; + while at < chars.len() { + if chars[at] == '"' && (1..=hashes).all(|n| chars.get(at + n) == Some(&'#')) { + break; + } + at += 1; + } + if !test_module { + out.push(chars[begin..at].iter().collect()); + } + at += 1 + hashes; + } else if chars[at] == '"' { + at += 1; + let mut text = String::new(); + while at < chars.len() { + let c = chars[at]; + at += 1; + if c == '"' { + break; + } + if c == '\\' && at < chars.len() { + text.push(chars[at]); + at += 1; + } else { + text.push(c); + } + } + if !test_module { + out.push(text); + } + } else if chars[at] == '\'' && chars.get(at + 2) == Some(&'\'') { + at += 3; // A character literal such as '"', not the start of a string. + } else { + if test_module { + match chars[at] { + '{' => test_depth += 1, + '}' => { + test_depth = test_depth.saturating_sub(1); + if test_depth == 0 { + test_module = false; + } + } + ';' if test_depth == 0 => test_module = false, + _ => {} + } + } + at += 1; + } + } + out +} + +fn check_tree(path: &Path, failures: &mut Vec) { + if path.is_dir() { + for entry in std::fs::read_dir(path).expect("source directory") { + let path = entry.expect("source entry").path(); + if path.file_name().is_some_and(|name| name == "tests") { + continue; + } + check_tree(&path, failures); + } + } else if path.extension().is_some_and(|ext| ext == "rs") { + let name = path.file_name().expect("source filename").to_string_lossy(); + if name == "tests.rs" || name.ends_with("_tests.rs") { + return; + } + let source = std::fs::read_to_string(path).expect("UTF-8 Rust source"); + // Skip only inline test modules, not later production following test-only imports. + for text in literals(&source) { + if banned_display(&text) { + failures.push(format!("{}: {text:?}", path.display())); + } + } + } +} + +#[test] +fn production_display_names_stay_neutral() { + let base = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + let mut failures = Vec::new(); + for root in ROOTS { + let root = base.join(root); + assert!(root.exists(), "missing display source: {}", root.display()); + check_tree(&root, &mut failures); + } + assert!(failures.is_empty(), "Banned display names:\n{}", failures.join("\n")); +} + +#[test] +fn guard_distinguishes_labels_from_identifiers_and_comments() { + for name in BANNED { + assert!(banned_display(name), "{name}"); + } + for name in ALLOWED { + assert!(!banned_display(name), "{name}"); + } + assert!(!banned_display("filter.cameraRaw")); + assert!(!banned_display("tool.guidedUpright")); + assert!(!banned_display("insert.smartArt")); + assert_eq!(literals("// \"ignored\"\n/* \"ignored\" */ \"label\""), ["label"]); + assert_eq!(literals("r#\"raw label\"#"), ["raw label"]); +} + +#[test] +fn guard_scans_production_after_test_only_items() { + let source = r###"#[cfg(test)] mod tests { let _ = "ignored"; } + #[cfg(test)] use fixtures::Helper; + fn production() { let _ = r#"live label"#; } + "###; + assert_eq!(literals(source), ["live label"]); + assert_eq!(literals("#[cfg(test)] mod tests; fn live() { let _ = \"live label\"; }"), ["live label"]); +} diff --git a/docs/feature-names.md b/docs/feature-names.md new file mode 100644 index 0000000000..532d0f7bcf --- /dev/null +++ b/docs/feature-names.md @@ -0,0 +1,15 @@ +# Feature naming + +LightCraft uses **Perspective Correction**, **Guided Perspective**, and **Perspective Guides** for its own geometry controls. The section includes Off, Auto, Guided, Level, Vertical and Full modes, so its name does not imply every mode is automatic. + +The previous Upright terminology is a naming-review candidate, not a verified finding about trademark registration. These descriptive names are chosen to distinguish LightCraft's own implementation. + +## Compatibility boundary + +The `geometry.upright`, `geometry.guides` and `tool.guidedUpright` commands, saved tool keys, Rust enum variants and serialized settings remain stable. XMP `crs:PerspectiveUpright` and `UprightTransform_*` mappings and Lightroom import messages still describe the external format accurately. No rendering, import or export logic changes. + +All 17 shipped non-English catalogs contain the new labels. The normal CI, perspective-mode tests and a visual panel/tool check remain required before this draft is marked ready. + +## Regression coverage + +The standard-library-only `display_names` integration tests scan production Rust string literals for the retired display names and preserve explicit compatibility exceptions. They also test identifier, comment and raw-string handling. These focused checks do not replace application or visual testing.