mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-15 23:12:31 +00:00
i18n: translate the remaining untranslated interface strings; test the font fallback cache with legacy family names (#233, #239)
Follow-ups from integrating #233 and #239: every tl! string now has a row in every catalog, and a test pins that loading a face by its legacy family name drops the fallback cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
40c5d51bf9
commit
7f046d96e5
7 files changed
+82
No files matched your search
@@ -222,3 +222,25 @@ fn the_scan_lists_a_variable_fonts_named_instances_as_loading_it_does() {
|
||||
assert!(loaded.iter().any(|(family, _, legacy)| family != legacy), "{loaded:?}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fallback_cache_is_dropped_when_a_face_loads_by_its_legacy_family_name() {
|
||||
// #121 with #219: a lookup by a legacy family name ("Sysfont Sans3 Semibold") loads faces,
|
||||
// so fallbacks remembered before it are searched again.
|
||||
let dir = font_dir("fallback-legacy");
|
||||
std::fs::write(dir.join("Sysfont-Semibold.ttf"), renamed("SourceSans3-Semibold.ttf")).unwrap();
|
||||
let db = FontDb::with_font_dirs(vec![dir]);
|
||||
db.set_system_fallback(false);
|
||||
let latin = db.face(FALLBACK_FAMILY, "Regular");
|
||||
let thai = 'ก';
|
||||
assert!(db.fallback_for(thai, latin.id()).is_none());
|
||||
let before = db.read_faces().len();
|
||||
let semibold = format!("{FAMILY} Semibold");
|
||||
let f = db.face(&semibold, "Regular");
|
||||
assert_eq!((f.style.as_str(), f.legacy_family.as_str()), ("Semibold", semibold.as_str()));
|
||||
assert!(db.read_faces().len() > before, "the installed family loaded");
|
||||
assert!(db.fallback_for('A', f.id()).is_some_and(|g| g.id() != f.id()));
|
||||
let cache = db.fallbacks.read().unwrap();
|
||||
assert_eq!(cache.faces, db.read_faces().len());
|
||||
assert!(!cache.map.contains_key(&(thai, latin.id())), "answers from before the load are dropped");
|
||||
}
|
||||
@@ -948,3 +948,13 @@
|
||||
Dark Oscuro
|
||||
Use system setting Usar la configuración del sistema
|
||||
A file dialog is already open. Ya hay un cuadro de diálogo de archivo abierto.
|
||||
Alt text Texto alternativo
|
||||
Alt: Alt.:
|
||||
W: An.:
|
||||
H: Al.:
|
||||
Reset Restablecer
|
||||
Reset Crop Restablecer recorte
|
||||
Insert a new equation (Alt+=) Insertar una ecuación nueva (Alt+=)
|
||||
Leave the equation (Esc) Salir de la ecuación (Esc)
|
||||
Preview Vista previa
|
||||
getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 25.
|
@@ -931,3 +931,13 @@
|
||||
Dark ダーク
|
||||
Use system setting システム設定を使用
|
||||
A file dialog is already open. ファイル ダイアログが既に開いています。
|
||||
Alt text 代替テキスト
|
||||
Alt: 代替テキスト:
|
||||
W: 幅:
|
||||
H: 高さ:
|
||||
Reset リセット
|
||||
Reset Crop トリミングのリセット
|
||||
Insert a new equation (Alt+=) 新しい数式を挿入 (Alt+=)
|
||||
Leave the equation (Esc) 数式を終了 (Esc)
|
||||
Preview プレビュー
|
||||
getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft
|
||||
|
Can't render this file because it contains an unexpected character in line 411 and column 13.
|
@@ -943,3 +943,13 @@
|
||||
Dark Escuro
|
||||
Use system setting Usar a configuração do sistema
|
||||
A file dialog is already open. Já há uma caixa de diálogo de arquivo aberta.
|
||||
Alt text Texto alternativo
|
||||
Alt: Alt.:
|
||||
W: L:
|
||||
H: A:
|
||||
Reset Redefinir
|
||||
Reset Crop Redefinir corte
|
||||
Insert a new equation (Alt+=) Inserir uma nova equação (Alt+=)
|
||||
Leave the equation (Esc) Sair da equação (Esc)
|
||||
Preview Visualizar
|
||||
getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 25.
|
@@ -943,3 +943,13 @@
|
||||
Dark Темна
|
||||
Use system setting Як у системі
|
||||
A file dialog is already open. Діалогове вікно файлу вже відкрито.
|
||||
Alt text Альтернативний текст
|
||||
Alt: Альт.:
|
||||
W: Ш:
|
||||
H: В:
|
||||
Reset Скинути
|
||||
Reset Crop Скинути обітнення
|
||||
Insert a new equation (Alt+=) Вставити нове рівняння (Alt+=)
|
||||
Leave the equation (Esc) Вийти з рівняння (Esc)
|
||||
Preview Попередній перегляд
|
||||
getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 31.
|
@@ -942,3 +942,13 @@
|
||||
Dark 深色
|
||||
Use system setting 使用系统设置
|
||||
A file dialog is already open. 已有一个文件对话框处于打开状态。
|
||||
Alt text 替代文字
|
||||
Alt: 替代文字:
|
||||
W: 宽:
|
||||
H: 高:
|
||||
Reset 重设
|
||||
Reset Crop 重设裁剪
|
||||
Insert a new equation (Alt+=) 插入新公式 (Alt+=)
|
||||
Leave the equation (Esc) 退出公式 (Esc)
|
||||
Preview 预览
|
||||
getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 25.
|
@@ -932,3 +932,13 @@
|
||||
Dark 深色
|
||||
Use system setting 使用系統設定
|
||||
A file dialog is already open. 已有一個檔案對話方塊開啟中。
|
||||
Alt text 替代文字
|
||||
Alt: 替代文字:
|
||||
W: 寬:
|
||||
H: 高:
|
||||
Reset 重設
|
||||
Reset Crop 重設裁剪
|
||||
Insert a new equation (Alt+=) 插入新方程式 (Alt+=)
|
||||
Leave the equation (Esc) 離開方程式 (Esc)
|
||||
Preview 預覽
|
||||
getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft
|
||||
|
Can't render this file because it contains an unexpected character in line 412 and column 13.
|
Reference in new issue
Block a user