Open ChessBase databases (.cbh, .cbv) and zip/7z archives
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run

New crate chess-import converts non-PGN sources to PGN in memory and returns
a PgnDatabase, so the library, notation and analysis work unchanged:
- .cbv archives (container rewritten after uncbv), .cbh with companion files
  (layout after the public Morphy format description): games, variations,
  comments with per-database code page detection, NAGs, squares/arrows, set-up
  positions, time spent, book chapters (guiding texts) as move-less records;
- ChessBase figurines become piece letters, diagram/object markers handled,
  Western names in Cyrillic databases read correctly;
- .zip/.7z with PGN (own encoding each), .cbh and .cbv; duplicates skipped;
- .cbz/encrypted archives and 2CBH rejected with clear messages.
Library: '+ Add database', format shown, import notes; comments keep
paragraph breaks. Tests on the user's sample books (skipped when absent).

Also: AUR PKGBUILD for 0.2.0 with the bundled Stockfish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubel 2026-10-18 13:18:27 +03:00
parent 26bf901124
commit bb7d3b3fa6
31 changed files with 3618 additions and 64 deletions

View file

@ -212,14 +212,6 @@ const ROWS: &[[&str; 6]] = &[
"Pianoforte",
],
// --- app ---
[
"Open PGN",
"Открыть PGN",
"Ouvrir un PGN",
"PGN öffnen",
"Abrir PGN",
"Apri PGN",
],
[
"All files",
"Все файлы",
@ -573,22 +565,6 @@ const ROWS: &[[&str; 6]] = &[
"Tablero en la posición inicial (Ctrl+N)",
"Scacchiera nella posizione iniziale (Ctrl+N)",
],
[
"+ Add PGN",
"+ Добавить PGN",
"+ Ajouter un PGN",
"+ PGN hinzufügen",
"+ Añadir PGN",
"+ Aggiungi PGN",
],
[
"Open a PGN file (Ctrl+O)",
"Открыть PGN-файл (Ctrl+O)",
"Ouvrir un fichier PGN (Ctrl+O)",
"PGN-Datei öffnen (Ctrl+O)",
"Abrir un archivo PGN (Ctrl+O)",
"Apri un file PGN (Ctrl+O)",
],
[
"{n} games",
"{n} партий",
@ -1412,6 +1388,95 @@ const ROWS: &[[&str; 6]] = &[
"Stockfish (del sistema)",
"Stockfish (di sistema)",
],
// Importing ChessBase databases and archives
[
"Open database",
"Открыть базу",
"Ouvrir une base",
"Datenbank öffnen",
"Abrir base de datos",
"Apri database",
],
[
"Chess databases",
"Шахматные базы",
"Bases d'échecs",
"Schachdatenbanken",
"Bases de datos de ajedrez",
"Database di scacchi",
],
[
"Import notes",
"Замечания импорта",
"Remarques d'import",
"Importhinweise",
"Notas de importación",
"Note di importazione",
],
[
"Everything else was read. Games listed here are shown as far as they could be decoded.",
"Всё остальное прочитано. Перечисленные здесь партии показаны до того места, где их удалось раскодировать.",
"Tout le reste a été lu. Les parties listées ici sont affichées jusqu'où elles ont pu être décodées.",
"Alles andere wurde gelesen. Die hier aufgeführten Partien werden so weit gezeigt, wie sie entschlüsselt werden konnten.",
"Todo lo demás se ha leído. Las partidas listadas aquí se muestran hasta donde se pudieron decodificar.",
"Tutto il resto è stato letto. Le partite elencate qui sono mostrate fin dove è stato possibile decodificarle.",
],
[
"+ Add database",
"+ Добавить базу",
"+ Ajouter une base",
"+ Datenbank hinzufügen",
"+ Añadir base",
"+ Aggiungi database",
],
[
"Open PGN, ChessBase (.cbh, .cbv) or an archive (.zip, .7z) (Ctrl+O)",
"Открыть PGN, ChessBase (.cbh, .cbv) или архив (.zip, .7z) (Ctrl+O)",
"Ouvrir un PGN, une base ChessBase (.cbh, .cbv) ou une archive (.zip, .7z) (Ctrl+O)",
"PGN, ChessBase (.cbh, .cbv) oder ein Archiv (.zip, .7z) öffnen (Strg+O)",
"Abrir PGN, ChessBase (.cbh, .cbv) o un archivo comprimido (.zip, .7z) (Ctrl+O)",
"Apri PGN, ChessBase (.cbh, .cbv) o un archivio (.zip, .7z) (Ctrl+O)",
],
[
"Converted to PGN when opened; the original files are not changed. Save a game to keep your edits.",
"При открытии база переводится в PGN, исходные файлы не меняются. Чтобы сохранить правки, сохраните партию.",
"Convertie en PGN à l'ouverture ; les fichiers d'origine ne sont pas modifiés. Enregistrez une partie pour garder vos modifications.",
"Beim Öffnen in PGN umgewandelt; die Originaldateien bleiben unverändert. Speichern Sie eine Partie, um Ihre Änderungen zu behalten.",
"Se convierte a PGN al abrirla; los archivos originales no cambian. Guarda una partida para conservar tus cambios.",
"Convertito in PGN all'apertura; i file originali non vengono modificati. Salva una partita per mantenere le modifiche.",
],
[
"No PGN or ChessBase database in the archive",
"В архиве нет баз PGN или ChessBase",
"Aucune base PGN ou ChessBase dans l'archive",
"Keine PGN- oder ChessBase-Datenbank im Archiv",
"No hay ninguna base PGN o ChessBase en el archivo",
"Nessun database PGN o ChessBase nell'archivio",
],
[
"Password-protected archives (.cbz, encrypted zip/7z) are not supported",
"Архивы с паролем (.cbz, зашифрованные zip/7z) не поддерживаются",
"Les archives protégées par mot de passe (.cbz, zip/7z chiffrés) ne sont pas prises en charge",
"Passwortgeschützte Archive (.cbz, verschlüsselte zip/7z) werden nicht unterstützt",
"Los archivos con contraseña (.cbz, zip/7z cifrados) no son compatibles",
"Gli archivi protetti da password (.cbz, zip/7z cifrati) non sono supportati",
],
[
"The ChessBase 2CBH format is not supported: export the database from ChessBase as CBH or PGN",
"Формат ChessBase 2CBH не поддерживается: экспортируйте базу из ChessBase в CBH или PGN",
"Le format ChessBase 2CBH n'est pas pris en charge : exportez la base depuis ChessBase en CBH ou PGN",
"Das ChessBase-Format 2CBH wird nicht unterstützt: Exportieren Sie die Datenbank aus ChessBase als CBH oder PGN",
"El formato ChessBase 2CBH no es compatible: exporta la base desde ChessBase como CBH o PGN",
"Il formato ChessBase 2CBH non è supportato: esporta il database da ChessBase come CBH o PGN",
],
[
"· {n} games · {format}, read-only",
"· {n} партий · {format}, только чтение",
"· {n} parties · {format}, lecture seule",
"· {n} Partien · {format}, schreibgeschützt",
"· {n} partidas · {format}, solo lectura",
"· {n} partite · {format}, sola lettura",
],
];
#[cfg(test)]