diff --git a/CHANGELOG.md b/CHANGELOG.md index d724601..dcf6ad6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ All notable changes are listed here. Versions follow [Semantic Versioning](https games with a search, the game with the notation under the board (variations, comments, NAG, comment arrows), paging games, and Stockfish 19 with its evaluation, lines and a preview of a line on the board. Two APKs: Stockfish built in, or Stockfish downloaded in the app. - Files are only read, never changed. + Files are only read, never changed. The engine's download goes on in the background, with + the app closed too. In English, Russian, German, French, Spanish and Italian. ## [0.9.0] — 2026-10-22 diff --git a/androidApp/app/build.gradle.kts b/androidApp/app/build.gradle.kts index a8d8fc1..f62feff 100644 --- a/androidApp/app/build.gradle.kts +++ b/androidApp/app/build.gradle.kts @@ -54,6 +54,7 @@ val uniffiBindings = tasks.register("uniffiBindings") { "--out-dir", bindings.get().asFile.path, ) inputs.dir(rustLibs) + inputs.file(repo.resolve("crates/mobile-api/uniffi.toml")) outputs.dir(bindings) } @@ -145,7 +146,7 @@ android { } // The languages of the interface; the libraries' other translations stay out. androidResources { - localeFilters += listOf("en", "ru") + localeFilters += listOf("en", "ru", "de", "fr", "es", "it") } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 diff --git a/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/data/EngineFiles.kt b/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/data/EngineFiles.kt index 8a5e5aa..ff84ec5 100644 --- a/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/data/EngineFiles.kt +++ b/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/data/EngineFiles.kt @@ -1,26 +1,26 @@ package io.github.vrubelroman.chesspenguin.data +import android.app.DownloadManager import android.content.Context import android.net.ConnectivityManager import android.net.NetworkCapabilities +import android.net.Uri import io.github.vrubelroman.chesspenguin.BuildConfig +import io.github.vrubelroman.chesspenguin.R import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job -import kotlinx.coroutines.cancelAndJoin -import kotlinx.coroutines.isActive +import kotlinx.coroutines.delay import kotlinx.coroutines.ensureActive import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.isActive import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import java.io.File -import java.io.FileOutputStream import java.io.IOException import java.io.InputStream -import java.net.HttpURLConnection -import java.net.URL import java.security.MessageDigest /// Why the network of the engine is not there. @@ -36,18 +36,33 @@ sealed interface NetState { /// Stockfish and its network (android-ui.md §8). The executable is a "library" of the /// APK; the network is a file in the app's storage: copied from the APK in the "full" /// build, downloaded on request in the "light" one, checked by its SHA-256 either way. +/// +/// The download is the system's (DownloadManager): it goes on with the app closed, +/// waits for the network and resumes, and shows its progress in a notification. Its +/// id is kept, so the app picks the download up again when it starts. class EngineFiles(private val context: Context, private val scope: CoroutineScope) { private val dir = File(context.filesDir, "engine") val net = File(dir, BuildConfig.NET_NAME) private val part = File(dir, BuildConfig.NET_NAME + ".part") + private val prefs = context.getSharedPreferences("engine", Context.MODE_PRIVATE) + private val downloads get() = context.getSystemService(DownloadManager::class.java) /// The executable, unpacked by the installer (useLegacyPackaging). val executable: String get() = context.applicationInfo.nativeLibraryDir + "/libstockfish.so" - private val _state = MutableStateFlow(if (installed()) NetState.Ready else NetState.Missing) + private val _state = MutableStateFlow(NetState.Missing) val state: StateFlow = _state.asStateFlow() private var job: Job? = null - @Volatile private var connection: HttpURLConnection? = null + + init { + when { + installed() -> _state.value = NetState.Ready + download() != NO_DOWNLOAD -> { + _state.value = NetState.Loading(0, BuildConfig.NET_SIZE) + watch(download()) + } + } + } /// A network checked when it was written: the right size is enough later. private fun installed() = net.length() == BuildConfig.NET_SIZE @@ -61,132 +76,159 @@ class EngineFiles(private val context: Context, private val scope: CoroutineScop return !caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED) } - /// Gets the network ready: from the APK, or from the internet. Runs on in the app's - /// scope when the screen that asked goes away. + /// Gets the network ready: from the APK, or from the internet. fun prepare() { if (_state.value == NetState.Ready || _state.value is NetState.Loading) return - // At once: the sheet shows the progress (and "Cancel") from the first moment. - _state.value = NetState.Loading(part.length().coerceAtMost(BuildConfig.NET_SIZE), BuildConfig.NET_SIZE) - val previous = job - job = scope.launch(Dispatchers.IO) { - // A cancelled download may still be leaving: one writer of the file at a time. - previous?.cancelAndJoin() - val result = try { - dir.mkdirs() - if (builtIn) copyFromApk() else download() - NetState.Ready - } catch (e: NetFailure) { - NetState.Failed(e.problem) - } catch (e: IOException) { - NetState.Failed(if (dir.usableSpace < BuildConfig.NET_SIZE) NetProblem.NoSpace else NetProblem.Interrupted) + if (builtIn) { + _state.value = NetState.Loading(0, BuildConfig.NET_SIZE) + job = scope.launch(Dispatchers.IO) { + val result = try { + dir.mkdirs() + context.assets.open(BuildConfig.NET_NAME).use { install(it) } + NetState.Ready + } catch (e: NetFailure) { + NetState.Failed(e.problem) + } catch (e: IOException) { + NetState.Failed(if (dir.usableSpace < BuildConfig.NET_SIZE) NetProblem.NoSpace else NetProblem.Interrupted) + } + if (isActive) _state.value = result } - // After "Cancel" the state is already "missing"; the broken connection is no failure. - if (isActive) _state.value = result + return } + if (!online()) { + _state.value = NetState.Failed(NetProblem.NoInternet) + return + } + // The file is downloaded next to the app's files, then checked and moved in. + if (dir.usableSpace < 2 * BuildConfig.NET_SIZE) { + _state.value = NetState.Failed(NetProblem.NoSpace) + return + } + target()?.delete() + val request = DownloadManager.Request(Uri.parse(BuildConfig.NET_URL)) + .setTitle(context.getString(R.string.download_title)) + .setDestinationInExternalFilesDir(context, null, BuildConfig.NET_NAME) + .setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE) + .setAllowedOverMetered(true) + val id = try { + downloads.enqueue(request) + } catch (e: IllegalArgumentException) { + // No shared storage for the download (or the download service is off). + _state.value = NetState.Failed(NetProblem.Interrupted) + return + } + prefs.edit().putLong(KEY, id).apply() + _state.value = NetState.Loading(0, BuildConfig.NET_SIZE) + watch(id) } - /// Stops a download; what came is kept for the next one. + /// Stops a download and throws away what came. fun cancel() { job?.cancel() - // A read waiting for the network returns at once. - connection?.disconnect() - _state.value = NetState.Missing + val id = download() + if (id != NO_DOWNLOAD) downloads.remove(id) + forget() + part.delete() + if (!installed()) _state.value = NetState.Missing } /// Removes a downloaded network (Settings → "Delete the engine"). fun delete() { cancel() net.delete() - part.delete() + _state.value = NetState.Missing } private class NetFailure(val problem: NetProblem) : Exception() - private suspend fun copyFromApk() { - part.delete() - context.assets.open(BuildConfig.NET_NAME).use { write(it, append = false, start = 0) } - finish() + private fun download(): Long = prefs.getLong(KEY, NO_DOWNLOAD) + + private fun forget() = prefs.edit().remove(KEY).apply() + + /// Where the system puts the downloaded file (the app's own external folder). + private fun target(): File? = context.getExternalFilesDir(null)?.let { File(it, BuildConfig.NET_NAME) } + + /// Follows a download of the system until it ends. The state is set on the main + /// thread, as "Cancel" sets it: after a cancel the watcher sets nothing more. + private fun watch(id: Long) { + job = scope.launch(Dispatchers.Main.immediate) { + while (isActive) { + val row = withContext(Dispatchers.IO) { progress(id) } + if (row == null) { + // Removed in the system's list of downloads. + forget() + _state.value = NetState.Missing + return@launch + } + when (row.status) { + DownloadManager.STATUS_SUCCESSFUL -> { + val result = withContext(Dispatchers.IO) { + try { + dir.mkdirs() + val file = target() ?: throw IOException("no external folder") + file.inputStream().use { install(it) } + NetState.Ready + } catch (e: NetFailure) { + NetState.Failed(e.problem) + } catch (e: IOException) { + NetState.Failed(if (dir.usableSpace < BuildConfig.NET_SIZE) NetProblem.NoSpace else NetProblem.Interrupted) + } + } + downloads.remove(id) + forget() + _state.value = result + return@launch + } + DownloadManager.STATUS_FAILED -> { + downloads.remove(id) + forget() + _state.value = NetState.Failed( + if (row.reason == DownloadManager.ERROR_INSUFFICIENT_SPACE) NetProblem.NoSpace else NetProblem.Interrupted, + ) + return@launch + } + else -> _state.value = NetState.Loading(row.done.coerceAtLeast(0), BuildConfig.NET_SIZE) + } + delay(500) + } + } } - private suspend fun download() { - if (!online()) throw NetFailure(NetProblem.NoInternet) - if (dir.usableSpace + part.length() < BuildConfig.NET_SIZE) throw NetFailure(NetProblem.NoSpace) - var have = part.length().takeIf { it < BuildConfig.NET_SIZE } ?: 0L - var url = URL(BuildConfig.NET_URL) - // GitHub answers with a redirect to its file host; follow it by hand to keep - // the Range header (resume after an interruption). - var conn: HttpURLConnection - var hops = 0 - while (true) { - conn = url.openConnection() as HttpURLConnection - connection = conn - conn.instanceFollowRedirects = false - conn.connectTimeout = 15_000 - conn.readTimeout = 30_000 - if (have > 0) conn.setRequestProperty("Range", "bytes=$have-") - val code = try { - conn.responseCode - } catch (e: IOException) { - throw NetFailure(if (online()) NetProblem.Interrupted else NetProblem.NoInternet) - } - if (code in 300..399 && hops++ < 5) { - url = URL(url, conn.getHeaderField("Location")) - conn.disconnect() - continue - } - if (code == 416) { - // The part is already whole (or longer): check it. - conn.disconnect() - finish() - return - } - if (code != 200 && code != 206) throw NetFailure(NetProblem.Interrupted) - if (code == 200) have = 0 - break - } - try { - conn.inputStream.use { write(it, append = have > 0, start = have) } - } catch (e: IOException) { - throw NetFailure(if (dir.usableSpace < 1_000_000) NetProblem.NoSpace else NetProblem.Interrupted) - } finally { - conn.disconnect() - } - finish() - } + private class Row(val status: Int, val reason: Int, val done: Long) - private suspend fun write(input: InputStream, append: Boolean, start: Long) = withContext(Dispatchers.IO) { - val total = BuildConfig.NET_SIZE - var done = start - FileOutputStream(part, append).use { out -> + private fun progress(id: Long): Row? = + downloads.query(DownloadManager.Query().setFilterById(id))?.use { c -> + if (!c.moveToFirst()) return null + Row( + c.getInt(c.getColumnIndexOrThrow(DownloadManager.COLUMN_STATUS)), + c.getInt(c.getColumnIndexOrThrow(DownloadManager.COLUMN_REASON)), + c.getLong(c.getColumnIndexOrThrow(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR)), + ) + } + + /// Writes the network into place, checking its SHA-256 on the way; a wrong file is + /// thrown away. + private suspend fun install(input: InputStream) { + val digest = MessageDigest.getInstance("SHA-256") + var done = 0L + part.outputStream().use { out -> val buf = ByteArray(256 * 1024) var last = 0L while (true) { - ensureActive() + kotlin.coroutines.coroutineContext.ensureActive() val n = input.read(buf) if (n < 0) break out.write(buf, 0, n) + digest.update(buf, 0, n) done += n - if (done - last > 512 * 1024 && isActive) { + if (builtIn && done - last > 512 * 1024) { last = done - _state.value = NetState.Loading(done, total) + _state.value = NetState.Loading(done, BuildConfig.NET_SIZE) } } } - } - - /// Checks the whole file and puts it in place, or throws it away. - private fun finish() { - val digest = MessageDigest.getInstance("SHA-256") - part.inputStream().use { input -> - val buf = ByteArray(1024 * 1024) - while (true) { - val n = input.read(buf) - if (n < 0) break - digest.update(buf, 0, n) - } - } val sum = digest.digest().joinToString("") { "%02x".format(it) } - if (sum != BuildConfig.NET_SHA256) { + if (sum != BuildConfig.NET_SHA256 || done != BuildConfig.NET_SIZE) { part.delete() throw NetFailure(NetProblem.Corrupt) } @@ -198,4 +240,9 @@ class EngineFiles(private val context: Context, private val scope: CoroutineScop val caps = cm.getNetworkCapabilities(cm.activeNetwork) ?: return false return caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) } + + private companion object { + const val KEY = "download" + const val NO_DOWNLOAD = -1L + } } diff --git a/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/data/Language.kt b/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/data/Language.kt index 7c9d7ea..9094c82 100644 --- a/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/data/Language.kt +++ b/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/data/Language.kt @@ -7,7 +7,7 @@ import android.os.Build import android.os.LocaleList /// The interface languages; "" follows the system (android-ui.md §9). -val LANGUAGES = listOf("", "en", "ru") +val LANGUAGES = listOf("", "en", "ru", "de", "fr", "es", "it") /// The language chosen in the app. Android 13+ keeps it itself (and shows it in the /// system settings of the app); on Android 12 the app keeps it and applies it to its diff --git a/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/ui/EngineViews.kt b/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/ui/EngineViews.kt index ef48aff..136bf67 100644 --- a/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/ui/EngineViews.kt +++ b/androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/ui/EngineViews.kt @@ -275,8 +275,7 @@ fun EngineSheet(state: NetState, metered: Boolean, onDownload: () -> Unit, onCan if (state.problem != NetProblem.NoSpace) TextButton(onClick = onDismiss) { Text(stringResource(R.string.not_now)) } when (state.problem) { NetProblem.NoSpace -> Button(onClick = onDismiss) { Text(stringResource(R.string.ok)) } - NetProblem.NoInternet -> Button(onClick = onDownload) { Text(stringResource(R.string.retry)) } - NetProblem.Interrupted -> Button(onClick = onDownload) { Text(stringResource(R.string.resume)) } + NetProblem.NoInternet, NetProblem.Interrupted -> Button(onClick = onDownload) { Text(stringResource(R.string.retry)) } NetProblem.Corrupt -> Button(onClick = onDownload) { Text(stringResource(R.string.download_again)) } } } diff --git a/androidApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/androidApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index be43858..1451b6a 100644 --- a/androidApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/androidApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -2,4 +2,5 @@ + diff --git a/androidApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/androidApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index be43858..1451b6a 100644 --- a/androidApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/androidApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -2,4 +2,5 @@ + diff --git a/androidApp/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.webp b/androidApp/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.webp new file mode 100644 index 0000000..d04ad37 Binary files /dev/null and b/androidApp/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.webp differ diff --git a/androidApp/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.webp b/androidApp/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.webp new file mode 100644 index 0000000..8db2b68 Binary files /dev/null and b/androidApp/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.webp differ diff --git a/androidApp/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.webp b/androidApp/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.webp new file mode 100644 index 0000000..cfd6fd3 Binary files /dev/null and b/androidApp/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.webp differ diff --git a/androidApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.webp b/androidApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.webp new file mode 100644 index 0000000..12f1447 Binary files /dev/null and b/androidApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.webp differ diff --git a/androidApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.webp b/androidApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.webp new file mode 100644 index 0000000..cbce5a0 Binary files /dev/null and b/androidApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.webp differ diff --git a/androidApp/app/src/main/res/values-de/strings.xml b/androidApp/app/src/main/res/values-de/strings.xml new file mode 100644 index 0000000..a4d496a --- /dev/null +++ b/androidApp/app/src/main/res/values-de/strings.xml @@ -0,0 +1,153 @@ + + Klassische Partien + Aljechin + + Hier erscheinen Ihre Datenbanken + Fügen Sie eine PGN-Datei oder ein .zip/.7z-Archiv hinzu — vom Telefon oder aus der Cloud. + Datenbank hinzufügen + Beispielpartien öffnen + noch nicht geöffnet · %1$s + + %1$s Partie + %1$s Partien + + %1$s · %2$s + Menü + Umbenennen + Aus der Liste entfernen + Der Name in der Liste. Die Datei wird nicht geändert. + Abbrechen + Speichern + Datenbank aus der Liste entfernt + Rückgängig + Zurück + + Wird gelesen… + Datenbank konnte nicht geöffnet werden + Suchen + Spieler, Turnier, Jahr + Nichts gefunden + Leeren + + %1$d von %2$d + Vorherige Partie + Nächste Partie + Brett drehen + Zum Anfang + Zug zurück + Zug vor + Zum Ende der Variante + Weiter: + Dies ist ein Partiebetrachter. Blättern Sie mit ◀ ▶ unten durch die Züge. + Brett, Stellung nach %1$s + Brett, Ausgangsstellung + Weiß hat gewonnen + Schwarz hat gewonnen + Remis + Partie konnte nicht gelesen werden + + Engine + Rechnet… + Tiefe %1$d + pausiert + Tiefer + Mehr Varianten + Weniger Varianten + Die Engine antwortet nicht + Die Engine startet auf diesem Telefon nicht + Neu starten + Engine-Variante · Zug %1$d von %2$d + Schließen + Stockfish-Engine + Bewertet die Stellung und zeigt die besten Züge. Funktioniert offline — sie muss nur einmal heruntergeladen werden. + Größe: %1$d MB + Gerade kein WLAN: Der Download nutzt mobile Daten. + Nicht jetzt + Herunterladen + %1$d von %2$d MB heruntergeladen + Abbrechen + Download abgebrochen + Die Engine ist bereit + Kein Internet. Verbinden Sie sich mit einem Netzwerk und versuchen Sie es erneut. + ChessPenguin: Stockfish-Engine + Der Download wurde unterbrochen. Bitte versuchen Sie es erneut. + Nicht genug Speicherplatz: %1$d MB nötig. + Die Engine-Datei wurde beim Download beschädigt. Laden Sie sie erneut herunter. + Erneut versuchen + Erneut herunterladen + OK + Engine wird vorbereitet… + + Einstellungen + Darstellung + Engine + Design + Systemstandard + Hell + Dunkel + Zugnotation + Englische Buchstaben (K Q R B N) + Figurinen + Deutsche Buchstaben (K D T L S) + Nur zur Anzeige. PGN verwendet immer K Q R B N. + Figurenanimation + Pfeil für den besten Zug + Vibration + Stockfish 19 · eingebaut + Stockfish 19 · heruntergeladen + Nicht geladen · Herunterladen (%1$d MB) + Wird heruntergeladen… %1$d von %2$d MB + Engine löschen (gibt %1$d MB frei) + Engine löschen? Sie können sie erneut herunterladen. + Löschen + Varianten + Zeit pro Stellung + %1$d s + 1 min + Unbegrenzt + Threads + Speicher + %1$d MB + Die Engine verbraucht Akku. Sie stoppt von selbst, wenn sich der Bildschirm ausschaltet. + Über + Stockfish eingebaut + Stockfish wird in der App geladen + Alpha + Ein Betrachter für Schachdatenbanken: PGN, ChessBase, Archive. Dateien werden nur gelesen, nie geändert. + Lizenzen und Autoren + Website und Quellcode + + Partiedaten + PGN kopieren + FEN kopieren + Partie teilen + Hinweise + an + aus + nicht geladen + %1$s von %2$s gefunden + Partie + %1$d, Weiß, %2$s + %1$d, Schwarz, %2$s + aktueller Zug + Sprache + Matt + Patt + PGN kopiert + FEN kopiert + Turnier + Ort + Datum + Runde + Weiß + Schwarz + Ergebnis + Elo Weiß + Elo Schwarz + Kommentator + Halbzüge + Kein Zugriff auf die Datei: Sie wurde verschoben, gelöscht oder die Berechtigung wurde entzogen. Entfernen Sie sie aus der Liste und fügen Sie sie erneut hinzu. + Die Datei ist beschädigt oder keine Schachdatenbank. + Im Archiv ist keine PGN- oder ChessBase-Datenbank. + Diese Art von Datenbank kann nicht gelesen werden: %1$s + diff --git a/androidApp/app/src/main/res/values-es/strings.xml b/androidApp/app/src/main/res/values-es/strings.xml new file mode 100644 index 0000000..674c031 --- /dev/null +++ b/androidApp/app/src/main/res/values-es/strings.xml @@ -0,0 +1,154 @@ + + Partidas clásicas + Alekhine + + Aquí aparecerán tus bases + Añade un archivo PGN o un archivo comprimido .zip/.7z — desde el teléfono o la nube. + Añadir base + Abrir partidas de ejemplo + aún sin abrir · %1$s + + %1$s partida + %1$s de partidas + %1$s partidas + + %1$s · %2$s + Menú + Cambiar nombre + Quitar de la lista + El nombre en la lista. El archivo no se modifica. + Cancelar + Guardar + Base quitada de la lista + Deshacer + Atrás + + Leyendo… + No se pudo abrir la base + Buscar + Jugador, torneo, año + No se encontró nada + Borrar + + %1$d de %2$d + Partida anterior + Partida siguiente + Girar el tablero + Al inicio + Jugada atrás + Jugada adelante + Al final de la línea + Siguiente: + Es un visor de partidas. Recorre las jugadas con ◀ ▶ abajo. + Tablero, posición tras %1$s + Tablero, posición inicial + Ganaron las blancas + Ganaron las negras + Tablas + No se pudo leer la partida + + Motor + Pensando… + profundidad %1$d + en pausa + Más profundo + Más líneas + Menos líneas + El motor no responde + El motor no arranca en este teléfono + Reiniciar + Línea del motor · jugada %1$d de %2$d + Cerrar + Motor Stockfish + Evalúa la posición y muestra las mejores jugadas. Funciona sin conexión — solo hay que descargarlo una vez. + Tamaño: %1$d MB + Ahora no hay Wi-Fi: la descarga usará datos móviles. + Ahora no + Descargar + Descargados %1$d de %2$d MB + Cancelar + Descarga cancelada + El motor está listo + Sin Internet. Conéctate a una red e inténtalo de nuevo. + ChessPenguin: motor Stockfish + La descarga se detuvo. Inténtalo de nuevo. + No hay espacio suficiente: se necesitan %1$d MB. + El archivo del motor se dañó durante la descarga. Descárgalo de nuevo. + Reintentar + Descargar de nuevo + Aceptar + Preparando el motor… + + Ajustes + Apariencia + Motor + Tema + Predeterminado del sistema + Claro + Oscuro + Notación de jugadas + Letras inglesas (K Q R B N) + Figurines + Letras españolas (R D T A C) + Solo para mostrar. PGN siempre usa K Q R B N. + Animación de piezas + Flecha de la mejor jugada + Vibración + Stockfish 19 · incluido + Stockfish 19 · descargado + No descargado · Descargar (%1$d MB) + Descargando… %1$d de %2$d MB + Eliminar el motor (libera %1$d MB) + ¿Eliminar el motor? Puedes volver a descargarlo. + Eliminar + Líneas + Tiempo por posición + %1$d s + 1 min + Sin límite + Hilos + Memoria + %1$d MB + El motor consume batería. Se detiene solo cuando se apaga la pantalla. + Acerca de + Stockfish incluido + Stockfish se descarga en la aplicación + alfa + Un visor de bases de ajedrez: PGN, ChessBase, archivos comprimidos. Los archivos solo se leen, nunca se modifican. + Licencias y autores + Sitio web y código fuente + + Datos de la partida + Copiar PGN + Copiar FEN + Compartir partida + Notas + activado + desactivado + no descargado + Encontradas %1$s de %2$s + Partida + %1$d, blancas, %2$s + %1$d, negras, %2$s + jugada actual + Idioma + Jaque mate + Ahogado + PGN copiado + FEN copiado + Torneo + Lugar + Fecha + Ronda + Blancas + Negras + Resultado + Elo blancas + Elo negras + Comentarista + Medias jugadas + Sin acceso al archivo: se movió, se eliminó o se retiró el permiso. Quítalo de la lista y vuelve a añadirlo. + El archivo está dañado o no es una base de ajedrez. + El archivo comprimido no contiene ninguna base PGN ni ChessBase. + Este tipo de base no se puede leer: %1$s + diff --git a/androidApp/app/src/main/res/values-fr/strings.xml b/androidApp/app/src/main/res/values-fr/strings.xml new file mode 100644 index 0000000..f706ad7 --- /dev/null +++ b/androidApp/app/src/main/res/values-fr/strings.xml @@ -0,0 +1,154 @@ + + Parties classiques + Alekhine + + Vos bases apparaîtront ici + Ajoutez un fichier PGN ou une archive .zip/.7z — depuis votre téléphone ou le cloud. + Ajouter une base + Ouvrir les parties d’exemple + pas encore ouverte · %1$s + + %1$s partie + %1$s de parties + %1$s parties + + %1$s · %2$s + Menu + Renommer + Retirer de la liste + Le nom dans la liste. Le fichier n’est pas modifié. + Annuler + Enregistrer + Base retirée de la liste + Annuler + Retour + + Lecture… + Impossible d’ouvrir la base + Rechercher + Joueur, tournoi, année + Rien trouvé + Effacer + + %1$d sur %2$d + Partie précédente + Partie suivante + Retourner l’échiquier + Au début + Coup précédent + Coup suivant + À la fin de la ligne + Suite : + Ceci est une visionneuse de parties. Parcourez les coups avec ◀ ▶ en bas. + Échiquier, position après %1$s + Échiquier, position initiale + Les Blancs ont gagné + Les Noirs ont gagné + Nulle + Impossible de lire la partie + + Moteur + Réflexion… + profondeur %1$d + en pause + Plus loin + Plus de lignes + Moins de lignes + Le moteur ne répond pas + Le moteur ne démarre pas sur ce téléphone + Redémarrer + Ligne du moteur · coup %1$d sur %2$d + Fermer + Moteur Stockfish + Évalue la position et montre les meilleurs coups. Fonctionne hors ligne — il suffit de le télécharger une fois. + Taille : %1$d Mo + Pas de Wi-Fi pour l’instant : le téléchargement utilisera les données mobiles. + Plus tard + Télécharger + %1$d sur %2$d Mo téléchargés + Annuler + Téléchargement annulé + Le moteur est prêt + Pas d’Internet. Connectez-vous à un réseau et réessayez. + ChessPenguin : moteur Stockfish + Le téléchargement s’est arrêté. Veuillez réessayer. + Espace insuffisant : %1$d Mo nécessaires. + Le fichier du moteur a été endommagé pendant le téléchargement. Téléchargez-le à nouveau. + Réessayer + Télécharger à nouveau + OK + Préparation du moteur… + + Paramètres + Apparence + Moteur + Thème + Par défaut du système + Clair + Sombre + Notation des coups + Lettres anglaises (K Q R B N) + Figurines + Lettres françaises (R D T F C) + Affichage seulement. Le PGN utilise toujours K Q R B N. + Animation des pièces + Flèche du meilleur coup + Vibration + Stockfish 19 · intégré + Stockfish 19 · téléchargé + Non téléchargé · Télécharger (%1$d Mo) + Téléchargement… %1$d sur %2$d Mo + Supprimer le moteur (libère %1$d Mo) + Supprimer le moteur ? Vous pourrez le télécharger à nouveau. + Supprimer + Lignes + Temps par position + %1$d s + 1 min + Sans limite + Threads + Mémoire + %1$d Mo + Le moteur consomme de la batterie. Il s’arrête de lui-même quand l’écran s’éteint. + À propos + Stockfish intégré + Stockfish téléchargé dans l’application + alpha + Une visionneuse de bases d’échecs : PGN, ChessBase, archives. Les fichiers sont seulement lus, jamais modifiés. + Licences et auteurs + Site web et code source + + Détails de la partie + Copier le PGN + Copier la FEN + Partager la partie + Remarques + activé + désactivé + non téléchargé + %1$s trouvées sur %2$s + Partie + %1$d, Blancs, %2$s + %1$d, Noirs, %2$s + coup actuel + Langue + Échec et mat + Pat + PGN copié + FEN copiée + Tournoi + Lieu + Date + Ronde + Blancs + Noirs + Résultat + Elo Blancs + Elo Noirs + Commentateur + Demi-coups + Pas d’accès au fichier : il a été déplacé, supprimé ou son autorisation a été retirée. Retirez-le de la liste et ajoutez-le à nouveau. + Le fichier est endommagé ou n’est pas une base d’échecs. + L’archive ne contient aucune base PGN ou ChessBase. + Ce type de base ne peut pas être lu : %1$s + diff --git a/androidApp/app/src/main/res/values-it/strings.xml b/androidApp/app/src/main/res/values-it/strings.xml new file mode 100644 index 0000000..81f4e24 --- /dev/null +++ b/androidApp/app/src/main/res/values-it/strings.xml @@ -0,0 +1,154 @@ + + Partite classiche + Alekhine + + Qui compariranno i tuoi database + Aggiungi un file PGN o un archivio .zip/.7z — dal telefono o dal cloud. + Aggiungi database + Apri le partite di esempio + non ancora aperto · %1$s + + %1$s partita + %1$s di partite + %1$s partite + + %1$s · %2$s + Menu + Rinomina + Rimuovi dall\'elenco + Il nome nell\'elenco. Il file non viene modificato. + Annulla + Salva + Database rimosso dall\'elenco + Annulla + Indietro + + Lettura… + Impossibile aprire il database + Cerca + Giocatore, torneo, anno + Nessun risultato + Cancella + + %1$d di %2$d + Partita precedente + Partita successiva + Ruota la scacchiera + All\'inizio + Mossa indietro + Mossa avanti + Alla fine della linea + Seguito: + Questo è un visualizzatore di partite. Scorri le mosse con ◀ ▶ in basso. + Scacchiera, posizione dopo %1$s + Scacchiera, posizione iniziale + Hanno vinto i bianchi + Hanno vinto i neri + Patta + Impossibile leggere la partita + + Motore + Sto pensando… + profondità %1$d + in pausa + Più a fondo + Più linee + Meno linee + Il motore non risponde + Il motore non si avvia su questo telefono + Riavvia + Linea del motore · mossa %1$d di %2$d + Chiudi + Motore Stockfish + Valuta la posizione e mostra le mosse migliori. Funziona offline — basta scaricarlo una volta. + Dimensione: %1$d MB + Ora non c\'è Wi-Fi: il download userà i dati mobili. + Non ora + Scarica + Scaricati %1$d di %2$d MB + Annulla + Download annullato + Il motore è pronto + Nessuna connessione Internet. Connettiti a una rete e riprova. + ChessPenguin: motore Stockfish + Il download si è interrotto. Riprova. + Spazio insufficiente: servono %1$d MB. + Il file del motore si è danneggiato durante il download. Scaricalo di nuovo. + Riprova + Scarica di nuovo + OK + Preparazione del motore… + + Impostazioni + Aspetto + Motore + Tema + Predefinito di sistema + Chiaro + Scuro + Notazione delle mosse + Lettere inglesi (K Q R B N) + Figurine + Lettere italiane (R D T A C) + Solo per la visualizzazione. Il PGN usa sempre K Q R B N. + Animazione dei pezzi + Freccia della mossa migliore + Vibrazione + Stockfish 19 · incluso + Stockfish 19 · scaricato + Non scaricato · Scarica (%1$d MB) + Scaricamento… %1$d di %2$d MB + Elimina il motore (libera %1$d MB) + Eliminare il motore? Potrai scaricarlo di nuovo. + Elimina + Linee + Tempo per posizione + %1$d s + 1 min + Nessun limite + Thread + Memoria + %1$d MB + Il motore consuma batteria. Si ferma da solo quando lo schermo si spegne. + Informazioni + Stockfish incluso + Stockfish si scarica nell\'app + alfa + Un visualizzatore di database scacchistici: PGN, ChessBase, archivi. I file vengono solo letti, mai modificati. + Licenze e autori + Sito web e codice sorgente + + Dati della partita + Copia PGN + Copia FEN + Condividi la partita + Note + attivo + disattivato + non scaricato + Trovate %1$s di %2$s + Partita + %1$d, Bianco, %2$s + %1$d, Nero, %2$s + mossa attuale + Lingua + Scacco matto + Stallo + PGN copiato + FEN copiata + Torneo + Luogo + Data + Turno + Bianco + Nero + Risultato + Elo Bianco + Elo Nero + Commentatore + Semimosse + Nessun accesso al file: è stato spostato, eliminato o il permesso è stato revocato. Rimuovilo dall\'elenco e aggiungilo di nuovo. + Il file è danneggiato o non è un database scacchistico. + Nell\'archivio non c\'è alcun database PGN o ChessBase. + Questo tipo di database non può essere letto: %1$s + diff --git a/androidApp/app/src/main/res/values-ru/strings.xml b/androidApp/app/src/main/res/values-ru/strings.xml index e68ed0b..ff6a12c 100644 --- a/androidApp/app/src/main/res/values-ru/strings.xml +++ b/androidApp/app/src/main/res/values-ru/strings.xml @@ -26,7 +26,6 @@ Читаю… Не удалось открыть базу - Нет доступа к файлу. Добавьте его заново. Поиск Игрок, турнир, год Ничего не найдено @@ -72,11 +71,11 @@ Загрузка отменена Движок готов Нет интернета. Подключитесь к сети и попробуйте ещё раз. - Загрузка прервалась. Скачанное сохранено. + ChessPenguin: движок Stockfish + Загрузка остановилась. Попробуйте ещё раз. Не хватает места: нужно %1$d МБ. Файл движка повреждён при загрузке. Скачайте его ещё раз. Повторить - Продолжить Скачать снова Понятно Готовлю движок… diff --git a/androidApp/app/src/main/res/values/strings.xml b/androidApp/app/src/main/res/values/strings.xml index f366e8c..cafa7fc 100644 --- a/androidApp/app/src/main/res/values/strings.xml +++ b/androidApp/app/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - ChessPenguin + ChessPenguin Classic games Alekhine @@ -25,7 +25,6 @@ Reading… Could not open the database - No access to the file. Add it again. Search Player, event, year Nothing found @@ -71,11 +70,11 @@ Download cancelled The engine is ready No internet. Connect to a network and try again. - The download was interrupted. The downloaded part is kept. + ChessPenguin: Stockfish engine + The download stopped. Please try again. Not enough space: %1$d MB needed. The engine file was damaged during the download. Download it again. Try again - Continue Download again OK Preparing the engine… diff --git a/androidApp/app/src/main/res/xml/backup_rules.xml b/androidApp/app/src/main/res/xml/backup_rules.xml deleted file mode 100644 index 4df9255..0000000 --- a/androidApp/app/src/main/res/xml/backup_rules.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - \ No newline at end of file diff --git a/androidApp/app/src/main/res/xml/data_extraction_rules.xml b/androidApp/app/src/main/res/xml/data_extraction_rules.xml deleted file mode 100644 index 9ee9997..0000000 --- a/androidApp/app/src/main/res/xml/data_extraction_rules.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/androidApp/app/src/main/res/xml/locales_config.xml b/androidApp/app/src/main/res/xml/locales_config.xml index 1052e83..dca4d52 100644 --- a/androidApp/app/src/main/res/xml/locales_config.xml +++ b/androidApp/app/src/main/res/xml/locales_config.xml @@ -3,4 +3,8 @@ + + + + diff --git a/crates/mobile-api/uniffi.toml b/crates/mobile-api/uniffi.toml new file mode 100644 index 0000000..72d3319 --- /dev/null +++ b/crates/mobile-api/uniffi.toml @@ -0,0 +1,3 @@ +# Kotlin bindings for Android: the cleaner of the system on Android 13+, JNA before. +[bindings.kotlin] +android = true