From e6bc2d1472f7b5779e2e2e0d8440271fcd9b9970 Mon Sep 17 00:00:00 2001 From: syrrevshin4202-prog Date: Thu, 15 Oct 2026 13:52:41 +0300 Subject: [PATCH] i18n(ar): stage Arabic catalog and review checklist Add 348 original Arabic entries for menus, tools and New Document with catalog and staging regression tests. Keep Arabic outside LANGUAGES until bidi, caret and font delivery are verified. Document native font fallback and remaining validation; no shipped coverage change. --- ATTRIBUTION.md | 1 + .../ui-egui/src/i18n/LICENSE-translations.txt | 6 +- crates/ui-egui/src/i18n/ar.tsv | 372 ++++++++++++++++++ crates/ui-egui/src/i18n/arabic_tests.rs | 109 +++++ crates/ui-egui/src/i18n/mod.rs | 3 + docs/gaps.md | 8 +- docs/localization-ar.md | 104 +++++ docs/localization-parity.md | 15 +- docs/localization.md | 12 +- 9 files changed, 620 insertions(+), 10 deletions(-) create mode 100644 crates/ui-egui/src/i18n/ar.tsv create mode 100644 crates/ui-egui/src/i18n/arabic_tests.rs create mode 100644 docs/localization-ar.md diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 26eca62464..86f3a37a9c 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -10,6 +10,7 @@ next to them. | Path | Title | Author | Source | License | |---|---|---|---|---| +| `crates/ui-egui/src/i18n/ar.tsv` | Arabic UI translation draft (staged) | PhotoCraft contributors; AI contributor: OpenAI Codex | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) | | `crates/codecs/src/codecs/xpm/x11_colors.rs` | X11 `rgb.txt` color-name lookup table (normalized X.Org RGB values) | X.Org Foundation and X11 contributors | | MIT (X.Org app/rgb) | | `crates/ui-egui/src/i18n/el.tsv` | Greek UI translations | PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) | | `crates/ui-egui/src/i18n/de.tsv` | German UI translations | PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) | diff --git a/crates/ui-egui/src/i18n/LICENSE-translations.txt b/crates/ui-egui/src/i18n/LICENSE-translations.txt index 93a609f946..37960d7b4a 100644 --- a/crates/ui-egui/src/i18n/LICENSE-translations.txt +++ b/crates/ui-egui/src/i18n/LICENSE-translations.txt @@ -1,5 +1,5 @@ PhotoCraft's Korean, German, Spanish, Brazilian Portuguese, Italian, Ukrainian, Dutch, Czech, -Turkish, Hungarian and Serbian UI translation catalogs are licensed under MIT OR Apache-2.0, +Turkish, Hungarian, Serbian and Arabic UI translation catalogs are licensed under MIT OR Apache-2.0, at your option. The full license texts are in ../../../../LICENSE-MIT and ../../../../LICENSE-APACHE. @@ -37,3 +37,7 @@ PhotoCraft's English labels; no proprietary translation resources were used. Serbian translations: PhotoCraft contributors, original translations of PhotoCraft's English labels; no proprietary translation resources were used. + +Arabic translations (staged review draft): PhotoCraft contributors, with OpenAI Codex as an +AI contributor, original translations of PhotoCraft's English labels; no proprietary +translation resources were used. diff --git a/crates/ui-egui/src/i18n/ar.tsv b/crates/ui-egui/src/i18n/ar.tsv new file mode 100644 index 0000000000..eddcf5f69f --- /dev/null +++ b/crates/ui-egui/src/i18n/ar.tsv @@ -0,0 +1,372 @@ +# Arabic (ar): initial partial catalog, written in Modern Standard Arabic. +# Review draft, not selectable yet; see docs/localization-ar.md for release blockers. +# Columns separated by TAB: context English source Arabic translation. +# Empty context is a plain UI string; `document` disambiguates page orientation. +# Missing entries intentionally fall back to English. This is not a complete localization. +# Original contribution under MIT OR Apache-2.0, matching the PhotoCraft project license. +# Clean-room: translations were written from the meaning of PhotoCraft's English source keys. +# No proprietary translations, localization resources, or product string tables were used. +# Preserve product names, {name} placeholders, escapes (\n, \t, \\), and dialog ellipses (…). +# Glossary: Layer = طبقة; Mask = قناع; Selection = تحديد; Canvas = مساحة الرسم; +# New Document = مستند جديد; Opacity = عتامة; Fill = تعبئة. +# Count-sensitive messages are left for a later translation pass. + +# Main menus and common menu groups (menu_catalog.rs). + File ملف + Edit تحرير + Image صورة + Layer طبقة + Type نص + Select تحديد + Filter مرشح + View عرض + Window نافذة + Help مساعدة + Export تصدير + Import استيراد + Preferences تفضيلات + Transform تحويل + Adjustments تعديلات + Mode نمط + Image Rotation تدوير الصورة + New جديد + Delete حذف + Layer Style نمط الطبقة + Layer Mask قناع الطبقة + Vector Mask قناع متجهي + Smart Objects عناصر ذكية + New Fill Layer طبقة تعبئة جديدة + New Adjustment Layer طبقة تعديل جديدة + Modify تعديل + Blur تمويه + Sharpen زيادة الحدة + Noise تشويش + Show إظهار + Screen Mode نمط الشاشة + Workspace مساحة العمل + Arrange ترتيب + +# File and everyday editing commands (menu_catalog.rs). + New… جديد… + New from Clipboard جديد من الحافظة + Open… فتح… + Open As… فتح بصيغة… + Close إغلاق + Close All إغلاق الكل + Close Others إغلاق المستندات الأخرى + Save حفظ + Save As… حفظ باسم… + Save a Copy… حفظ نسخة… + Revert استعادة النسخة المحفوظة + Quick Export as PNG تصدير سريع بصيغة PNG + Export As… تصدير بصيغة… + Place Embedded… إدراج مع تضمين… + Place Linked… إدراج مع ربط… + File Info… معلومات الملف… + Print… طباعة… + Print One Copy طباعة نسخة واحدة + Exit خروج + Undo تراجع + Redo إعادة + Cut قص + Copy نسخ + Copy Merged نسخ مدمج + Paste لصق + Paste Special لصق خاص + Paste in Place لصق في الموضع نفسه + Paste Into لصق داخل التحديد + Paste Outside لصق خارج التحديد + Clear مسح + Search… بحث… + Fill… تعبئة… + Stroke… حدود… + Content-Aware Fill… تعبئة بحسب المحتوى… + Free Transform تحويل حر + Scale تحجيم + Rotate تدوير + Skew إمالة + Distort تشويه + Perspective منظور + Warp التواء + Rotate 180° تدوير 180° + Rotate 90° Clockwise تدوير 90° باتجاه عقارب الساعة + Rotate 90° Counter Clockwise تدوير 90° بعكس عقارب الساعة + Flip Horizontal قلب أفقي + Flip Vertical قلب عمودي + Color Settings… إعدادات الألوان… + Keyboard Shortcuts… اختصارات لوحة المفاتيح… + Menus… القوائم… + Toolbar… شريط الأدوات… + Settings… الإعدادات… + Interface… الواجهة… + Workspace… مساحة العمل… + Tools… الأدوات… + Performance… الأداء… + Type… النص… + +# Image, layers, selection, and view commands (menu_catalog.rs). + Grayscale تدرج رمادي + RGB Color ألوان RGB + CMYK Color ألوان CMYK + Lab Color ألوان Lab + 8 Bits/Channel 8 بت لكل قناة + 16 Bits/Channel 16 بت لكل قناة + 32 Bits/Channel 32 بت لكل قناة + Brightness/Contrast… السطوع والتباين… + Levels… المستويات… + Curves… المنحنيات… + Exposure… التعريض… + Hue/Saturation… درجة اللون والتشبع… + Color Balance… توازن الألوان… + Black & White… أبيض وأسود… + Invert عكس + Desaturate إزالة التشبع + Auto Tone درجات لونية تلقائية + Auto Contrast تباين تلقائي + Auto Color ألوان تلقائية + Image Size… حجم الصورة… + Canvas Size… حجم مساحة الرسم… + Flip Canvas Horizontal قلب مساحة الرسم أفقيًا + Flip Canvas Vertical قلب مساحة الرسم عموديًا + Crop اقتصاص + Trim… إزالة الحواف… + Reveal All إظهار الكل + Duplicate… تكرار… + Layer… طبقة… + Group… مجموعة… + Layer via Copy طبقة بالنسخ + Layer via Cut طبقة بالقص + Duplicate Layer… تكرار الطبقة… + Hidden Layers الطبقات المخفية + Rename Layer إعادة تسمية الطبقة + Blending Options… خيارات المزج… + Drop Shadow… ظل خارجي… + Solid Color… لون موحد… + Gradient… تدرج لوني… + Pattern… نقش… + Hide All إخفاء الكل + Reveal Selection إظهار التحديد + Hide Selection إخفاء التحديد + From Transparency من الشفافية + Apply تطبيق + Enable Layer Mask تفعيل قناع الطبقة + Link Layer Mask ربط قناع الطبقة + Create Clipping Mask إنشاء قناع قص + Convert to Smart Object تحويل إلى عنصر ذكي + Edit Contents تحرير المحتوى + All الكل + Deselect إلغاء التحديد + Reselect إعادة التحديد + Inverse Selection عكس التحديد + All Layers كل الطبقات + Deselect Layers إلغاء تحديد الطبقات + Color Range… نطاق الألوان… + Subject العنصر الرئيسي + Sky السماء + Select and Mask… التحديد والقناع… + Border… إطار التحديد… + Smooth… تنعيم… + Expand… توسيع… + Contract… تقليص… + Feather… تليين الحواف… + Transform Selection تحويل التحديد + Load Selection… تحميل تحديد… + Save Selection… حفظ التحديد… + Gaussian Blur… تمويه غاوسي… + Zoom In تكبير + Zoom Out تصغير + Fit on Screen ملاءمة للشاشة + Rulers المساطر + Grid شبكة + Guides خطوط إرشاد + Layers طبقات + Channels قنوات + History سجل التعديلات + Color لون + Swatches عينات الألوان + Paths مسارات + Properties خصائص + Brushes فرش + Brush Settings إعدادات الفرشاة + +# New Document dialog and its presets (new_doc_ui.rs, dialogs.rs). + New Document مستند جديد + Create إنشاء + Recent الأخيرة + Saved محفوظة + Photo صور فوتوغرافية + Print طباعة + Art & Illustration الفن والرسم التوضيحي + Web الويب + Mobile الأجهزة المحمولة + Film & Video الأفلام والفيديو + Default PhotoCraft Size الحجم الافتراضي في PhotoCraft + Clipboard الحافظة + Landscape, 6 x 4 أفقي، 6 x 4 + Landscape, 7 x 5 أفقي، 7 x 5 + Landscape, 10 x 8 أفقي، 10 x 8 + Portrait, 4 x 6 عمودي، 4 x 6 + Portrait, 5 x 7 عمودي، 5 x 7 + Square, 5 x 5 مربع، 5 x 5 + Square, 12 x 12 مربع، 12 x 12 + Letter ورق Letter + Legal ورق Legal + Tabloid ورق Tabloid + Poster ملصق + Postcard بطاقة بريدية + Comic Book قصص مصورة + Web Most Common مقاس الويب الأكثر شيوعًا + Web Minimum الحد الأدنى لمقاس الويب + Web Large مقاس ويب كبير + No saved presets yet. لا توجد إعدادات مسبقة محفوظة بعد. + Save Preset… حفظ إعداد مسبق… + Preset Name اسم الإعداد المسبق + BLANK DOCUMENT PRESETS ({n}) إعدادات مسبقة لمستندات فارغة ({n}) + PRESET DETAILS تفاصيل الإعداد المسبق + Untitled-1 بلا عنوان-1 + Width العرض + Height الارتفاع +document Orientation اتجاه الصفحة + Portrait عمودي + Landscape أفقي + Resolution الدقة + Pixels بكسل + Inches بوصة + Centimeters سنتيمتر + Millimeters مليمتر + Points نقطة + Picas بيكا + Pixels/Inch بكسل لكل بوصة + Pixels/Centimeter بكسل لكل سنتيمتر + Color Mode نمط الألوان + 8 bit 8 بت + 16 bit 16 بت + 32 bit (float) 32 بت (فاصلة عائمة) + Integer عدد صحيح + Floating point فاصلة عائمة + Background Contents محتوى الخلفية + White أبيض + Black أسود + Background Color لون الخلفية + Transparent شفاف + Custom… مخصص… + Custom مخصص + Custom background color لون خلفية مخصص + +# Preferences and common controls (prefs_ui.rs, dialogs.rs, generated preference labels). + OK موافق + Cancel إلغاء + Reset إعادة ضبط + Reset Section إعادة ضبط القسم + Restore Defaults استعادة الإعدادات الافتراضية + General عام + Interface الواجهة + Tools الأدوات + Options الخيارات + Language اللغة + Auto تلقائي + Appearance المظهر + Appearance Mode نمط المظهر + Appearance Settings… إعدادات المظهر… + Presentation العرض والتنسيق + Sync with system اتباع النظام + Dark داكن + Light فاتح + Theme السمة + Dark Theme السمة الداكنة + Light Theme السمة الفاتحة + UI font size حجم خط الواجهة + UI scale مقياس الواجهة + Canvas color لون مساحة الرسم + Canvas custom color لون مخصص لمساحة الرسم + Canvas border حد مساحة الرسم + Show tooltips إظهار التلميحات + Show home recent files إظهار الملفات الأخيرة في الشاشة الرئيسية + System title bar شريط عنوان النظام + Auto Hide Notifications إخفاء الإشعارات تلقائيًا + Notification Duration (seconds) مدة الإشعارات (بالثواني) + Applies at next launch. يسري عند التشغيل التالي. + Search settings… البحث في الإعدادات… + No matching settings لا توجد إعدادات مطابقة + Cancelled {label} تم إلغاء {label} + {set} (modified) {set} (معدّل) + These settings aren't available in PhotoCraft yet. هذه الإعدادات غير متاحة في PhotoCraft بعد. + Search بحث + Keyboard Shortcuts اختصارات لوحة المفاتيح + Menus القوائم + Toolbar شريط الأدوات + Name: الاسم: + Rename إعادة تسمية + Opacity عتامة + Fill تعبئة + Selection تحديد + Canvas مساحة الرسم + +# Common tool names (state.rs: Tool::label). + Move Tool أداة التحريك + Artboard Tool أداة لوحة التصميم + Rectangular Marquee Tool أداة التحديد المستطيل + Elliptical Marquee Tool أداة التحديد البيضاوي + Single Row Marquee Tool أداة تحديد صف واحد + Single Column Marquee Tool أداة تحديد عمود واحد + Brush Tool أداة الفرشاة + Pencil Tool أداة القلم الرصاص + Mixer Brush Tool أداة فرشاة المزج + Color Replacement Tool أداة استبدال اللون + Eraser Tool أداة الممحاة + Background Eraser Tool أداة ممحاة الخلفية + Magic Eraser Tool أداة الممحاة السحرية + Eyedropper Tool أداة القطارة + Color Sampler Tool أداة أخذ عينات الألوان + Ruler Tool أداة المسطرة + Note Tool أداة الملاحظات + Count Tool أداة العد + Lasso Tool أداة التحديد الحر + Polygonal Lasso Tool أداة التحديد الحر المضلع + Magnetic Lasso Tool أداة التحديد الحر المغناطيسي + Magic Wand Tool أداة العصا السحرية + Crop Tool أداة الاقتصاص + Perspective Crop Tool أداة اقتصاص المنظور + Frame Tool أداة الإطار + Slice Tool أداة الشرائح + Slice Select Tool أداة تحديد الشرائح + Gradient Tool أداة التدرج اللوني + Paint Bucket Tool أداة دلو التعبئة + Horizontal Type Tool أداة النص الأفقي + Vertical Type Tool أداة النص العمودي + Horizontal Type Mask Tool أداة قناع النص الأفقي + Vertical Type Mask Tool أداة قناع النص العمودي + Hand Tool أداة اليد + Rotate View Tool أداة تدوير العرض + Zoom Tool أداة التكبير والتصغير + Remove Tool أداة الإزالة + Spot Healing Brush Tool أداة فرشاة إصلاح البقع + Healing Brush Tool أداة فرشاة الإصلاح + Patch Tool أداة الرقعة + Content-Aware Move Tool أداة التحريك بحسب المحتوى + Red Eye Tool أداة إزالة احمرار العين + Clone Stamp Tool أداة ختم الاستنساخ + Pattern Stamp Tool أداة ختم النقش + History Brush Tool أداة فرشاة السجل + Blur Tool أداة التمويه + Sharpen Tool أداة زيادة الحدة + Smudge Tool أداة التلطيخ + Dodge Tool أداة التفتيح + Burn Tool أداة التغميق + Sponge Tool أداة الإسفنجة + Quick Selection Tool أداة التحديد السريع + Object Selection Tool أداة تحديد العناصر + Pen Tool أداة القلم + Freeform Pen Tool أداة القلم الحر + Curvature Pen Tool أداة قلم المنحنيات + Add Anchor Point Tool أداة إضافة نقطة ارتكاز + Delete Anchor Point Tool أداة حذف نقطة ارتكاز + Convert Point Tool أداة تحويل النقاط + Path Selection Tool أداة تحديد المسار + Direct Selection Tool أداة التحديد المباشر + Rectangle Tool أداة المستطيل + Ellipse Tool أداة الشكل البيضاوي + Triangle Tool أداة المثلث + Polygon Tool أداة المضلع + Line Tool أداة الخط + Custom Shape Tool أداة الشكل المخصص diff --git a/crates/ui-egui/src/i18n/arabic_tests.rs b/crates/ui-egui/src/i18n/arabic_tests.rs new file mode 100644 index 0000000000..b44a6f4706 --- /dev/null +++ b/crates/ui-egui/src/i18n/arabic_tests.rs @@ -0,0 +1,109 @@ +//! The Arabic draft is validated without making it a selectable UI language. UI bidi, caret +//! behaviour and web font delivery must be verified before it is added to the language registry. + +use super::catalog::{Catalog, parse_entries, placeholders}; +use super::*; + +const DRAFT: &str = include_str!("ar.tsv"); + +#[test] +fn arabic_draft_preserves_catalog_contracts() { + let (entries, errors) = parse_entries(DRAFT); + assert!(errors.is_empty(), "Arabic draft: {errors:?}"); + assert!(!entries.is_empty(), "the Arabic draft must contain translations"); + let mut seen = std::collections::HashSet::new(); + for (context, source, translation) in &entries { + assert!(seen.insert((context, source)), "duplicate Arabic key: {context:?} {source:?}"); + if context == "@plural" { + let sources: Vec<_> = source.split('|').collect(); + assert_eq!(sources.len(), 2, "plural source must be one|other: {source:?}"); + assert_eq!(translation.split('|').count(), 6, "Arabic needs zero/one/two/few/many/other: {source:?}"); + let mut want = placeholders(sources[1]); + want.sort_unstable(); + for form in translation.split('|') { + let mut got = placeholders(form); + got.sort_unstable(); + assert_eq!(want, got, "Arabic plural placeholders: {source:?}"); + } + continue; + } + let mut want = placeholders(source); + let mut got = placeholders(translation); + want.sort_unstable(); + got.sort_unstable(); + assert_eq!(want, got, "Arabic placeholders: {context:?} {source:?}"); + if context.is_empty() { + assert_eq!(source.ends_with('…'), translation.ends_with('…'), "Arabic dialog ellipsis: {source:?}"); + } + if context == "@id" { + assert!(crate::menus::is_live(source) || crate::menu_catalog::CATALOG.iter().any(|m| m.3 == source), "unknown Arabic command id: {source:?}"); + } + } +} + +#[test] +fn packed_arabic_draft_matches_its_source() { + assert_eq!(unpack(catalog!("ar")).expect("packed Arabic draft"), DRAFT); +} + +#[test] +fn arabic_draft_tracks_live_menu_tool_and_document_category_labels() { + let catalog = Catalog::parse(DRAFT); + let menus: std::collections::BTreeSet<_> = crate::menu_catalog::CATALOG + .iter() + .filter_map(|(path, _, _, _)| path.first().copied()) + .chain(crate::menus::TOP_MENUS) + .collect(); + for source in menus { + assert!(catalog.plain(source).is_some(), "untranslated Arabic main menu: {source}"); + } + for tool in crate::state::Tool::ALL { + assert!(catalog.plain(tool.label()).is_some(), "untranslated Arabic tool: {}", tool.label()); + } + for &(category, _) in crate::new_doc_ui::CATEGORIES { + assert!(catalog.plain(category).is_some(), "untranslated Arabic New Document category: {category}"); + } +} + +#[test] +fn arabic_draft_covers_the_main_menus_and_new_document_workflow() { + let catalog = Catalog::parse(DRAFT); + for (source, translation) in [ + ("File", "ملف"), + ("Layer", "طبقة"), + ("New Document", "مستند جديد"), + ("Width", "العرض"), + ("Height", "الارتفاع"), + ("Create", "إنشاء"), + ("Cancel", "إلغاء"), + ] { + assert_eq!(catalog.plain(source), Some(translation), "Arabic workflow label: {source}"); + } + assert_eq!(catalog.contextual("document", "Orientation"), Some("اتجاه الصفحة")); + assert_eq!(catalog.contextual("unrelated", "Orientation"), None, "a document-specific meaning stays scoped"); + let presets = catalog.plain("BLANK DOCUMENT PRESETS ({n})").expect("New Document preset count"); + assert_eq!(fmt(presets, &[("n", "12")]), "إعدادات مسبقة لمستندات فارغة (12)"); + let cancelled = catalog.plain("Cancelled {label}").expect("cancellation label"); + assert_eq!(fmt(cancelled, &[("label", "خلفية {Original} 2026.psd")]), "تم إلغاء خلفية {Original} 2026.psd", "user-provided names are preserved"); +} + +#[test] +fn arabic_draft_does_not_activate_an_unverified_interface() { + assert!(!Lang::all().any(|lang| lang.code() == "ar"), "Arabic stays staged until rendering is verified"); + for code in ["ar", "AR"] { + assert_eq!(Lang::from_code(code), None, "staged code: {code}"); + } + for tag in ["ar", "ar-LB", "ar-SA", "ar_EG.UTF-8"] { + assert_eq!(lang_from_tag(tag), None, "staged locale: {tag}"); + } + system::with_system_tags(&["ar-LB"], || { + assert_eq!(system_lang(), Lang::EN); + assert_eq!(Lang::from_pref("auto"), Lang::EN); + assert_eq!(Lang::from_pref("ar"), Lang::EN); + }); + system::with_system_tags(&["ar-LB", "fr-FR"], || { + assert_eq!(system_lang().code(), "fr", "Auto skips an unregistered Arabic draft"); + assert_eq!(Lang::from_pref("en"), Lang::EN, "saved manual choices take precedence"); + }); + assert_eq!(dir_for_code("ar"), Dir::Rtl, "the existing direction rule remains available"); +} diff --git a/crates/ui-egui/src/i18n/mod.rs b/crates/ui-egui/src/i18n/mod.rs index b976e395fc..9d68d1d6a9 100644 --- a/crates/ui-egui/src/i18n/mod.rs +++ b/crates/ui-egui/src/i18n/mod.rs @@ -1321,3 +1321,6 @@ mod tests { #[cfg(test)] mod live_tests; + +#[cfg(test)] +mod arabic_tests; diff --git a/docs/gaps.md b/docs/gaps.md index faf0884c89..5ec2d833a1 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where PhotoCraft falls short of Photoshop -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-13 · **Change:** minor (G1: smart filter masks show on PSD open, Photoshop-oracle floor 188/258; G10: DPX read and write, #1049, Cineon read; G1: CMYK Hue/Saturation and Color Balance keep the black ink; G1: CMYK Posterize on the stored values, psd-tools oracle floor 242/309; G1: CMYK adjustment layers composite on the document's inks, Photoshop-oracle floor 165/258; G1: CMYK Brightness/Contrast on the inks, CMYK Threshold's luma; G1: modern Brightness/Contrast's brightness curve matches Photoshop, Photoshop-oracle floor 151/258; G1: Lab documents composite on their stored L, a, b, Photoshop-oracle floor 152/258; G1: Levels on whole levels at every step, Photoshop-oracle floor 146/258, psd-tools 238/309; G1: 32-bit Brightness/Contrast legacy, Channel Mixer, Photo Filter and Black & White tint unclipped as in Photoshop, Photoshop-oracle floor 149/258; G1: mask feathers blur with their exact variance, psd-tools oracle floor 240/309; G1: Threshold splits on Photoshop's luminosity, psd-tools oracle floor 241/309; G1: pass-through clipping base with an adjustment renders isolated, psd-tools oracle floor 240/309; G1: 16-bit Posterize as Photoshop bins it, psd-tools oracle floor 241/309; G1: Gradient Map driven by the W3C luminosity, Photoshop-oracle floor 147/258; G7: Field Blur's on-canvas pins, #3373; G4: Hue Jitter amount track, #3825 partial; G4: minimum field interaction, #3825 partial; G1: CMYK Invert, Posterize and Threshold on the inks, 16-bit Lab Invert; Photoshop-oracle floor 145/258; G11: `.atn` import maps 112 events: Select and Mask, Filter Gallery Spatter, Ripple, Crystallize, Pattern Fill layers, mask targeting, Step Backward, nudges in points, Bitmap mode; G5: Free Transform H/V skew fields; G9: toolbar tool shortcut editing; refreshed against main: G2, G5, G7, G9, G10, G13, G14, G17 items that landed; G10: DPX read and write, #1049; G4: checkbox-only Brush Settings rows; G11: Load/Save Actions `.atn` landed, AUTO-219-2 partial; G5: hold-a-key spring-loaded tools landed, #2672; G1: #2465 fixed; stale missing-tool rows corrected: Color Replacement, Red Eye and Add/Delete Anchor Point are live tools, so only Art History Brush is missing; no estimate changed) · **Target:** Adobe Photoshop 2026 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (G13: Arabic review draft staged, no shipped coverage change; G1: smart filter masks show on PSD open, Photoshop-oracle floor 188/258; G10: DPX read and write, #1049, Cineon read; G1: CMYK Hue/Saturation and Color Balance keep the black ink; G1: CMYK Posterize on the stored values, psd-tools oracle floor 242/309; G1: CMYK adjustment layers composite on the document's inks, Photoshop-oracle floor 165/258; G1: CMYK Brightness/Contrast on the inks, CMYK Threshold's luma; G1: modern Brightness/Contrast's brightness curve matches Photoshop, Photoshop-oracle floor 151/258; G1: Lab documents composite on their stored L, a, b, Photoshop-oracle floor 152/258; G1: Levels on whole levels at every step, Photoshop-oracle floor 146/258, psd-tools 238/309; G1: 32-bit Brightness/Contrast legacy, Channel Mixer, Photo Filter and Black & White tint unclipped as in Photoshop, Photoshop-oracle floor 149/258; G1: mask feathers blur with their exact variance, psd-tools oracle floor 240/309; G1: Threshold splits on Photoshop's luminosity, psd-tools oracle floor 241/309; G1: pass-through clipping base with an adjustment renders isolated, psd-tools oracle floor 240/309; G1: 16-bit Posterize as Photoshop bins it, psd-tools oracle floor 241/309; G1: Gradient Map driven by the W3C luminosity, Photoshop-oracle floor 147/258; G7: Field Blur's on-canvas pins, #3373; G4: Hue Jitter amount track, #3825 partial; G4: minimum field interaction, #3825 partial; G1: CMYK Invert, Posterize and Threshold on the inks, 16-bit Lab Invert; Photoshop-oracle floor 145/258; G11: `.atn` import maps 112 events: Select and Mask, Filter Gallery Spatter, Ripple, Crystallize, Pattern Fill layers, mask targeting, Step Backward, nudges in points, Bitmap mode; G5: Free Transform H/V skew fields; G9: toolbar tool shortcut editing; refreshed against main: G2, G5, G7, G9, G10, G13, G14, G17 items that landed; G10: DPX read and write, #1049; G4: checkbox-only Brush Settings rows; G11: Load/Save Actions `.atn` landed, AUTO-219-2 partial; G5: hold-a-key spring-loaded tools landed, #2672; G1: #2465 fixed; stale missing-tool rows corrected: Color Replacement, Red Eye and Add/Delete Anchor Point are live tools, so only Art History Brush is missing; no estimate changed) · **Target:** Adobe Photoshop 2026 Every known shortfall against Photoshop 2026 (27.11.0), one entry each, ranked by user impact on the way to beta. This is the work list agents pick from: take the highest-ranked entry that @@ -247,6 +247,11 @@ what an agent can't finish alone. ## Localization gaps ### G13. Hindi, Arabic, Vietnamese, RTL and engine messages +- **Draft progress (2026-10-15):** an original Arabic catalog for common menus, tools and + New Document is staged outside the language registry, with catalog-integrity and staging + tests. Native installed Arabic font fallback exists; UI bidi/caret, panel layout and web font + delivery remain open. See [Arabic notes](localization-ar.md). This does not close G13 or + change shipped coverage or readiness estimates. - **Missing:** catalogs for Hindi, Arabic and Vietnamese (3 of the 12 key languages); right-to- left UI layout; Devanagari fallback fonts (Thai #1909 and Khmer, Lao and Myanmar #3259 landed); engine error and status messages in English in every language; browser-locale detection and CJK fonts on the web; Japanese IME on @@ -270,6 +275,7 @@ what an agent can't finish alone. | Date | Change | Summary | |---|---|---| +| 2026-10-15 | minor | G13: Arabic catalog staged for review with integrity and staging tests; native fallback evidence documented; bidi/caret and web-font work remain open; estimates unchanged | | 2026-10-14 | minor | G1: a PSD smart object's filter mask shows when the file opens (Photoshop stores the filtered pixels unmasked); export stores them that way too; Photoshop-oracle floor 185 → 188 of 258 | | 2026-10-13 | minor | G14: D90 image area measured (4288 × 2848 at (10, 10)); gap remains open | | 2026-10-14 | minor | Corpus floors raised to the measured results of the CMYK, Lab, 32-bit, Levels, Threshold, Posterize, feather and pass-through fixes landed together: Photoshop-authored 165 → 185 of 258, io 146 → 148 of 170, psd-tools 242 → 249 of 309 | diff --git a/docs/localization-ar.md b/docs/localization-ar.md new file mode 100644 index 0000000000..933247270e --- /dev/null +++ b/docs/localization-ar.md @@ -0,0 +1,104 @@ +# Arabic localization: first review batch + +Status: **staged, not selectable**. This is an original Modern Standard Arabic +catalog for review, not a claim that the application has a working Arabic UI. +The draft is `crates/ui-egui/src/i18n/ar.tsv`; it is deliberately absent from +`i18n::LANGUAGES`, so Arabic system locales continue to follow the existing +fallback and are not switched to an incomplete interface. + +## Scope + +The first batch covers common menu labels, everyday tools, New Document controls, +shared buttons and language preferences. Untranslated strings remain English +when the catalog is eventually registered. Engine errors, API command IDs, +file names, user-entered layer names and preset names are outside this batch. + +The translations were written from the meaning of the English source labels. +No proprietary localization resource was used. They have the same +MIT OR Apache-2.0 license as PhotoCraft; see `LICENSE-translations.txt` beside +the catalog. A human Arabic language review is still required. + +## Vocabulary + +Use concise Modern Standard Arabic rather than a regional dialect. Preserve +product names (PhotoCraft, ArtCraft), format names (PSD, PNG), technical codes +(RGB, CMYK, Lab), numbers and `{name}` placeholders. Keep the source ellipsis +on commands that open dialogs. Do not put visual-order text or Arabic +presentation-form characters into the catalog: translations must stay in logical +Unicode order for a future bidi-capable renderer. + +| English | Arabic | Meaning | +|---|---|---| +| Layer | طبقة | One independently editable element of the document | +| Layer Mask | قناع الطبقة | Visibility control that preserves the layer's pixels | +| Selection | تحديد | The area on which an operation acts | +| Canvas | مساحة الرسم | The document's drawing area | +| Artboard | لوحة تصميم | A separate layout area within a document | +| Opacity | عتامة | How opaque an element is | +| Fill | تعبئة | Filling an area; keep distinct from opacity | +| Resolution | دقة | Pixel density; not the document's width and height | +| Preset | إعداد مسبق | A reusable set of settings | +| Smart Object | عنصر ذكي | A layer retaining its source content | + +## Rendering work required before registration + +Native script-font fallback already includes Arabic families in +`crates/text/src/scripts.rs` and loads installed fonts through +`cjk_fonts.rs`. That helps glyph coverage, including Arabic layer names, but +does not solve bidirectional layout. Availability depends on installed fonts; +the native system-font path is not available on the web. + +The current egui 0.36 UI shapes Arabic words but does not correctly order a +mixed-direction line or handle its text caret. The existing shell mirrors for +RTL language codes, while panel interiors, dialogs and menu rows still need +work. These issues are separate from the document text engine. + +Before adding `ar` to `LANGUAGES`: + +1. Verify correct Arabic and mixed Arabic/English word order, punctuation and + numerals in labels and editable fields, with matching caret and selection. +2. Verify glyph coverage on Windows, macOS, Linux and the web, including the + language's own name in Preferences before it is selected. +3. Inspect New Document, Preferences, menus and layer names in small and large + windows, in dark and light themes. Check English → Arabic → English in + one session and saved preferences after restart. +4. Add Arabic's six integer plural forms (zero, one, two, few, many, other) + before translating `@plural` messages. Do not use the English plural rule. +5. Update tests that currently assume every registered language is LTR, review + partial-catalog coverage expectations, and keep `complete_menus` false + until its coverage gates actually pass. + +## Verification + +`i18n::arabic_tests` exercises the actual catalog parser, placeholder and +ellipsis integrity, source-key presence, packing round trip and the staging +gate. Run it along with the normal localization checks: + +```sh +cargo test -p photocraft-ui-egui --locked arabic +cargo test -p photocraft-ui-egui --locked +cargo clippy -p photocraft-ui-egui --all-targets --locked -- -D warnings +cargo xtask i18n-coverage +cargo xtask layers +cargo xtask wasm +``` + +The ordinary coverage report lists registered languages only; the staged +catalog must not be described as a shipped or fully translated language. +An HTML or document preview is not evidence that egui renders Arabic correctly; +the rendering checks above require the real application. + +## ملاحظات للمراجع العربي + +هذه بداية تعريب للمراجعة، ولن يظهر خيار العربية في البرنامج بهذه الدفعة. +اختيار المصطلحات يهدف إلى جعل الأدوات مفهومة ومتسقة، مع الحفاظ على أسماء +الملفات والصيغ كما هي. + +عند المراجعة، افحص معنى العبارة في مكان استخدامها، لا ترجمة الكلمة وحدها. +مثلًا: «مساحة الرسم» هي حدود الصورة، أما «لوحة التصميم» فهي مساحة تصميم مستقلة +داخل المستند. «الحفظ» يحفظ المشروع، و«التصدير» ينتج ملفًا للاستخدام أو المشاركة. + +بعد تجهيز عرض العربية، ينبغي تجربة عبارة مثل +«تصميم PhotoCraft رقم 12 — طبقة جديدة» وفحص ترتيب الكلمات والأرقام، وتحريك +مؤشر الكتابة وتحديد جزء من النص ونسخه ولصقه. صحة الترجمة وحدها لا تكفي +لإثبات صحة العرض والتحرير. diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 0b2be85595..0420a4dd7b 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,10 +1,11 @@ # Localization parity -> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-13 · **Change:** minor (Spanish dynamic labels; previously minor: Serbian catalog) · **Target:** Adobe Photoshop 2026 +> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-15 · **Change:** minor (Arabic draft staged outside the language registry; native Arabic font fallback documented; readiness estimates unchanged) · **Target:** Adobe Photoshop 2026 Per-language status of PhotoCraft's UI. How catalogs work and how to add one: [`localization.md`](localization.md). Language notes: [Korean](localization-ko.md), [Spanish](localization-es.md), -[Simplified Chinese](localization-zh-hans.md), [Italian](localization-it.md). +[Simplified Chinese](localization-zh-hans.md), [Italian](localization-it.md), +[Arabic draft](localization-ar.md). **How measured.** `cargo xtask i18n-coverage` (`xtask/src/i18n_coverage.rs`) defines the key universe: `tl!("…")` literals and `trn(` plurals in `ui-egui` (tests excluded), menu-catalog @@ -34,7 +35,7 @@ speakers, ~55% ready. Remaining: 80–140 h, plus native-speaker review (recorde | Simplified Chinese | `zh-hans` | 1,608 / 1,608 (100%) | 2,366 | dialogs, tooltips yes; engine messages English | CJK fonts (lazy loader), IME preedit/commit, vertical type | no | partial | 8–12 h | | Spanish | `es` | 1,844 / 1,844 (100%) | 4,010 | as above; complete dynamic UI key set | Latin | no | partial | 6–10 h | | Hindi | `hi` | 0 (0%) | – | – | Devanagari shaping in the text engine (parley/HarfRust); no Devanagari fallback font (TYPE-218-3) | no | none | 20–30 h | -| Arabic | `ar` | 0 (0%) | – | – | Arabic shaping and bidi in the text engine, Arabic fallback font; RTL shell layout but not inside panels, and UI labels in LTR word order (DIST-220-4), paragraph direction has no UI (TYPE-218-2), layer names as tofu (#1408, #1693) | no | none | 40–60 h | +| Arabic | `ar` | 0 shipped (not registered) | review draft | common menus, tools and New Document draft only | Arabic shaping and bidi in the text engine; native installed-font fallback; RTL shell layout but not inside panels; UI word order and caret remain incomplete (DIST-220-4) | no | staged, not selectable | 40–60 h | | French | `fr` | 1,608 / 1,608 (100%) | 2,766 | as above | Latin | no | partial | 6–10 h | | Portuguese (Brazil) | `pt-br` | 1,608 / 1,608 (100%) | 2,788 | as above | Latin; every `pt` locale uses it | no | partial | 6–10 h | | Indonesian | `id` | 1,608 / 1,608 (100%) | 2,764 | as above | Latin | no | partial | 6–10 h | @@ -66,10 +67,13 @@ engine localization or native review is complete. ## Cross-language gaps - Engine error, status and parameter-help messages are English in every language. +- The initial Arabic catalog is staged outside `LANGUAGES` for review. It does not change + automatic locale matching or shipped coverage. See [Arabic notes](localization-ar.md). - Right-to-left UI layout is partial (2026-10-10): the shell mirrors for Arabic, Hebrew, Persian, Urdu and other right-to-left codes (`direction.rs`), but panel interiors, dialogs, menu rows, - submenus and document tabs stay left to right. UI labels also lack an Arabic fallback font, and - egui 0.36 joins letters within a word but orders a line's words left to right (no bidi). + submenus and document tabs stay left to right. Native UI labels can use installed Arabic + fallback fonts (`cjk_fonts.rs`, `photocraft_text::scripts`), but this does not supply web fonts + or bidi: egui 0.36 joins letters within a word but orders a line's words left to right. - Web build: no browser-locale detection, no CJK web fonts. - WebAssembly plug-ins disappear from Filter › Plug-ins when the UI isn't English (#2540). - A user couldn't find the language option (#2532): it is in Preferences › Interface. @@ -78,6 +82,7 @@ engine localization or native review is complete. | Date | Change | Summary | |---|---|---| +| 2026-10-15 | minor | Arabic catalog staged for review with parser and packing tests; no registry activation or readiness increase; native Arabic font fallback evidence corrected | | 2026-10-10 | major | First version, measured from the catalogs with the `i18n-coverage` rules | | 2026-10-10 | minor | Right-to-left shell layout (menu bar, title, options and status bars, toolbox and dock sides) | | 2026-10-11 | minor | Czech dynamic status/notice and hardware text, render labels and Navigator zoom context; engine messages remain English | diff --git a/docs/localization.md b/docs/localization.md index 36e09f8a55..15d17adcfd 100644 --- a/docs/localization.md +++ b/docs/localization.md @@ -100,9 +100,10 @@ title, options and status bars read from the right (`crates/ui-egui/src/directio direction follows the language code, so a catalog needs no extra setting. Not mirrored yet: panel interiors, dialogs, menu rows (shortcuts stay on the right), submenus -(they open to the right), document tabs and the canvas. Before an Arabic catalog reads -correctly, the UI also needs an Arabic fallback font (the bundled UI fonts have no Arabic -glyphs) and bidirectional word order: egui 0.36 shapes each right-to-left word with HarfRust, +(they open to the right), document tabs and the canvas. The bundled UI fonts have no Arabic +glyphs, but native `cjk_fonts` now loads installed Arabic fonts through +`photocraft_text::scripts`; that system-font path is unavailable on the web. Before an Arabic +catalog reads correctly, the UI still needs bidirectional word order: egui 0.36 shapes each right-to-left word with HarfRust, so letters join, but lays a line's words out left to right, and its caret indexing is off in right-to-left text (emilk/egui#8576, #8577). Document text is laid out by the text engine. @@ -114,6 +115,11 @@ and has no effect on the web build: PHOTOCRAFT_UI_DIRECTION=rtl cargo run -p photocraft-ui-egui --example snapshot -- --out rtl.png ``` +An initial Arabic review catalog is staged in `i18n/ar.tsv`, outside the language registry. +It does not add a language choice or change automatic locale selection. See the +[Arabic vocabulary and registration checklist](localization-ar.md) for scope and remaining +rendering work. + ## Fonts The native lazy CJK font loader prioritises the selected Japanese, Korean or Chinese script.