i18n: Turkish (tr) interface translation and language support

Add crates/ui-egui/src/i18n/tr.tsv, clean-room Turkish translations matching every entry in the Spanish catalog plus the native macOS Settings menu (3,590 entries).

Language::Tr ("Türkçe") is persisted as `tr` in `general.interfaceLanguage`; it appears in Edit > Language (and native macOS menu), Settings > General, and System Language picks it for `tr-*` locales.

Tests cover the core menus, reject dead entries, verify bundled font rendering for Turkish characters (Ç, Ğ, İ, Ö, Ş, Ü, ç, ğ, ı, ö, ş, ü), switching/persistence across restarts, and locale matching. Attribution sidecar, ATTRIBUTION.md, ui-egui README, gaps.md, and localization-parity.md updated.
This commit is contained in:
MOzcelik14
2026-10-18 12:53:46 +03:00
parent 48088e3a8e
commit 17eda1dea6
11 changed files with 3721 additions and 6 deletions
+1
View File
@@ -10,6 +10,7 @@ iconography, images or other Adobe assets; open licences only; every asset attri
| Asset | Author | Source | Licence |
|---|---|---|---|
| `crates/ui-egui/src/i18n/it.tsv` | FilmCraft contributors | Original work: clean-room Italian interface translations | MIT OR Apache-2.0 |
| `crates/ui-egui/src/i18n/tr.tsv` | FilmCraft contributors | Original work: clean-room Turkish interface translations | MIT OR Apache-2.0 |
| `crates/ui-egui/src/i18n/id.tsv` | FilmCraft contributors | Original work: clean-room Indonesian interface translations | MIT OR Apache-2.0 |
| `crates/ui-egui/src/i18n/ko.tsv` | FilmCraft contributors | Original work: clean-room Korean interface translations | MIT OR Apache-2.0 |
| `crates/ui-egui/src/i18n/fr.tsv` | FilmCraft contributors | Original work: clean-room French interface translations | MIT OR Apache-2.0 |
+2
View File
@@ -135,6 +135,8 @@ pub fn install(app: &FilmcraftApp, ctx: egui::Context) -> (Receiver<String>, Men
filmcraft_ui_egui::i18n::Language::It
} else if checked("app.language.korean") {
filmcraft_ui_egui::i18n::Language::Ko
} else if checked("app.language.turkish") {
filmcraft_ui_egui::i18n::Language::Tr
} else {
filmcraft_ui_egui::i18n::Language::En
};
+2 -1
View File
@@ -34,7 +34,7 @@ pub const PREFS_VERSION: u32 = 2;
#[serde(rename_all = "camelCase", default)]
pub struct GeneralPrefs {
/// Interface language (persisted independently of projects): `en`, `ja`, `es`, `pt-br`, `uk`,
/// `zh-cn`, `de`, `ru`, `fr`, `id`, `it`, or `system` (the default: the operating system's preferred language when the
/// `zh-cn`, `de`, `ru`, `fr`, `id`, `it`, `ko`, `tr`, or `system` (the default: the operating system's preferred language when the
/// interface has it, otherwise English).
pub interface_language: String,
/// "At Startup": `showHome` (FilmCraft: the demo project), `openMostRecent`, `emptyProject`.
@@ -1009,6 +1009,7 @@ static CATEGORIES: &[Category] = &[
("id", "Bahasa Indonesia"),
("it", "Italiano"),
("ko", "한국어"),
("tr", "Türkçe"),
]),
true,
),
+6
View File
@@ -50,6 +50,12 @@ fn interface_language_persists_and_rejects_hostile_values() {
}
set(&mut s, "general.interfaceLanguage", json!("it"));
assert_eq!(Preferences::load(&path).general.interface_language, "it");
// Turkish is stored as `tr`, not a locale tag
for value in [json!("tr-TR"), json!("TR")] {
assert!(s.execute("prefs.set", json!({"key": "general.interfaceLanguage", "value": value})).is_err());
}
set(&mut s, "general.interfaceLanguage", json!("tr"));
assert_eq!(Preferences::load(&path).general.interface_language, "tr");
// back to following the operating system (#218)
set(&mut s, "general.interfaceLanguage", json!("system"));
assert_eq!(Preferences::load(&path).general.interface_language, "system");
+1 -1
View File
@@ -18,7 +18,7 @@ the committed span and undo. Set `FILMCRAFT_UI_SNAPSHOT_DIR` to render screensho
## Localisation
Edit > Language offers English, Japanese, Spanish, Brazilian Portuguese, Ukrainian, Simplified
Chinese, German, Russian, French, Indonesian, Korean and Italian (which cover the whole interface). The language is stored in the engine's `general.interfaceLanguage` preference,
Chinese, German, Russian, French, Indonesian, Korean, Italian and Turkish (which cover the whole interface). The language is stored in the engine's `general.interfaceLanguage` preference,
restored on startup, and also available in Settings > General.
Its default, System Language (`system`), follows the operating system: the first of the user's
preferred languages that the interface has (the host supplies them through
+88 -3
View File
@@ -49,6 +49,7 @@ pub enum Language {
It,
/// Korean; Hangul needs an installed system font ([`korean_font_available`]).
Ko,
Tr,
}
static JAPANESE: OnceLock<Catalog> = OnceLock::new();
@@ -62,9 +63,11 @@ static FRENCH: OnceLock<Catalog> = OnceLock::new();
static KOREAN: OnceLock<Catalog> = OnceLock::new();
static INDONESIAN: OnceLock<Catalog> = OnceLock::new();
static ITALIAN: OnceLock<Catalog> = OnceLock::new();
static TURKISH: OnceLock<Catalog> = OnceLock::new();
impl Language {
pub const ALL: [Self; 12] = [Self::En, Self::Ja, Self::Es, Self::PtBr, Self::Uk, Self::ZhCn, Self::De, Self::Ru, Self::Fr, Self::Id, Self::Ko, Self::It];
pub const ALL: [Self; 13] =
[Self::En, Self::Ja, Self::Es, Self::PtBr, Self::Uk, Self::ZhCn, Self::De, Self::Ru, Self::Fr, Self::Id, Self::Ko, Self::It, Self::Tr];
pub fn name(self) -> &'static str {
match self {
@@ -80,6 +83,7 @@ impl Language {
Self::Id => "Bahasa Indonesia",
Self::It => "Italiano",
Self::Ko => "한국어",
Self::Tr => "Türkçe",
}
}
@@ -97,6 +101,7 @@ impl Language {
"id" => Some(Self::Id),
"it" => Some(Self::It),
"ko" => Some(Self::Ko),
"tr" => Some(Self::Tr),
_ => None,
}
}
@@ -107,11 +112,11 @@ impl Language {
/// any German (`de-AT`, `de_CH.UTF-8`…) gets the German one and any French (`fr-CA`, `fr_BE.UTF-8`…)
/// the French one; any Indonesian (`id-ID`, `id_ID.UTF-8`, and the legacy `in-ID` that older Java
/// and Android runtimes report) the Indonesian one; any Italian (`it-IT`, `it-CH`, `it_IT.UTF-8`…)
/// the Italian one. Chinese gets the Simplified catalog
/// the Italian one; any Turkish (`tr`, `tr-TR`, `tr_TR.UTF-8`…) the Turkish one. Chinese gets the Simplified catalog
/// only for Simplified locales (`zh`, `zh-CN`, `zh-SG`, `zh-Hans…`); Traditional ones (`zh-TW`,
/// `zh-HK`, `zh-MO`, `zh-Hant…`) are skipped.
pub fn from_locales(tags: &[String]) -> Self {
const PRIMARY: [(&str, Language); 12] = [
const PRIMARY: [(&str, Language); 13] = [
("en", Language::En),
("ja", Language::Ja),
("es", Language::Es),
@@ -124,6 +129,7 @@ impl Language {
("in", Language::Id),
("it", Language::It),
("ko", Language::Ko),
("tr", Language::Tr),
];
tags.iter()
.find_map(|tag| {
@@ -156,6 +162,7 @@ impl Language {
Self::Id => "id",
Self::It => "it",
Self::Ko => "ko",
Self::Tr => "tr",
}
}
@@ -174,6 +181,7 @@ impl Language {
Self::Id => Some(INDONESIAN.get_or_init(|| Catalog::parse(include_str!("id.tsv")))),
Self::It => Some(ITALIAN.get_or_init(|| Catalog::parse(include_str!("it.tsv")))),
Self::Ko => Some(KOREAN.get_or_init(|| Catalog::parse(include_str!("ko.tsv")))),
Self::Tr => Some(TURKISH.get_or_init(|| Catalog::parse(include_str!("tr.tsv")))),
}
}
@@ -354,6 +362,7 @@ mod tests {
("id", include_str!("id.tsv")),
("it", include_str!("it.tsv")),
("ko", include_str!("ko.tsv")),
("tr", include_str!("tr.tsv")),
] {
let (entries, errors) = catalog::parse_entries(text);
assert!(errors.is_empty(), "{code}: {errors:?}");
@@ -415,6 +424,13 @@ mod tests {
assert_eq!(Language::It.tr("An untranslated label"), "An untranslated label");
assert_eq!(Language::parse("it"), Some(Language::It));
assert_eq!(Language::parse("it-IT"), None, "the preference stores the bare code");
assert_eq!(Language::Tr.name(), "Türkçe");
assert_eq!(Language::Tr.tr("File"), "Dosya");
assert_eq!(Language::Tr.tr("Save As…"), "Farklı Kaydet…");
assert_eq!(Language::Tr.tr("Tatil videosu.mp4"), "Tatil videosu.mp4");
assert_eq!(Language::Tr.tr("An untranslated label"), "An untranslated label");
assert_eq!(Language::parse("tr"), Some(Language::Tr));
assert_eq!(Language::parse("tr-TR"), None, "the preference stores the bare code");
for l in Language::ALL {
assert_eq!(Language::parse(l.code()), Some(l));
let json = serde_json::to_string(&l).unwrap();
@@ -997,6 +1013,24 @@ mod tests {
let mut restarted = filmcraft_engine::Session::default();
restarted.prefs = serde_json::from_str(&prefs).unwrap();
assert_eq!(crate::FilmcraftApp::new(restarted).ui.language, Language::It);
let result = crate::menus::invoke(&mut app, &ctx, "app.language.turkish", serde_json::json!({})).unwrap();
assert_eq!(result, serde_json::json!("tr"));
assert_eq!((app.ui.language, current()), (Language::Tr, Language::Tr));
assert_eq!(app.session.prefs.general.interface_language, "tr");
for it in crate::menus::menu_items(&app).iter().filter(|it| it.id.starts_with("app.language.")) {
assert_eq!(it.checked, Some(it.id == "app.language.turkish"), "{}", it.id);
}
let items = crate::menus::menu_items(&app);
let label = |id: &str| items.iter().find(|it| it.id == id).map(|it| it.label.as_str());
assert_eq!(label("file.saveAs"), Some("Farklı Kaydet…"));
assert_eq!(label("app.language.italian"), Some("Italiano"));
assert_eq!(label("app.language.turkish"), Some("Türkçe"));
let saved = serde_json::to_string(&app.ui).unwrap();
assert!(saved.contains("\"language\":\"tr\""), "{saved}");
let prefs = serde_json::to_string(&app.session.prefs).unwrap();
let mut restarted = filmcraft_engine::Session::default();
restarted.prefs = serde_json::from_str(&prefs).unwrap();
assert_eq!(crate::FilmcraftApp::new(restarted).ui.language, Language::Tr);
crate::menus::invoke(&mut app, &ctx, "app.language.english", serde_json::json!({})).unwrap();
assert_eq!(app.ui.language, Language::En);
set_current(Language::En);
@@ -1042,6 +1076,13 @@ mod tests {
for none in [&["ita"][..], &["i"], &["-it"]] {
assert_eq!(l(none), Language::En, "{none:?}");
}
for tag in ["tr", "TR", "tr-TR", "tr_TR.UTF-8", "tr_TR.UTF-8@euro", "tr_TR"] {
assert_eq!(l(&[tag]), Language::Tr, "{tag}");
}
assert_eq!(l(&["tr-TR", "de-CH", "fr-CH", "en"]), Language::Tr);
for none in [&["tur"][..], &["t"], &["-tr"]] {
assert_eq!(l(none), Language::En, "{none:?}");
}
assert_eq!(l(&["sv-SE", "nl", "es-MX", "ja"]), Language::Es, "the first one the interface has");
assert_eq!(l(&["rm-CH", "de-CH", "fr-CH", "en"]), Language::De);
assert_eq!(l(&["rm-CH", "fr-CH", "de-CH", "en"]), Language::Fr);
@@ -1266,6 +1307,40 @@ mod tests {
set_current(Language::En);
}
/// Turkish covers the whole interface (the Spanish catalog's entries and the native macOS
/// Settings menu); like Italian, the tests require only the core menus, so strings added
/// later show in English until they are translated, and every entry must have a Spanish
/// counterpart.
#[test]
fn turkish_covers_the_menus_and_has_no_dead_entries() {
let (entries, errors) = catalog::parse_entries(include_str!("tr.tsv"));
assert!(errors.is_empty(), "{errors:?}");
for (ctx, en, _) in &entries {
assert!(ctx.is_empty() && (Language::Es.has(en) || en == "Settings"), "Turkish entry without a Spanish one: {ctx:?} {en:?}");
}
let (core, _) = catalog::parse_entries(include_str!("uk.tsv"));
for (_, en, _) in core {
assert!(Language::Tr.has(&en), "missing Turkish menu label: {en}");
}
for en in crate::menus::MENUS.into_iter().chain(["Audio", "Settings"]) {
assert!(Language::Tr.has(en), "untranslated Turkish menu: {en}");
}
// beyond the menus: panels, effects and their parameters, settings, status messages
for (en, tr) in [
("Settings", "Ayarlar"),
("Gaussian Blur", "Gauss Bulanıklığı"),
("Audio Track Mixer", "Ses İzi Karıştırıcısı"),
("Sequence", "Sekans"),
("Playhead", "Oynatma Kafası"),
] {
assert_eq!(Language::Tr.tr(en), tr);
}
set_current(Language::Tr);
assert!(matches_query("Gaussian Blur", "bulanıklığı"));
assert!(matches_query("Gaussian Blur", "gaussian"));
set_current(Language::En);
}
/// Every non-ASCII character of `text` renders with the bundled interface fonts, in every family.
fn assert_bundled_fonts_cover(text: impl Iterator<Item = char>) {
let ctx = egui::Context::default();
@@ -1338,6 +1413,16 @@ mod tests {
assert_bundled_fonts_cover(alphabet.chars().chain(Language::It.name().chars()).chain(letters));
}
#[test]
fn turkish_renders_with_bundled_fonts() {
let (entries, _) = catalog::parse_entries(include_str!("tr.tsv"));
// every Turkish letter (ç, ğ, ı, ö, ş, ü, Ç, Ğ, İ, Ö, Ş, Ü), even ones no entry uses yet,
// and every letter, curly quote, dash and ellipsis the entries use (symbols such as ✔ come from the English sources)
let alphabet = "ÇĞİÖŞÜçğıöşü";
let letters = entries.iter().flat_map(|(_, _, tr)| tr.chars()).filter(|ch| ch.is_alphabetic() || "“”‘’–—…".contains(*ch));
assert_bundled_fonts_cover(alphabet.chars().chain(Language::Tr.name().chars()).chain(letters));
}
#[test]
fn japanese_needs_an_installed_font() {
let mut app = crate::FilmcraftApp::new(filmcraft_engine::Session::default());
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,8 @@
asset: tr.tsv
title: Turkish interface translation catalog
author: FilmCraft contributors
source: original work
license: MIT OR Apache-2.0
license-file: LICENSE-MIT and LICENSE-APACHE
added: 2026-10-18 by MOzcelik14
notes: Original English-to-Turkish interface translations using clean-room NLE vocabulary.
+4
View File
@@ -38,6 +38,7 @@ pub const UI_COMMANDS: &[UiCommand] = &[
uic!("app.language.indonesian", "Bahasa Indonesia", ["Edit", "Language"], None),
uic!("app.language.italian", "Italiano", ["Edit", "Language"], None),
uic!("app.language.korean", "한국어", ["Edit", "Language"], None),
uic!("app.language.turkish", "Türkçe", ["Edit", "Language"], None),
uic!("source.playback.toggle", "Source Play/Stop", [], None),
uic!("source.playback.play", "Play Source", [], None),
uic!("source.playback.stop", "Stop Source", [], None),
@@ -199,6 +200,7 @@ pub fn invoke(app: &mut FilmcraftApp, ctx: &egui::Context, id: &str, mut params:
| "app.language.indonesian"
| "app.language.italian"
| "app.language.korean"
| "app.language.turkish"
) {
// Japanese needs the craft-fonts (built with CRAFT_FONTS_DIR) or a font installed on the system
if id == "app.language.japanese" && !crate::i18n::install_japanese_font(ctx) {
@@ -224,6 +226,7 @@ pub fn invoke(app: &mut FilmcraftApp, ctx: &egui::Context, id: &str, mut params:
"app.language.indonesian" => crate::i18n::Language::Id,
"app.language.italian" => crate::i18n::Language::It,
"app.language.korean" => crate::i18n::Language::Ko,
"app.language.turkish" => crate::i18n::Language::Tr,
_ => crate::i18n::Language::En,
};
// The preference is updated in memory before it is written, so a failed write (read-only
@@ -697,6 +700,7 @@ pub fn menu_items(app: &FilmcraftApp) -> Vec<MenuItem> {
"app.language.indonesian" => it.checked = Some(app.ui.language == crate::i18n::Language::Id),
"app.language.italian" => it.checked = Some(app.ui.language == crate::i18n::Language::It),
"app.language.korean" => it.checked = Some(app.ui.language == crate::i18n::Language::Ko),
"app.language.turkish" => it.checked = Some(app.ui.language == crate::i18n::Language::Tr),
_ => {}
}
if it.id.starts_with("view.") {
+3
View File
@@ -247,6 +247,9 @@ platforms** G4, G9, G17; **performance** G16; **ecosystem** G11; **measurement**
- **Done:** Italian: `it.tsv` has every entry of the Spanish catalog (~100%), in Edit ▸ Language,
Settings ▸ General and the native macOS menu; System Language picks it for `it-*` locales.
Native-speaker review welcome.
- **Done:** Turkish: `tr.tsv` has every entry of the Spanish catalog (~100%), in Edit ▸ Language,
Settings ▸ General and the native macOS menu; System Language picks it for `tr-*` locales.
Native-speaker review welcome.
- **Estimate:** 150–230 h. Doc: [localization-parity.md](localization-parity.md).
## G15. Interchange never validated in Avid / Pro Tools; slow XML import
+2 -1
View File
@@ -10,7 +10,7 @@ Portuguese (Brazil), Russian, Simplified Chinese.
Edit ▸ Language (also Settings ▸ General, `general.interfaceLanguage`) switches the interface and
persists across restarts; System Language (the default) follows the OS's or browser's preferred
languages and falls back to English. Commands `app.language.<english|japanese|spanish|portuguese|ukrainian|chinese|german|russian|french|indonesian|italian>`
languages and falls back to English. Commands `app.language.<english|japanese|spanish|portuguese|ukrainian|chinese|german|russian|french|indonesian|italian|korean|turkish>`
are reachable over the control channel. One catalog per language,
`crates/ui-egui/src/i18n/<code>.tsv` (format in the header of `es.tsv`); UI code wraps strings in
`tl!("…")` / `tlf!("…{name}", name)`, and registry names (effects and their parameters, settings,
@@ -54,6 +54,7 @@ whole interface, one PR) at ~4–8 h per language for the catalog plus tests.
| Korean | ko | 3,573 (same entries as Spanish, plus the macOS Settings item) | as Spanish | installed system Hangul font (Malgun Gothic, Apple SD Gothic Neo, Noto Sans CJK KR…); refused without one | not recorded; welcome | partial (#508) | review; Hangul in craft-fonts for the web |
| Vietnamese | vi | 0 (0%) | — | Latin with stacked diacritics (font coverage to check) | — | none | 6–12 h + review |
| *Other shipped:* Italian | it | 3,573 (same entries as Spanish, plus the macOS Settings item); must cover the core menus, no entry without a Spanish one | as Spanish | Latin (bundled fonts) | not recorded; welcome | partial | review |
| *Other shipped:* Turkish | tr | 3,590 (same entries as Spanish, plus the macOS Settings item); must cover the core menus, no entry without a Spanish one | as Spanish | Latin (bundled fonts) | not recorded; welcome | partial | review |
| *Other shipped:* Ukrainian | uk | 351 (10.0%) | menus only | Cyrillic (bundled) | not recorded | menus only | 5–9 h |
Premiere also ships Italian, which we now cover like Spanish, and Russian (6–10 h).