Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

M16: drop fork-only Japanese packaging from PR #114

Brandon Thomas586479a30900
diff --git a/ROADMAP.md b/ROADMAP.md
index 34ef427f6..c790c5662 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -29,7 +29,7 @@ duplicate Local entries #22, black GPU exports on an Intel iGPU #78).
| **Workflow & library** | ~85% (single machine) | Robust catalog (journal + snapshots, background compaction, crash-tested), 85k-photo libraries stay responsive, Local browsing with automatic cleanup, XMP interop, keywords, smart albums, Move import | Opening an 85k library takes 1.7–4.7 s; no cloud sync (out of scope), no tablet companion (#74, roadmap), shared albums, publish services, tethering |
| **Classic modules** | ~30% | Geotagging from GPX track logs, soft proofing (partial), slideshow (basic) | **Map view, Book, Print, Slideshow module, Web, publish services**: ~40 tracker rows ⬜ |
| **HDR & video** | 0% | | HDR edit/display/export; video play/trim/edit/export |
-| **Platform & robustness** | ~70% | macOS native; Windows/Linux builds; web via WASM; no-panic lints workspace-wide, `unsafe` confined to `crates/sysmem`; failed saves are reported; GPU errors fall back to CPU | Windows installer UI unverified on Windows (PR #79); GPU path proven only on Apple + user reports; local Japanese/English UI (see docs/localization-ja.md); remaining technical errors and other languages; accessibility partial; headless UI tests time out under machine load |
+| **Platform & robustness** | ~70% | macOS native; Windows/Linux builds; web via WASM; no-panic lints workspace-wide, `unsafe` confined to `crates/sysmem`; failed saves are reported; GPU errors fall back to CPU | Windows installer UI unverified on Windows (PR #79); GPU path proven only on Apple + user reports; Japanese/English UI (see docs/localization-ja.md); remaining technical errors and other languages; accessibility partial; headless UI tests time out under machine load |
### By kind of user
diff --git a/apps/lightcraft/Cargo.toml b/apps/lightcraft/Cargo.toml
index 95293a086..46acbb73c 100644
--- a/apps/lightcraft/Cargo.toml
+++ b/apps/lightcraft/Cargo.toml
@@ -6,10 +6,6 @@ license.workspace = true
publish = false
default-run = "lightcraft"
-[features]
-# Keep upstream defaults; only the local Japanese bundle opts into isolated storage and Japanese startup.
-japanese-local = []
-
[lints]
workspace = true
diff --git a/apps/lightcraft/src/main.rs b/apps/lightcraft/src/main.rs
index e835917f8..ea0f0c112 100644
--- a/apps/lightcraft/src/main.rs
+++ b/apps/lightcraft/src/main.rs
@@ -4,7 +4,7 @@
//!
//! The library (catalog, presets, thumbnail cache) lives in `--library DIR`, else
//! `$LIGHTCRAFT_LIBRARY`, else the library last opened with Settings → Open Library…, else
-//! `~/Pictures/LightCraft Library` (`LightCraft Japanese Library` with `japanese-local`); a new library starts with the
+//! `~/Pictures/LightCraft Library`; a new library starts with the
//! procedural demo photos unless `--no-demo` or files are given. Files and folders on the command
//! line are imported (duplicates are skipped). `--memory` runs an in-memory session that writes
//! nothing (demo photos unless files are given; used by the README showcase scripts).
@@ -67,8 +67,7 @@ impl eframe::App for App {
fn config_dir() -> Option<std::path::PathBuf> {
if cfg!(target_os = "macos") {
- let name = if cfg!(feature = "japanese-local") { "LightCraft Japanese" } else { "LightCraft" };
- std::env::var_os("HOME").map(|h| std::path::PathBuf::from(h).join("Library/Application Support").join(name))
+ std::env::var_os("HOME").map(|h| std::path::PathBuf::from(h).join("Library/Application Support/LightCraft"))
} else if cfg!(windows) {
std::env::var_os("APPDATA").map(|a| std::path::PathBuf::from(a).join("LightCraft"))
} else {
@@ -85,18 +84,7 @@ fn load_prefs() -> Option<UiState> {
return None;
}
let bytes = std::fs::read(config_dir()?.join("ui.json")).ok()?;
- decode_saved_ui(&bytes)
-}
-
-fn decode_saved_ui(bytes: &[u8]) -> Option<UiState> {
- let mut saved: serde_json::Value = serde_json::from_slice(bytes).ok()?;
- if saved.get("language").is_none()
- && let Some(language) = saved.pointer("/settings/language").cloned()
- && let Some(object) = saved.as_object_mut()
- {
- object.insert("language".into(), language);
- }
- serde_json::from_value::<UiState>(saved).ok().map(UiState::sanitized)
+ serde_json::from_slice::<UiState>(&bytes).ok().map(UiState::sanitized)
}
fn save_prefs(app: &LightcraftApp) {
@@ -328,13 +316,7 @@ fn main() -> eframe::Result {
.filter(|p| !p.is_empty() && std::env::var_os("LIGHTCRAFT_LIBRARY").is_none())
.map(Into::into)
});
- let library_dir = library_dir.or_else(|| {
- if let Some(path) = std::env::var_os("LIGHTCRAFT_LIBRARY").filter(|p| !p.is_empty()) {
- return Some(path.into());
- }
- let name = if cfg!(feature = "japanese-local") { "LightCraft Japanese Library" } else { "LightCraft Library" };
- std::env::var_os("HOME").map(|home| std::path::PathBuf::from(home).join("Pictures").join(name))
- });
+ let library_dir = library_dir.or_else(lightcraft_engine::library::default_dir);
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_title("LightCraft")
@@ -355,9 +337,6 @@ fn main() -> eframe::Result {
Box::new(move |cc| {
let session = open_session(in_memory, library_dir, seed_demo && files.is_empty());
let mut app = LightcraftApp::new(session, services());
- if cfg!(feature = "japanese-local") {
- app.ui.language = lightcraft_ui_egui::i18n::Language::Ja;
- }
if let Some(ui) = prefs {
app.ui = ui;
}
@@ -384,15 +363,3 @@ fn main() -> eframe::Result {
)
}
-#[cfg(test)]
-mod preference_tests {
- use super::decode_saved_ui;
- use lightcraft_ui_egui::i18n::Language;
- #[test]
- fn language_migrates_and_upstream_choice_wins() {
- assert_eq!(decode_saved_ui(br#"{"settings":{"language":"ja"}}"#).unwrap().language, Language::Ja);
- assert_eq!(decode_saved_ui(br#"{"language":"en","settings":{"language":"ja"}}"#).unwrap().language, Language::En);
- assert_eq!(decode_saved_ui(br#"{"language":"ja"}"#).unwrap().language, Language::Ja);
- assert!(decode_saved_ui(b"not JSON").is_none());
- }
-}
diff --git a/docs/localization-ja.md b/docs/localization-ja.md
index a6ce630a1..1cd41b469 100644
--- a/docs/localization-ja.md
+++ b/docs/localization-ja.md
@@ -1,7 +1,7 @@
-# LightCraft 日本語版
+# LightCraft 日本語表示
-開発元に追加された基本的な日本語表示(PR #110)を、編集・読み込み・書き出し画面へ広げています。
-言語設定は開発元と同じ `ui.json` の `language` を使います。以前のローカル版の `settings.language` も読み込みます。
+LightCraft は日本語と英語(English)の表示に対応しています。
+言語設定は `ui.json` の `language` に保存します。
- 「編集 → 言語」または「設定 → 一般 → 言語」で日本語とEnglishを切り替えます。選択は次回起動にも引き継ぎます。
- メニュー、写真編集、マスク、切り抜き、設定、読み込み、書き出し、主な処理状況を翻訳しています。
@@ -9,14 +9,6 @@
- 翻訳は表示層で行います。操作コマンドのID、写真のファイル名、入力したメタデータを変更しません。
- 翻訳されていない技術的なエラー、追加情報、リリースノートは英語で表示します。
-## 保存場所
-
-日本語版アプリは「LightCraft 日本語.app」です。既存の公式版とは別に配置します。
-初期ライブラリは `~/Pictures/LightCraft Japanese Library`、設定は
-`~/Library/Application Support/LightCraft Japanese/ui.json` に保存します。
-既存のライブラリを使用する場合は、そのライブラリを使用中の公式版を閉じてから、
-日本語版の「ファイル → ライブラリを開く…」で選びます。
-
## 翻訳の保守
静的な表示文言は `crates/ui-egui/locales/ja.json`、可変値を含む表示文言は
@@ -27,7 +19,3 @@
表示・フォント・言語の切り替え・設定の保存・コマンドIDの保持は
`cargo test -p lightcraft-ui-egui i18n::tests` で検証します。
-
-通常ビルドでは既存の英語表示と保存場所を維持します。別アプリの日本語版は
-`cargo build --release -p lightcraft -p lightcraft-cli --features lightcraft/japanese-local`
-でビルドしてから `scripts/package-japanese-macos.py` で作成します。
diff --git a/docs/parity.md b/docs/parity.md
index c890c2158..2f481ca49 100644
--- a/docs/parity.md
+++ b/docs/parity.md
@@ -504,7 +504,7 @@ under the UI command that wraps it (a no-op error); the UI command now wins.
| LR-BEHAV-EMPTY-STATES | Empty states | P1 | ✅ | `crates/ui-egui/src/panels/mod.rs` (`empty_message`) | |
| LR-BEHAV-TOOLTIPS | Tooltips with shortcuts | P0 | ✅ | `crates/ui-egui/src/panels/bottombar.rs` | |
| LR-BEHAV-ACCESS | Accessibility | P2 | 🟡 | `crates/ui-egui/src/widgets.rs`, `crates/ui-egui/src/panels/grid.rs` | AccessKit (VoiceOver / Narrator / AT-SPI): sliders announce control and value, buttons / icon buttons / dropdowns / section headers / sources their labels and state, grid thumbnails file name, rating, flag and label; the canvas tools (crop, masks) are pointer-only; not audited with a screen reader |
-| LR-BEHAV-LOCALIZE | Localisation | P2 | 🟡 | `crates/ui-egui/src/i18n.rs`, `crates/ui-egui/locales/`, `docs/localization-ja.md` | Local Japanese/English UI with persisted language preference and Japanese regular/bold fonts; menus, edit, crop/masks, settings, import/export and primary progress messages. Technical errors/release notes and other locales remain untranslated. |
+| LR-BEHAV-LOCALIZE | Localisation | P2 | 🟡 | `crates/ui-egui/src/i18n.rs`, `crates/ui-egui/locales/`, `docs/localization-ja.md` | Japanese/English UI with persisted language preference and Japanese regular/bold fonts; menus, edit, crop/masks, settings, import/export and primary progress messages. Technical errors/release notes and other locales remain untranslated. |
| LR-BEHAV-LEARN | Tutorials | OOS | 🚫 | | |
| LR-BEHAV-WHATSNEW | What's new | P2 | ✅ | `cmd:app.whatsNew`, `docs/whats-new.md` | Help ▸ What's New: release highlights |
| LR-BEHAV-AI-EA | Early-access badges | P2 | ⬜ | | |
diff --git a/scripts/package-japanese-macos.py b/scripts/package-japanese-macos.py
deleted file mode 100644
index f3e50dd66..000000000
--- a/scripts/package-japanese-macos.py
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env python3
-"""Package the locally built arm64 app with an independent name and bundle identifier."""
-import argparse
-import pathlib
-import plistlib
-import shutil
-import subprocess
-
-root = pathlib.Path(__file__).resolve().parents[1]
-parser = argparse.ArgumentParser()
-parser.add_argument("--output", type=pathlib.Path, required=True)
-options = parser.parse_args()
-app = options.output.resolve()
-if app.exists():
- raise SystemExit(f"Output already exists: {app}")
-for name in ("lightcraft", "lightcraft-cli"):
- if not (root / "target/release" / name).is_file():
- raise SystemExit(f"Build {name} first with cargo build --release")
-
-macos = app / "Contents/MacOS"
-resources = app / "Contents/Resources"
-macos.mkdir(parents=True)
-resources.mkdir(parents=True)
-template = (root / "packaging/macos/Info.plist.in").read_text()
-revision = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=root, text=True).strip()
-template = template.replace("@VERSION@", "0.2.0-ja.1").replace("@SHORT_VERSION@", "0.2.0").replace("@BUILD_SHA@", revision)
-info = plistlib.loads(template.encode())
-info.update({
- "CFBundleDevelopmentRegion": "ja",
- "CFBundleDisplayName": "LightCraft 日本語",
- "CFBundleName": "LightCraft 日本語",
- "CFBundleIdentifier": "local.taigi.lightcraft.japanese",
- "CFBundleLocalizations": ["ja", "en"],
- "NSHumanReadableCopyright": "Based on LightCraft by its contributors. Japanese localization added locally. MIT OR Apache-2.0.",
-})
-# This local build is an editor, not a competing system document-type owner.
-info.pop("UTExportedTypeDeclarations", None)
-info.pop("UTImportedTypeDeclarations", None)
-(app / "Contents/Info.plist").write_bytes(plistlib.dumps(info))
-shutil.copy2(root / "target/release/lightcraft", macos / "LightCraft")
-shutil.copy2(root / "target/release/lightcraft-cli", macos / "lightcraft-cli")
-shutil.copy2(root / "assets/app-icon/lightcraft.icns", resources / "LightCraft.icns")
-licenses = resources / "Licenses"
-licenses.mkdir()
-for source in ("LICENSE-MIT", "LICENSE-APACHE", "NOTICE", "assets/fonts/OFL-Inter.txt", "assets/fonts/OFL-BIZUDGothic.txt", "assets/fonts/OFL-BIZUDMincho.txt", "assets/app-icon/LICENSE.txt"):
- shutil.copy2(root / source, licenses / ("Icon-LICENSE.txt" if source == "assets/app-icon/LICENSE.txt" else pathlib.Path(source).name))
-shutil.copy2(root / "docs/localization-ja.md", resources / "日本語版について.md")
-subprocess.run(["codesign", "--force", "--sign", "-", "--timestamp=none", str(macos / "lightcraft-cli")], check=True)
-subprocess.run(["codesign", "--force", "--sign", "-", "--timestamp=none", str(app)], check=True)
-subprocess.run(["codesign", "--verify", "--deep", "--strict", str(app)], check=True)
-print(app)