Merge PR #2714: i18n: add Lao (lo) translation support

crates/ui-egui/src/i18n/mod.rs: both sides' language rows, array sized 29.
ATTRIBUTION.md: both sides' rows; count regenerated after all merges.
This commit is contained in:
aiongg
2026-10-22 01:53:02 +00:00
4 changed files with 2451 additions and 1 deletions
+2
View File
@@ -30,6 +30,8 @@ Every asset PdfCraft includes, bundles or uses to build its published material,
| `crates/ui-egui/src/i18n/lt.tsv` | Lithuanian interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels and user-facing messages; original catalog reviewed by a native Lithuanian-speaking contributor; 2026-10-15 coverage additions are AI-assisted and not separately native-reviewed | Lithuanian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
| `crates/ui-egui/src/i18n/fi.tsv` | Finnish interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: AI-assisted (Claude Code) clean-room translations of PdfCraft's English UI labels and user-facing messages; not yet proofread by a native Finnish speaker | Finnish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
| `crates/ui-egui/src/i18n/ro.tsv` | Romanian interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels and user-facing messages; AI-assisted and not yet reviewed line by line by a native Romanian speaker | Romanian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
| `crates/ui-egui/src/i18n/vi.tsv` | Vietnamese interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels; PhotoCraft and VectorCraft Vietnamese catalogs used only as translation memory when English source and semantic context matched; original catalog reviewed by a native Vietnamese-speaking contributor; 2026-10-15 coverage additions are AI-assisted and not separately native-reviewed | Vietnamese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
| `crates/ui-egui/src/i18n/lo.tsv` | Lao interface translation catalog | @bounkirdni-2025 | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft English UI labels, no proprietary localisation resources | Lao UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
| `assets/icons/accessibility.svg` | Lucide icon "accessibility" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/accessibility.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
| `assets/icons/align-left.svg` | Lucide icon "align-left" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/align-left.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
| `assets/icons/align-center.svg` | Lucide icon "align-center" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/align-center.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
+11
View File
@@ -98,6 +98,17 @@ kind = "translation"
usage = "German UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "2b7787232635373d44b16b93051763b01cf8fa9e6877c87c013ad42171fdc915"
[[asset]]
path = "crates/ui-egui/src/i18n/lo.tsv"
title = "Lao interface translation catalog"
author = "@bounkirdni-2025"
source = "Contributor-original: clean-room translations of PdfCraft English UI labels, no proprietary localisation resources"
licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Lao UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "2dd835aeee0199f3ce9c9c396500f4466fec61bc0c19b9a09e33698a6cd6b8eb"
[[asset]]
path = "crates/ui-egui/src/i18n/te.tsv"
title = "Telugu interface translation catalog"
File diff suppressed because it is too large Load Diff
+8 -1
View File
@@ -159,7 +159,7 @@ fn plural_sl(n: u64) -> usize {
}
/// The registry. English first: it is the fallback and the source language.
pub static LANGUAGES: [LangInfo; 28] = [
pub static LANGUAGES: [LangInfo; 29] = [
LangInfo { code: "en", name: "English", source: "", plural: plural_one_other, rtl: false, catalog: OnceLock::new() },
LangInfo { code: "ja", name: "日本語", source: include_str!("ja.tsv"), plural: plural_none, rtl: false, catalog: OnceLock::new() },
// Simplified Chinese; `zh`, `zh-CN`, `zh-SG` and `zh-Hans-*` locales resolve here (see `candidates`).
@@ -233,6 +233,8 @@ pub static LANGUAGES: [LangInfo; 28] = [
LangInfo { code: "ca", name: "Català", source: include_str!("ca.tsv"), plural: plural_one_other, rtl: false, catalog: OnceLock::new() },
// Romanian; every `ro-*` locale (`ro-RO`, `ro_RO.UTF-8`, `ro-MD`) resolves here. Three plural forms (one, few, other).
LangInfo { code: "ro", name: "Română", source: include_str!("ro.tsv"), plural: plural_ro, rtl: false, catalog: OnceLock::new() },
// Lao; every `lo-*` locale (`lo-LA`, `lo_LA.UTF-8` ...) resolves here.
LangInfo { code: "lo", name: "ພາສາລາວ", source: include_str!("lo.tsv"), plural: plural_none, rtl: false, catalog: OnceLock::new() },
];
impl LangInfo {
@@ -697,6 +699,9 @@ mod tests {
assert_eq!(lang_from_tag("zh"), Lang::from_code("zh-hans"));
assert_eq!(lang_from_tag("zh_HK.UTF-8"), Lang::from_code("zh-hant"));
assert_eq!(lang_from_tag("zh-Hant-MO"), Lang::from_code("zh-hant"));
assert_eq!(lang_from_tag("lo_LA.UTF-8"), Lang::from_code("lo"));
assert_eq!(lang_from_tag("lo-LA"), Lang::from_code("lo"));
assert_eq!(lang_from_tag("lo"), Lang::from_code("lo"));
assert_eq!(lang_from_tag(""), None);
assert_eq!(lang_from_tag("_"), None);
}
@@ -709,6 +714,7 @@ mod tests {
assert_eq!(candidates("zh_TW"), ["zh-tw", "zh-hant", "zh"]);
assert_eq!(candidates("zh-CN"), ["zh-cn", "zh-hans", "zh"]);
assert_eq!(candidates("zh-Hant-HK"), ["zh-hant-hk", "zh-hant", "zh"]);
assert_eq!(candidates("lo_LA.UTF-8"), ["lo-la", "lo"]);
}
#[test]
@@ -743,6 +749,7 @@ mod tests {
}
assert_eq!(first_supported("en-US\r\n"), Some(Lang::EN));
assert_eq!(first_supported("fr-FR\r\n"), Lang::from_code("fr"));
assert_eq!(first_supported("lo-LA\r\n"), Lang::from_code("lo"));
assert_eq!(first_supported("\r\n"), None);
}