From 578bc905a6320cbbe55d41601e4d1eaa72fdb2df Mon Sep 17 00:00:00 2001 From: Elvis33LE <67311580+Elvis33LE@users.noreply.github.com> Date: Fri, 9 Oct 2026 03:00:58 +0200 Subject: [PATCH] =?UTF-8?q?i18n:=20split=20"Light"=20=E2=80=94=20font=20we?= =?UTF-8?q?ights=20get=20their=20own=20context,=20Camera=20Raw=20keeps=20t?= =?UTF-8?q?he=20panel=20term=20(#1061)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * i18n: split "Light" - font weights get their own context, Camera Raw keeps the panel term The plain "Light" entry served two unrelated meanings, and every catalog had resolved the collision in favour of the font weight (de "Light", ja "ライト", fr "Maigre", ko "가늘게"...), so Camera Raw's Light section header showed a weight word in most languages. - The type tool's style dropdown now shows localized labels while the raw string stays the engine's fontStyle key (value/label pairs, like the anti-alias dropdown), with each word translated in a new fontWeight context (Thin...Black, Italic). - Camera Raw's Light section reads cameraRaw|Light (Licht, Luz, Lumière, Свет, 光...); every catalog gains the missing rows, and a new i18n test pins both contexts plus their distinction per language. * i18n(pl): font weights and Camera Raw keep their split contexts in Polish too * i18n tests: close the Seafoam test before the font-weight test (rebase fixup) Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Brandon Thomas Co-authored-by: Claude Opus 5.5 --- crates/ui-egui/src/i18n/cs.tsv | 10 ++++++++++ crates/ui-egui/src/i18n/de.tsv | 11 +++++++++++ crates/ui-egui/src/i18n/es.tsv | 10 ++++++++++ crates/ui-egui/src/i18n/fr.tsv | 10 ++++++++++ crates/ui-egui/src/i18n/id.tsv | 10 ++++++++++ crates/ui-egui/src/i18n/it.tsv | 10 ++++++++++ crates/ui-egui/src/i18n/ja.tsv | 10 ++++++++++ crates/ui-egui/src/i18n/ko.tsv | 10 ++++++++++ crates/ui-egui/src/i18n/mod.rs | 14 ++++++++++++++ crates/ui-egui/src/i18n/pl.tsv | 10 ++++++++++ crates/ui-egui/src/i18n/pt-br.tsv | 10 ++++++++++ crates/ui-egui/src/i18n/ru.tsv | 10 ++++++++++ crates/ui-egui/src/i18n/zh-hans.tsv | 10 ++++++++++ crates/ui-egui/src/i18n/zh-hant.tsv | 10 ++++++++++ crates/ui-egui/src/type_tool.rs | 11 +++++++++-- 15 files changed, 154 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index d776b7b90c..d782375628 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -2201,3 +2201,13 @@ cameraRaw Color Barvy Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. Úpravy, které mění celý dokument, například režim prolnutí, krytí nebo viditelnost vrstvy, jej překreslí celý. Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. Vrstvy se nevejdou do rozpočtu paměti GPU. Zvýšením hodnoty Využití paměti v Předvolbách › Výkon se rozpočet zvětší, nejvýše na čtvrtinu paměti tohoto počítače. The GPU compositor wasn't used: {reason} Kompozitor GPU nebyl použit: {reason} +fontWeight Thin Jemná +fontWeight ExtraLight Extrajemná +fontWeight Light Světlá +fontWeight Regular Normální +fontWeight Medium Střední +fontWeight SemiBold Polotučná +fontWeight Bold Tučná +fontWeight ExtraBold Extratučná +fontWeight Black Černá +fontWeight Italic Kurzíva diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 23fe6ba526..7d472a2951 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -2240,3 +2240,14 @@ layerLabel No Color Keine Farbe Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. Änderungen, die das ganze Dokument betreffen, etwa Füllmethode, Deckkraft oder Sichtbarkeit einer Ebene, zeichnen es vollständig neu. Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. Die Ebenen passen nicht in das GPU-Speicherbudget. Eine höhere Speichernutzung unter Voreinstellungen › Leistung erhöht das Budget, bis zu einem Viertel des Arbeitsspeichers dieses Computers. The GPU compositor wasn't used: {reason} Der GPU-Compositor wurde nicht verwendet: {reason} +cameraRaw Light Licht +fontWeight Thin Haarfein +fontWeight ExtraLight Extraleicht +fontWeight Light Leicht +fontWeight Regular Normal +fontWeight Medium Medium +fontWeight SemiBold Halbfett +fontWeight Bold Fett +fontWeight ExtraBold Extrafett +fontWeight Black Schwarz +fontWeight Italic Kursiv diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 2417fd05d4..61c1babdff 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -2271,3 +2271,13 @@ cameraRaw Amount Cantidad Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. Las ediciones que cambian todo el documento, como el modo de fusión, la opacidad o la visibilidad de una capa, lo redibujan por completo. Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. Las capas no caben en el presupuesto de memoria de la GPU. Aumentar Uso de memoria en Preferencias › Rendimiento amplía el presupuesto, hasta una cuarta parte de la memoria de este equipo. The GPU compositor wasn't used: {reason} No se usó el compositor de GPU: {reason} +fontWeight Thin Ultrafina +fontWeight ExtraLight Extrafina +fontWeight Light Fina +fontWeight Regular Normal +fontWeight Medium Medio +fontWeight SemiBold Seminegrita +fontWeight Bold Negrita +fontWeight ExtraBold Extranegra +fontWeight Black Ultraniegra +fontWeight Italic Cursiva diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index bfd8a1c709..c39252bf6b 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -2629,3 +2629,13 @@ cameraRaw Blending Fusion Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. Les modifications qui touchent tout le document, comme le mode de fusion, l'opacité ou la visibilité d'un calque, le redessinent entièrement. Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. Les calques dépassent le budget de mémoire GPU. Augmenter Utilisation de la mémoire dans Préférences › Performances relève ce budget, jusqu'au quart de la mémoire de cet ordinateur. The GPU compositor wasn't used: {reason} Le compositeur GPU n'a pas été utilisé : {reason} +fontWeight Thin Ultrafin +fontWeight ExtraLight Extrafin +fontWeight Light Maigre +fontWeight Regular Normal +fontWeight Medium Moyen +fontWeight SemiBold Demi-gras +fontWeight Bold Gras +fontWeight ExtraBold Extra-gras +fontWeight Black Noir +fontWeight Italic Italique diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 44003d1970..7d9c6a0b0c 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -2616,3 +2616,13 @@ cameraRaw Blending Pembauran Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. Suntingan yang mengubah seluruh dokumen, seperti mode campuran, opasitas, atau visibilitas layer, menggambar ulang semuanya. Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. Layer tidak muat dalam anggaran memori GPU. Menaikkan Pemakaian memori di Preferensi › Performa menaikkan anggaran, hingga seperempat memori komputer ini. The GPU compositor wasn't used: {reason} Kompositor GPU tidak digunakan: {reason} +fontWeight Thin Sangat Tipis +fontWeight ExtraLight Ekstra Tipis +fontWeight Light Tipis +fontWeight Regular Reguler +fontWeight Medium Sedang +fontWeight SemiBold SemiTebal +fontWeight Bold Tebal +fontWeight ExtraBold Ekstra Tebal +fontWeight Black Sangat Tebal +fontWeight Italic Miring diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index ab0f0540dc..7721193b37 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -2272,3 +2272,13 @@ cameraRaw Amount Quantità Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. Le modifiche che cambiano tutto il documento, come metodo di fusione, opacità o visibilità di un livello, lo ridisegnano per intero. Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. I livelli non rientrano nel budget di memoria della GPU. Aumentare Uso memoria in Preferenze › Prestazioni alza il budget, fino a un quarto della memoria di questo computer. The GPU compositor wasn't used: {reason} Il compositore GPU non è stato usato: {reason} +fontWeight Thin Sottile +fontWeight ExtraLight Extraleggero +fontWeight Light Leggero +fontWeight Regular Normale +fontWeight Medium Medio +fontWeight SemiBold Semigrassetto +fontWeight Bold Grassetto +fontWeight ExtraBold Extra-grassetto +fontWeight Black Nero +fontWeight Italic Corsivo diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index ddb901dd5b..b2eda6df20 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -2184,3 +2184,13 @@ cameraRaw Color カラー Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. レイヤーの描画モード、不透明度、表示/非表示など、ドキュメント全体に関わる編集では全体が再描画されます。 Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. レイヤーがGPUメモリの予算に収まりません。環境設定 › パフォーマンスのメモリ使用量を増やすと、このコンピューターのメモリの4分の1まで予算が増えます。 The GPU compositor wasn't used: {reason} GPUコンポジターは使用されませんでした:{reason} +fontWeight Thin 極細 +fontWeight ExtraLight 特細 +fontWeight Light 細字 +fontWeight Regular 標準 +fontWeight Medium 中間 +fontWeight SemiBold 中太 +fontWeight Bold 太字 +fontWeight ExtraBold 特太 +fontWeight Black 極太 +fontWeight Italic 斜体 diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index f43ef7baa6..f250392d13 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -2784,3 +2784,13 @@ cameraRaw Color 색상 Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. 레이어의 혼합 모드, 불투명도, 표시 여부처럼 문서 전체를 바꾸는 편집은 문서 전체를 다시 그립니다. Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. 레이어가 GPU 메모리 예산에 맞지 않습니다. 환경 설정 › 성능에서 메모리 사용량을 늘리면 이 컴퓨터 메모리의 4분의 1까지 예산이 늘어납니다. The GPU compositor wasn't used: {reason} GPU 합성기를 사용하지 않았습니다: {reason} +fontWeight Thin 아주 가늘게 +fontWeight ExtraLight 더 가늘게 +fontWeight Light 가늘게 +fontWeight Regular 보통 +fontWeight Medium 중간 +fontWeight SemiBold 반굵게 +fontWeight Bold 굵게 +fontWeight ExtraBold 더 굵게 +fontWeight Black 아주 굵게 +fontWeight Italic 기울임 diff --git a/crates/ui-egui/src/i18n/mod.rs b/crates/ui-egui/src/i18n/mod.rs index fbff4aef08..8036e1a24e 100644 --- a/crates/ui-egui/src/i18n/mod.rs +++ b/crates/ui-egui/src/i18n/mod.rs @@ -686,6 +686,20 @@ mod tests { assert_eq!(tr(Lang::EN, "Seafoam"), "Seafoam"); } + /// Font style labels are built from dynamic words (weights, "Italic"), so the literal + /// scanner cannot cover them; "Light" there is a weight, distinct from the Camera Raw + /// "Light" section (`type_tool::style_label`). + #[test] + fn font_weight_names_are_translated() { + const TERMS: &[&str] = &["Thin", "ExtraLight", "Light", "Regular", "Medium", "SemiBold", "Bold", "ExtraBold", "Black", "Italic"]; + for lang in Lang::all().filter(|l| l.complete_menus()) { + for t in TERMS { + assert!(lang.0.catalog().contextual("fontWeight", t).is_some(), "{} missing font weight: {t}", lang.code()); + } + assert_ne!(tr_ctx(lang, "cameraRaw", "Light"), tr_ctx(lang, "fontWeight", "Light"), "{}: Camera Raw Light vs the font weight", lang.code()); + } + } + /// Blend mode names come from the colour crate; each must be translated. #[test] fn blend_mode_names_are_translated() { diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index c933b37db5..098ec81449 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -2510,6 +2510,16 @@ Tone Histogram Histogram tonalny Show Selected Region Pokaż zaznaczony region cameraRaw Light Światło +fontWeight Thin Cienki +fontWeight ExtraLight Ekstra cienki +fontWeight Light Lekki +fontWeight Regular Zwykły +fontWeight Medium Średni +fontWeight SemiBold Półgruby +fontWeight Bold Pogrubiony +fontWeight ExtraBold Ekstra gruby +fontWeight Black Czarny +fontWeight Italic Kursywa Camera Raw Filter ({layer}) Filtr Camera Raw ({layer}) cameraRaw Lights Jasne tony cameraRaw Darks Ciemne tony diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index ad5ac9fe73..2b2feffb40 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2636,3 +2636,13 @@ cameraRaw Whites Brancos Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. Edições que mudam o documento inteiro, como modo de mesclagem, opacidade ou visibilidade de uma camada, redesenham tudo. Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. As camadas não cabem no orçamento de memória da GPU. Aumentar Uso de memória em Preferências › Desempenho eleva o orçamento, até um quarto da memória deste computador. The GPU compositor wasn't used: {reason} O compositor de GPU não foi usado: {reason} +fontWeight Thin Fina +fontWeight ExtraLight Extrafina +fontWeight Light Leve +fontWeight Regular Normal +fontWeight Medium Médio +fontWeight SemiBold Seminegrito +fontWeight Bold Negrito +fontWeight ExtraBold Extranegrito +fontWeight Black Ultraniegra +fontWeight Italic Itálico diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 898a51b815..f9b69d3c5f 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -2476,3 +2476,13 @@ cameraRaw Roughness Неровность Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. Правки, затрагивающие весь документ, например режим наложения, непрозрачность или видимость слоя, перерисовывают его целиком. Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. Слои не помещаются в бюджет памяти GPU. Увеличение параметра «Память» в разделе Настройки › Производительность повышает бюджет, но не больше четверти памяти этого компьютера. The GPU compositor wasn't used: {reason} Компоновщик GPU не использовался: {reason} +fontWeight Thin Тонкий +fontWeight ExtraLight Особо светлый +fontWeight Light Светлый +fontWeight Regular Обычный +fontWeight Medium Средний +fontWeight SemiBold Полужирный +fontWeight Bold Жирный +fontWeight ExtraBold Особо жирный +fontWeight Black Чёрный +fontWeight Italic Курсив diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 138eeec4ed..ec720c08f3 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2209,3 +2209,13 @@ cameraRaw Blending 混合 Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. 更改整个文档的编辑(如图层的混合模式、不透明度或可见性)会重绘整个文档。 Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. 图层超出 GPU 内存预算。在 首选项 › 性能 中提高内存使用量可增加预算,最多为本机内存的四分之一。 The GPU compositor wasn't used: {reason} 未使用 GPU 合成器:{reason} +fontWeight Thin 极细 +fontWeight ExtraLight 特细 +fontWeight Light 细体 +fontWeight Regular 常规 +fontWeight Medium 中等 +fontWeight SemiBold 半粗 +fontWeight Bold 粗体 +fontWeight ExtraBold 特粗 +fontWeight Black 黑体 +fontWeight Italic 斜体 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 128584351d..5004684712 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2178,3 +2178,13 @@ cameraRaw Blending 混合 Edits that change the whole document, such as a layer's blend mode, opacity or visibility, redraw all of it. 變更整份文件的編輯(例如圖層的混合模式、不透明度或可見度)會重繪整份文件。 Its layers don't fit the GPU memory budget. Raising Memory usage in Preferences › Performance raises the budget, up to a quarter of this computer's memory. 圖層超出 GPU 記憶體預算。在 偏好設定 › 效能 中提高記憶體使用量可增加預算,最多為本機記憶體的四分之一。 The GPU compositor wasn't used: {reason} 未使用 GPU 合成器:{reason} +fontWeight Thin 極細 +fontWeight ExtraLight 特細 +fontWeight Light 細體 +fontWeight Regular 常規 +fontWeight Medium 中等 +fontWeight SemiBold 半粗 +fontWeight Bold 粗體 +fontWeight ExtraBold 特粗 +fontWeight Black 黑體 +fontWeight Italic 斜體 diff --git a/crates/ui-egui/src/type_tool.rs b/crates/ui-egui/src/type_tool.rs index d4f90d0e9a..607cd12dcc 100644 --- a/crates/ui-egui/src/type_tool.rs +++ b/crates/ui-egui/src/type_tool.rs @@ -711,6 +711,13 @@ pub fn styles(family: &str) -> Vec { if v.is_empty() { vec![tl!("Regular").into()] } else { v } } +/// Localized style label for the dropdown. The raw string stays the engine's `fontStyle` key; +/// the words (weights and "Italic") are translated in the `fontWeight` context, where "Light" +/// means a weight — unlike the Camera Raw "Light" section. +pub fn style_label(style: &str) -> String { + style.split(' ').map(|w| crate::i18n::tr_ctx(crate::i18n::current(), "fontWeight", w)).collect::>().join(" ") +} + /// Searchable font-family combo box. fn font_picker(ui: &mut egui::Ui, current: &mut String, width: f32) -> bool { let mut changed = false; @@ -820,7 +827,7 @@ pub fn options_bar(app: &mut PhotocraftApp, ui: &mut egui::Ui) { app.ui.tool_options.type_style = style.clone(); apply(app, ui.ctx(), json!({"font": fam, "fontStyle": style})); } - let opts: Vec<(String, String)> = styles(&fam).into_iter().map(|s| (s.clone(), s)).collect(); + let opts: Vec<(String, String)> = styles(&fam).into_iter().map(|s| (s.clone(), style_label(&s))).collect(); let opts_ref: Vec<(String, &str)> = opts.iter().map(|(a, b)| (a.clone(), b.as_str())).collect(); if crate::widgets::dropdown(ui, "type-style", &mut style, &opts_ref, 110.0) { app.ui.tool_options.type_style = style.clone(); @@ -1126,7 +1133,7 @@ fn type_sections(app: &mut PhotocraftApp, ui: &mut egui::Ui, character: bool, pa }); row(ui, &mut |ui| { let mut style = if c.font_style.is_empty() { "Regular".to_string() } else { c.font_style.clone() }; - let opts: Vec<(String, String)> = styles(&fam).into_iter().map(|s| (s.clone(), s)).collect(); + let opts: Vec<(String, String)> = styles(&fam).into_iter().map(|s| (s.clone(), style_label(&s))).collect(); let opts_ref: Vec<(String, &str)> = opts.iter().map(|(a, b)| (a.clone(), b.as_str())).collect(); if crate::widgets::dropdown(ui, "props-type-style", &mut style, &opts_ref, full) { apply(app, ui.ctx(), json!({"fontStyle": style}));