LRC-LIB-SMARTCOLL: own labels for treatment Color and label None

From review: the treatment choice "Color" reused the shared "Color" key,
which zh-hans and ru translate as the colour noun (颜色, Цвет) for the
Color panel, giving "Treatment is colour". The colour-label choice
"None" was masculine in Spanish (Ninguno) next to the feminine
"etiqueta". They are now "In Color" and "No Label", translated in all
seven locales (彩色, Цветное, Sin etiqueta…).

Also moves display_label_gaps_are_reported's doc comment back onto it;
the new choice test had been inserted between them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nathaniel Ledford
2026-10-09 10:54:56 -04:00
co-authored by Claude Opus 5.5
parent 26df5ab60b
commit 4c826246c3
10 changed files with 35 additions and 14 deletions
+6 -2
View File
@@ -61,7 +61,7 @@ pub const FIELDS: &[(&str, &str, Kind)] = &[
(
"label",
"Color Label",
Kind::Choice(&[("red", "Red"), ("yellow", "Yellow"), ("green", "Green"), ("blue", "Blue"), ("purple", "Purple"), ("none", "None")]),
Kind::Choice(&[("red", "Red"), ("yellow", "Yellow"), ("green", "Green"), ("blue", "Blue"), ("purple", "Purple"), ("none", "No Label")]),
),
("text", "Any Searchable Text", Kind::Text),
// Source
@@ -117,7 +117,7 @@ pub const FIELDS: &[(&str, &str, Kind)] = &[
// Develop
("edited", "Has Edits", Kind::Bool),
("cropped", "Cropped", Kind::Bool),
("treatment", "Treatment", Kind::Choice(&[("color", "Color"), ("monochrome", "Black & White")])),
("treatment", "Treatment", Kind::Choice(&[("color", "In Color"), ("monochrome", "Black & White")])),
// Assisted Culling
("sharpness", "Focus (assisted culling)", Kind::Number),
("bestOfGroup", "Best of Similar Shots", Kind::Bool),
@@ -848,6 +848,10 @@ mod tests {
fn choices_have_readable_labels() {
assert_eq!(choice_label("copyrightStatus", "publicDomain"), Some("Public Domain"));
assert_eq!(choice_label("treatment", "monochrome"), Some("Black & White"));
// own labels where a shared word would translate wrongly: "Color" is the colour noun (the
// Color panel) and "None" agrees with other nouns in gendered languages
assert_eq!(choice_label("treatment", "color"), Some("In Color"));
assert_eq!(choice_label("label", "none"), Some("No Label"));
assert_eq!(choice_label("flag", "pick"), Some("Picked"));
assert_eq!(choice_label("aspect", "landscape"), Some("Landscape (wide)"));
assert_eq!(choice_label("flag", "nope"), None);
+3 -1
View File
@@ -1894,5 +1894,7 @@
"Unknown": "Unbekannt",
"Landscape (wide)": "Querformat",
"Portrait (tall)": "Hochformat",
"Square": "Quadratisch"
"Square": "Quadratisch",
"In Color": "Farbig",
"No Label": "Ohne Markierung"
}
+3 -1
View File
@@ -1739,5 +1739,7 @@
"Unknown": "Desconocido",
"Landscape (wide)": "Horizontal (apaisada)",
"Portrait (tall)": "Vertical (retrato)",
"Square": "Cuadrada"
"Square": "Cuadrada",
"In Color": "En color",
"No Label": "Sin etiqueta"
}
+3 -1
View File
@@ -1739,5 +1739,7 @@
"Unknown": "不明",
"Landscape (wide)": "横長",
"Portrait (tall)": "縦長",
"Square": "正方形"
"Square": "正方形",
"In Color": "カラー",
"No Label": "ラベルなし"
}
+3 -1
View File
@@ -1739,5 +1739,7 @@
"Unknown": "Desconhecido",
"Landscape (wide)": "Paisagem (horizontal)",
"Portrait (tall)": "Retrato (vertical)",
"Square": "Quadrada"
"Square": "Quadrada",
"In Color": "Colorida",
"No Label": "Sem rótulo"
}
+3 -1
View File
@@ -1411,5 +1411,7 @@
"Unknown": "Неизвестно",
"Landscape (wide)": "Альбомная",
"Portrait (tall)": "Книжная",
"Square": "Квадратная"
"Square": "Квадратная",
"In Color": "Цветное",
"No Label": "Без метки"
}
+3 -1
View File
@@ -1739,5 +1739,7 @@
"Unknown": "未知",
"Landscape (wide)": "横向",
"Portrait (tall)": "纵向",
"Square": "正方形"
"Square": "正方形",
"In Color": "彩色",
"No Label": "无标签"
}
+3 -1
View File
@@ -1739,5 +1739,7 @@
"Unknown": "未知",
"Landscape (wide)": "橫向",
"Portrait (tall)": "直向",
"Square": "正方形"
"Square": "正方形",
"In Color": "彩色",
"No Label": "無標籤"
}
+7 -4
View File
@@ -636,10 +636,6 @@ mod tests {
}
}
/// Every command, control, rule and rename label, and every line of What's New, is a message a
/// catalog can translate. What a language lacks is reported, not failed (like
/// `catalogs_agree_on_placeholders_and_report_gaps`): a feature PR doesn't have to ship every
/// language, and the translations catch up at their own pace.
/// Smart-album choice values read as words in every language (English "Public Domain", German
/// "Gemeinfrei"), never as rule ids like `publicDomain`; an id the field doesn't know shows as
/// written. Unlike other labels these must be translated: an untranslated one would be English
@@ -650,6 +646,9 @@ mod tests {
assert_eq!(choice_text_in(Locale::En, "copyrightStatus", "publicDomain"), "Public Domain");
assert_eq!(choice_text_in(Locale::De, "copyrightStatus", "publicDomain"), "Gemeinfrei");
assert_eq!(choice_text_in(Locale::De, "copyrightStatus", "someday"), "someday");
assert_eq!(choice_text_in(Locale::ZhHans, "treatment", "color"), "彩色", "in colour, not the colour noun");
assert_eq!(choice_text_in(Locale::Ru, "treatment", "color"), "Цветное");
assert_eq!(choice_text_in(Locale::Es, "label", "none"), "Sin etiqueta");
for language in Locale::ALL {
for (field, _, kind) in FIELDS {
let Kind::Choice(choices) = kind else { continue };
@@ -664,6 +663,10 @@ mod tests {
}
}
/// Every command, control, rule and rename label, and every line of What's New, is a message a
/// catalog can translate. What a language lacks is reported, not failed (like
/// `catalogs_agree_on_placeholders_and_report_gaps`): a feature PR doesn't have to ship every
/// language, and the translations catch up at their own pace.
#[test]
fn display_label_gaps_are_reported() {
let mut labels: Vec<&str> = lightcraft_engine::command_specs().iter().map(|spec| spec.label).collect();
+1 -1
View File
@@ -8,7 +8,7 @@
Culling.
- New fields: Keyword Count ("2 or more", "exactly 2"…), People and People Count (named faces), Shutter Speed (written
as 1/250), File Extension, Video Duration, Copy Name, In a Stack, Alt Text, City, State / Province, Country, Long
Edge, Short Edge, Aspect Ratio (landscape / portrait / square), Cropped and Treatment (color / black & white).
Edge, Short Edge, Aspect Ratio (landscape / portrait / square), Cropped and Treatment (in color / black & white).
- Choice values read as words in every language: "Public Domain", "Picked", "Black & White" rather than ids like
`publicDomain` (rules and agents keep using the ids; `album.ruleFields` adds `choiceLabels`).
- Any Searchable Text also finds the state / province, alt text, people and a virtual copy's name.