Compare commits
7
Commits
main
...
v1.0.0-beta.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3afe01ce52
|
||
|
|
9abff4f170
|
||
|
|
0c5aa4d45f
|
||
|
|
ac0c1c58e0
|
||
|
|
c6438f60db
|
||
|
|
fd1af60dbb
|
||
|
|
052d0a3894
|
No files matched your search
@@ -2,7 +2,7 @@ name: CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main, dev]
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
@@ -5,6 +5,44 @@ is in alpha and releases come off `main`.
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.0.0-beta.1] — 2026-11-03
|
||||||
|
|
||||||
|
For LLeMbas server 2.0, and only for it.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- **The file viewer.** When the model shows a file (the `show` tool, in a chat or from a linked
|
||||||
|
device), the reply carries a card with the file's name and path; Open shows it full screen,
|
||||||
|
read-only, at the line it named. Markdown is rendered with the same limits as a reply (no
|
||||||
|
images, no HTML, links open in the browser for http, https and mailto only); code and text are
|
||||||
|
numbered lines; a long Markdown file is shown as text. **HTML is never rendered in the app**:
|
||||||
|
it is shown as its source, and "Open in the browser" opens the web viewer, which draws it in
|
||||||
|
its sealed frame. Copy takes the whole file.
|
||||||
|
- **Files**: the person's own files, read-only, from the folder button beside Settings. Browse
|
||||||
|
the tree as the web UI's explorer shows it (folders first, back goes up one), and open a file
|
||||||
|
in the same viewer as a shown one, under the same rules. A file the server does not hand over
|
||||||
|
as text -- an image, a binary, anything over 1 MB -- says why, and offers the web UI's viewer.
|
||||||
|
- **A server older than 2.0 is refused** with a sentence, at sign-in and for an instance signed
|
||||||
|
in to before: the device-link protocol must be 3 or newer, and the app API 2.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- **The server's contract is pinned to LLeMbas 2.0** (`dev`): no canvas, chats without knowledge
|
||||||
|
bases. Theme and strings are generated from the same commit; `gen-strings.py` takes a server
|
||||||
|
ref, as the other two scripts do. Selected text uses the web UI's `--selection` tint.
|
||||||
|
- **The app reads app API 2**, the server 2.0's: a server that still says 1 (a 2.0 build from
|
||||||
|
before the show route and the files) is refused as too old, one that says 3 as too new.
|
||||||
|
- **A shown file is fetched from the server's own route**, `GET /api/v2/chats/{chat}/show`
|
||||||
|
(`?node=&version=` for a file in the tree, `?shown=` for a device's copy), and a file that is
|
||||||
|
not text says so in the server's words. The contract now carries the server's `show` cards and
|
||||||
|
the files routes, and the tests read those instead of a hand-written card.
|
||||||
|
- CI also runs on pushes to `dev`.
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- **The Reports notification channel**: LLeMbas 2.0 has no reports. The channel is deleted on
|
||||||
|
first start.
|
||||||
|
|
||||||
## [0.1.0] — unreleased
|
## [0.1.0] — unreleased
|
||||||
|
|
||||||
The first version: a native client for a LLeMbas instance (server 1.7.0 or newer), and the
|
The first version: a native client for a LLeMbas instance (server 1.7.0 or newer), and the
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ digital assistant -- hold the power button and ask.
|
|||||||
|
|
||||||
Download the APK from the [latest release](https://github.com/LLeMbas/LLeMbas-Android/releases/latest)
|
Download the APK from the [latest release](https://github.com/LLeMbas/LLeMbas-Android/releases/latest)
|
||||||
and check it against `SHA256SUMS`. The `full` APK updates itself from llembas.eu; the `-fdroid`
|
and check it against `SHA256SUMS`. The `full` APK updates itself from llembas.eu; the `-fdroid`
|
||||||
one does not. Android 10 or newer; the instance must run LLeMbas server 1.7.0 or newer.
|
one does not. Android 10 or newer; the instance must run LLeMbas server 2.0 or newer (an older
|
||||||
|
one is refused at sign-in, with a sentence saying so).
|
||||||
|
|
||||||
If your instance uses a certificate from your own certificate authority, install that CA on the
|
If your instance uses a certificate from your own certificate authority, install that CA on the
|
||||||
phone first (Settings › Security › Encryption & credentials › Install a certificate › CA
|
phone first (Settings › Security › Encryption & credentials › Install a certificate › CA
|
||||||
@@ -40,13 +41,14 @@ preinstalled assistant; no app from outside can use it.
|
|||||||
Builds run on GitHub Actions (`.github/workflows/ci.yml`); locally it is the usual
|
Builds run on GitHub Actions (`.github/workflows/ci.yml`); locally it is the usual
|
||||||
`./gradlew assembleFullDebug` with JDK 17 and the Android SDK.
|
`./gradlew assembleFullDebug` with JDK 17 and the Android SDK.
|
||||||
|
|
||||||
Three things are generated from the server and pinned, each with a lock file CI checks:
|
Three things are generated from the server at one ref; the first two are pinned with a lock
|
||||||
|
file CI checks, and CI checks the strings against the code:
|
||||||
|
|
||||||
| What | Script | From the server |
|
| What | Script | From the server |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `ui/theme/Tokens.kt` | `scripts/fetch-tokens.py <server-ref>` | `tokens.css` |
|
| `ui/theme/Tokens.kt` | `scripts/fetch-tokens.py <server-ref>` | `tokens.css` |
|
||||||
| `contract/*.json` | `scripts/fetch-contract.py <server-ref>` | `tests/fixtures/api_v2/` |
|
| `contract/*.json` | `scripts/fetch-contract.py <server-ref>` | `tests/fixtures/api_v2/` |
|
||||||
| `res/values*/strings.xml` | `scripts/gen-strings.py` | the translation catalogues |
|
| `res/values*/strings.xml` | `scripts/gen-strings.py <server-ref>` | the translation catalogues |
|
||||||
|
|
||||||
The icons come from the server's pixel leaf (`scripts/gen-icons.py`).
|
The icons come from the server's pixel leaf (`scripts/gen-icons.py`).
|
||||||
|
|
||||||
|
|||||||
@@ -28,10 +28,13 @@ android {
|
|||||||
minSdk = 29
|
minSdk = 29
|
||||||
targetSdk = 36
|
targetSdk = 36
|
||||||
// The one source of the version. versionCode is derived from it, so the two cannot
|
// The one source of the version. versionCode is derived from it, so the two cannot
|
||||||
// drift: 0.1.0 -> 100, 1.2.3 -> 10203.
|
// drift, and a beta sorts below its release: 1.0.0-beta.1 -> 1000001,
|
||||||
versionName = "0.1.0"
|
// 1.0.0-beta.2 -> 1000002, 1.0.0 -> 1000099, 1.2.3 -> 1020399.
|
||||||
versionCode = versionName!!.split(".").map { it.toInt() }.let { (a, b, c) ->
|
versionName = "1.0.0-beta.1"
|
||||||
a * 10000 + b * 100 + c
|
versionCode = versionName!!.split("-beta.").let { parts ->
|
||||||
|
val (a, b, c) = parts[0].split(".").map { it.toInt() }
|
||||||
|
val pre = if (parts.size == 2) parts[1].toInt() else 99
|
||||||
|
((a * 10000 + b * 100 + c) * 100) + pre
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,15 +18,16 @@ class LembasApp : Application() {
|
|||||||
listOf(
|
listOf(
|
||||||
NotificationChannel(CHANNEL_REPLIES, getString(R.string.channel_replies), NotificationManager.IMPORTANCE_DEFAULT),
|
NotificationChannel(CHANNEL_REPLIES, getString(R.string.channel_replies), NotificationManager.IMPORTANCE_DEFAULT),
|
||||||
NotificationChannel(CHANNEL_ASKS, getString(R.string.channel_asks), NotificationManager.IMPORTANCE_HIGH),
|
NotificationChannel(CHANNEL_ASKS, getString(R.string.channel_asks), NotificationManager.IMPORTANCE_HIGH),
|
||||||
NotificationChannel(CHANNEL_REPORTS, getString(R.string.channel_reports), NotificationManager.IMPORTANCE_LOW),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
// LLeMbas 2.0 has no reports, so 0.1's channel for them goes rather than sit empty in
|
||||||
|
// the system's settings.
|
||||||
|
manager.deleteNotificationChannel("reports")
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val CHANNEL_REPLIES = "replies"
|
const val CHANNEL_REPLIES = "replies"
|
||||||
const val CHANNEL_ASKS = "asks"
|
const val CHANNEL_ASKS = "asks"
|
||||||
const val CHANNEL_REPORTS = "reports"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import eu.llembas.android.auth.Prefs
|
|||||||
import eu.llembas.android.push.Notifications
|
import eu.llembas.android.push.Notifications
|
||||||
import eu.llembas.android.ui.chat.ChatScreen
|
import eu.llembas.android.ui.chat.ChatScreen
|
||||||
import eu.llembas.android.ui.chats.ChatsScreen
|
import eu.llembas.android.ui.chats.ChatsScreen
|
||||||
|
import eu.llembas.android.ui.files.FilesScreen
|
||||||
import eu.llembas.android.ui.settings.SettingsScreen
|
import eu.llembas.android.ui.settings.SettingsScreen
|
||||||
import eu.llembas.android.ui.signin.SignInScreen
|
import eu.llembas.android.ui.signin.SignInScreen
|
||||||
import eu.llembas.android.ui.theme.LembasTheme
|
import eu.llembas.android.ui.theme.LembasTheme
|
||||||
@@ -89,6 +90,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
onOpen = { nav.navigate("chat/$it") },
|
onOpen = { nav.navigate("chat/$it") },
|
||||||
onNew = { nav.navigate("new") },
|
onNew = { nav.navigate("new") },
|
||||||
onSettings = { nav.navigate("settings") },
|
onSettings = { nav.navigate("settings") },
|
||||||
|
onFiles = { nav.navigate("files") },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
composable("new") {
|
composable("new") {
|
||||||
@@ -103,6 +105,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
composable("chat/{id}") { entry ->
|
composable("chat/{id}") { entry ->
|
||||||
ChatScreen(chatId = entry.arguments?.getString("id"), onBack = { nav.popBackStack() })
|
ChatScreen(chatId = entry.arguments?.getString("id"), onBack = { nav.popBackStack() })
|
||||||
}
|
}
|
||||||
|
composable("files") { FilesScreen(onBack = { nav.popBackStack() }) }
|
||||||
composable("settings") {
|
composable("settings") {
|
||||||
SettingsScreen(onBack = { nav.popBackStack() }, onAddInstance = { nav.navigate("add") })
|
SettingsScreen(onBack = { nav.popBackStack() }, onAddInstance = { nav.navigate("add") })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -227,6 +227,62 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- What a `show` card opens -------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The text of a file a `show` card named, as the chat sees it now:
|
||||||
|
* `GET /api/v2/chats/{chat}/show?node=<node_id>&version=<version_id>` for a file in the tree,
|
||||||
|
* `?shown=<shown_id>` for the copy a linked device sent ([ShowCard.query]). The server rebuilds
|
||||||
|
* the chat's view and checks the path again, so a grant taken away since takes the file away
|
||||||
|
* too (404, in the server's words). `text/plain; charset=utf-8`, at most 1 MB: above it a 413,
|
||||||
|
* and a 415 for a file that is not text. Always plain text -- an HTML file is its source, and
|
||||||
|
* the app never asks for a page to render.
|
||||||
|
*/
|
||||||
|
suspend fun shownText(chatId: String, show: ShowCard): String = withContext(Dispatchers.IO) {
|
||||||
|
val url = "$v2/chats/$chatId/show".toHttpUrl().newBuilder()
|
||||||
|
.apply { show.query.forEach { (k, v) -> addQueryParameter(k, v) } }
|
||||||
|
.build()
|
||||||
|
http.newCall(authed(url.toString()).header("Accept", "text/plain").get().build()).await().use {
|
||||||
|
if (!it.isSuccessful) throw ApiException(it.code, detail(it))
|
||||||
|
val body = it.body!!
|
||||||
|
// The server shows at most 1 MB; anything much larger is not a file it meant.
|
||||||
|
if (body.contentLength() > SHOWN_MAX_BYTES) throw ApiException(413, "")
|
||||||
|
val bytes = body.source().use { source ->
|
||||||
|
source.request(SHOWN_MAX_BYTES + 1)
|
||||||
|
source.buffer.readByteArray(minOf(source.buffer.size, SHOWN_MAX_BYTES + 1))
|
||||||
|
}
|
||||||
|
if (bytes.size > SHOWN_MAX_BYTES) throw ApiException(413, "")
|
||||||
|
bytes.toString(Charsets.UTF_8)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- The person's files ------------------------------------------------------------------
|
||||||
|
|
||||||
|
/** A directory, as the person may see it (no chat's grants): `GET /api/v2/files?path=`. */
|
||||||
|
suspend fun files(path: String = "/"): FileListing {
|
||||||
|
val url = "$v2/files".toHttpUrl().newBuilder().addQueryParameter("path", path).build()
|
||||||
|
return call(authed(url.toString()).get().build(), FileListing.serializer())
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A file's text: `GET /api/v2/files/content?path=`. A file the server will not hand over as
|
||||||
|
* text (not text, over 1 MB) is not an error: it comes back with `withheld` saying why.
|
||||||
|
*/
|
||||||
|
suspend fun fileContent(path: String): FileContent {
|
||||||
|
val url = "$v2/files/content".toHttpUrl().newBuilder().addQueryParameter("path", path).build()
|
||||||
|
return call(authed(url.toString()).get().build(), FileContent.serializer())
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A file of the tree in the web UI's own viewer (`/files/view`), for what the app does not draw. */
|
||||||
|
fun webFile(path: String): String = "$base/files/view".toHttpUrl().newBuilder().addQueryParameter("path", path).build().toString()
|
||||||
|
|
||||||
|
/** The same file in the web UI's viewer, which renders HTML in its sealed frame. */
|
||||||
|
fun webViewer(chatId: String, show: ShowCard): String = "$base/chat/$chatId/show".toHttpUrl().newBuilder()
|
||||||
|
.apply { show.query.forEach { (k, v) -> addQueryParameter(k, v) } }
|
||||||
|
.apply { if (show.line > 0) addQueryParameter("line", show.line.toString()) }
|
||||||
|
.build()
|
||||||
|
.toString()
|
||||||
|
|
||||||
// --- Push --------------------------------------------------------------------------------
|
// --- Push --------------------------------------------------------------------------------
|
||||||
suspend fun pushKey(): PushKey = get("/push")
|
suspend fun pushKey(): PushKey = get("/push")
|
||||||
|
|
||||||
@@ -265,6 +321,9 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
|
|||||||
authed("$v2/chats/$chatId/messages/$messageId/stream").header("Accept", "text/event-stream").build()
|
authed("$v2/chats/$chatId/messages/$messageId/stream").header("Accept", "text/event-stream").build()
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
/** 1 MB, the server's own limit on a shown file, with room for a little more. */
|
||||||
|
const val SHOWN_MAX_BYTES = 1_100_000L
|
||||||
|
|
||||||
fun emptyBody(): RequestBody = ByteArray(0).toRequestBody(null)
|
fun emptyBody(): RequestBody = ByteArray(0).toRequestBody(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package eu.llembas.android.api
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The app API this app reads: 2, the server's 2.0 (no canvas, no `knowledge_bases`, the `show`
|
||||||
|
* card and its route, and the person's files). A server with a newer one is told about, not
|
||||||
|
* guessed at; one with an older one is refused, because 1 has neither the show route nor the
|
||||||
|
* files this app opens -- a 2.0 `dev` server from before the files routes still said 1.
|
||||||
|
*/
|
||||||
|
const val APP_API = 2
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The device-link protocol of LLeMbas 2.0. This app is built for 2.0 -- the file tree, the
|
||||||
|
* access levels, the `show` card -- and a 1.x server (protocol 1 or 2) is refused with a
|
||||||
|
* sentence rather than half-working. The protocol, not the version string, is the test: a
|
||||||
|
* server's `dev` branch says 1.7.x until its first beta, and the protocol is what 2.0 raised on
|
||||||
|
* purpose so that old clients can tell.
|
||||||
|
*/
|
||||||
|
const val MIN_PROTOCOL = 3
|
||||||
|
|
||||||
|
/** Whether this app can work with a server, from its discovery document. */
|
||||||
|
enum class ServerFit { FITS, NOT_LEMBAS, TOO_OLD, TOO_NEW }
|
||||||
|
|
||||||
|
fun fit(found: Discovery): ServerFit {
|
||||||
|
val protocol = maxOf(found.protocol, found.protocols.maxOrNull() ?: 0)
|
||||||
|
return when {
|
||||||
|
found.service != "lembas" -> ServerFit.NOT_LEMBAS
|
||||||
|
protocol < MIN_PROTOCOL || found.appApi < APP_API || "app" !in found.scopes -> ServerFit.TOO_OLD
|
||||||
|
found.appApi > APP_API -> ServerFit.TOO_NEW
|
||||||
|
else -> ServerFit.FITS
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,6 +27,9 @@ data class Discovery(
|
|||||||
val version: String = "",
|
val version: String = "",
|
||||||
val name: String = "",
|
val name: String = "",
|
||||||
@SerialName("base_url") val baseUrl: String = "",
|
@SerialName("base_url") val baseUrl: String = "",
|
||||||
|
/** The device link's protocol: 3 from LLeMbas 2.0 on, which is what this app needs. */
|
||||||
|
val protocol: Int = 0,
|
||||||
|
val protocols: List<Int> = emptyList(),
|
||||||
@SerialName("app_api") val appApi: Int = 0,
|
@SerialName("app_api") val appApi: Int = 0,
|
||||||
val login: Login = Login(),
|
val login: Login = Login(),
|
||||||
val scopes: List<String> = emptyList(),
|
val scopes: List<String> = emptyList(),
|
||||||
@@ -191,9 +194,89 @@ data class ToolCall(
|
|||||||
val truncated: Boolean = false,
|
val truncated: Boolean = false,
|
||||||
val job: JsonElement? = null,
|
val job: JsonElement? = null,
|
||||||
val children: List<ToolCall>? = null,
|
val children: List<ToolCall>? = null,
|
||||||
|
/** The `show` tool's card: a file put in front of the person. Never its text. */
|
||||||
|
val show: ShowCard? = null,
|
||||||
val block: ToolBlock = ToolBlock(),
|
val block: ToolBlock = ToolBlock(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What a `show` call put in front of the person (`event["show"]`, harness spec 3.0.0): the
|
||||||
|
* file's name and where it is, never its contents -- the viewer fetches those. A file from the
|
||||||
|
* chat's own tree names its node and version; a file a linked device sent names the copy the
|
||||||
|
* server kept (`shown_id`), with the tree's two ids empty.
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class ShowCard(
|
||||||
|
val path: String = "",
|
||||||
|
val name: String = "",
|
||||||
|
/** `markdown`, `code`, `text` or `html`; anything else is read as `text`. */
|
||||||
|
val kind: String = "text",
|
||||||
|
val language: String = "",
|
||||||
|
val line: Int = 0,
|
||||||
|
@SerialName("node_id") val nodeId: String = "",
|
||||||
|
@SerialName("version_id") val versionId: String = "",
|
||||||
|
val sha: String = "",
|
||||||
|
val size: Long = 0,
|
||||||
|
val mime: String = "",
|
||||||
|
val source: String = "",
|
||||||
|
@SerialName("shown_id") val shownId: String = "",
|
||||||
|
) {
|
||||||
|
/** The kind the viewer draws: an unknown one is plain text, never something richer. */
|
||||||
|
val viewKind: String get() = if (kind in VIEW_KINDS) kind else "text"
|
||||||
|
|
||||||
|
/** Which file, as the server's viewer routes take it: the device's copy, or node and version. */
|
||||||
|
val query: List<Pair<String, String>>
|
||||||
|
get() = if (shownId.isNotEmpty()) listOf("shown" to shownId) else listOf("node" to nodeId, "version" to versionId)
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val VIEW_KINDS = setOf("markdown", "code", "text", "html")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- The person's files (`GET /files`, `GET /files/content`) ----------------------------------
|
||||||
|
|
||||||
|
/** One entry of a directory: `kind` is `file`, `dir` or `mount`. */
|
||||||
|
@Serializable
|
||||||
|
data class FileEntry(
|
||||||
|
val name: String = "",
|
||||||
|
val path: String = "",
|
||||||
|
val kind: String = "file",
|
||||||
|
val size: Long = 0,
|
||||||
|
val mime: String = "",
|
||||||
|
@SerialName("updated_at") val updatedAt: String? = null,
|
||||||
|
) {
|
||||||
|
/** A directory or a mount: something to open as a listing, not in the viewer. */
|
||||||
|
val isFolder: Boolean get() = kind == "dir" || kind == "mount"
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A directory, through the person's own access. `parent` is null at `/`. */
|
||||||
|
@Serializable
|
||||||
|
data class FileListing(val path: String = "/", val parent: String? = null, val entries: List<FileEntry> = emptyList())
|
||||||
|
|
||||||
|
/** Why a file's text did not come: `reason` is `not_text` or `too_large`; `message` says it. */
|
||||||
|
@Serializable
|
||||||
|
data class Withheld(val reason: String = "", val message: String = "")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A file's text, as the explorer's viewer reads it. An HTML file is its source, never rendered;
|
||||||
|
* a file that is not text or is over 1 MB has an empty [text] and says why in [withheld].
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class FileContent(
|
||||||
|
val path: String = "",
|
||||||
|
val name: String = "",
|
||||||
|
val size: Long = 0,
|
||||||
|
val mime: String = "",
|
||||||
|
val kind: String = "text",
|
||||||
|
val language: String = "",
|
||||||
|
val sha: String = "",
|
||||||
|
val text: String = "",
|
||||||
|
val withheld: Withheld? = null,
|
||||||
|
) {
|
||||||
|
/** The kind the viewer draws, by the `show` card's rule: anything unknown is plain text. */
|
||||||
|
val viewKind: String get() = if (kind in ShowCard.VIEW_KINDS) kind else "text"
|
||||||
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class SteerNote(val id: String = "", val text: String = "")
|
data class SteerNote(val id: String = "", val text: String = "")
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ object Notifications {
|
|||||||
)
|
)
|
||||||
val channel = when (payload.kind) {
|
val channel = when (payload.kind) {
|
||||||
"ask" -> LembasApp.CHANNEL_ASKS
|
"ask" -> LembasApp.CHANNEL_ASKS
|
||||||
"report" -> LembasApp.CHANNEL_REPORTS
|
|
||||||
else -> LembasApp.CHANNEL_REPLIES
|
else -> LembasApp.CHANNEL_REPLIES
|
||||||
}
|
}
|
||||||
val builder = NotificationCompat.Builder(context, channel)
|
val builder = NotificationCompat.Builder(context, channel)
|
||||||
|
|||||||
@@ -28,9 +28,11 @@ import androidx.compose.material.icons.filled.Language
|
|||||||
import androidx.compose.material.icons.filled.Psychology
|
import androidx.compose.material.icons.filled.Psychology
|
||||||
import androidx.compose.material.icons.filled.Search
|
import androidx.compose.material.icons.filled.Search
|
||||||
import androidx.compose.material.icons.filled.Terminal
|
import androidx.compose.material.icons.filled.Terminal
|
||||||
|
import androidx.compose.material.icons.filled.Visibility
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.material3.TextButton
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
@@ -46,6 +48,7 @@ import androidx.compose.ui.unit.dp
|
|||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import eu.llembas.android.R
|
import eu.llembas.android.R
|
||||||
import eu.llembas.android.api.Message
|
import eu.llembas.android.api.Message
|
||||||
|
import eu.llembas.android.api.ShowCard
|
||||||
import eu.llembas.android.api.Step
|
import eu.llembas.android.api.Step
|
||||||
import eu.llembas.android.api.ToolCall
|
import eu.llembas.android.api.ToolCall
|
||||||
import eu.llembas.android.ui.MarkdownText
|
import eu.llembas.android.ui.MarkdownText
|
||||||
@@ -79,15 +82,18 @@ fun UserBubble(message: Message, modifier: Modifier = Modifier) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A reply's steps, in the order they happened: the same table of contents the web page draws. */
|
/**
|
||||||
|
* A reply's steps, in the order they happened: the same table of contents the web page draws.
|
||||||
|
* [onShow] opens a `show` card's file; without it (the assistant's sheet) the card only names it.
|
||||||
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun Steps(steps: List<Step>, modifier: Modifier = Modifier) {
|
fun Steps(steps: List<Step>, modifier: Modifier = Modifier, onShow: ((ShowCard) -> Unit)? = null) {
|
||||||
Column(modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
Column(modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||||
steps.forEach { step ->
|
steps.forEach { step ->
|
||||||
when (step.kind) {
|
when (step.kind) {
|
||||||
"thinking" -> Thinking(step)
|
"thinking" -> Thinking(step)
|
||||||
"text" -> MarkdownText(step.markdown.orEmpty(), modifier = Modifier.fillMaxWidth())
|
"text" -> MarkdownText(step.markdown.orEmpty(), modifier = Modifier.fillMaxWidth())
|
||||||
"tools" -> step.calls.forEach { ToolCallBlock(it) }
|
"tools" -> step.calls.forEach { ToolCallBlock(it, onShow = onShow) }
|
||||||
"steer" -> step.messages.forEach { Steered(it.text) }
|
"steer" -> step.messages.forEach { Steered(it.text) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -140,10 +146,15 @@ private fun iconFor(kind: String): ImageVector = when (kind) {
|
|||||||
* scroller, so a megabyte of output never becomes the page.
|
* scroller, so a megabyte of output never becomes the page.
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun ToolCallBlock(call: ToolCall, depth: Int = 0) {
|
fun ToolCallBlock(call: ToolCall, depth: Int = 0, onShow: ((ShowCard) -> Unit)? = null) {
|
||||||
val palette = LocalPalette.current
|
val palette = LocalPalette.current
|
||||||
var open by rememberSaveable(call.id ?: call.block.title) { mutableStateOf(call.block.kind == "edit") }
|
var open by rememberSaveable(call.id ?: call.block.title) { mutableStateOf(call.block.kind == "edit") }
|
||||||
val failed = call.status == "error" || !call.error.isNullOrEmpty()
|
val failed = call.status == "error" || !call.error.isNullOrEmpty()
|
||||||
|
val shown = call.show
|
||||||
|
if (shown != null && !failed) {
|
||||||
|
ShowCardRow(shown, depth, onShow)
|
||||||
|
return
|
||||||
|
}
|
||||||
Column(
|
Column(
|
||||||
Modifier
|
Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@@ -192,7 +203,49 @@ fun ToolCallBlock(call: ToolCall, depth: Int = 0) {
|
|||||||
if (call.truncated) {
|
if (call.truncated) {
|
||||||
Text(stringResource(R.string.output_cut), style = MaterialTheme.typography.labelSmall, color = palette.inkFaint)
|
Text(stringResource(R.string.output_cut), style = MaterialTheme.typography.labelSmall, color = palette.inkFaint)
|
||||||
}
|
}
|
||||||
call.children?.forEach { ToolCallBlock(it, depth + 1) }
|
call.children?.forEach { ToolCallBlock(it, depth + 1, onShow) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A `show` card: the file's name and path, and Open. Nothing of its contents -- the words here
|
||||||
|
* are a path a model chose, drawn as text like everything else. The web page opens a card that
|
||||||
|
* arrives while it is open by itself, beside the conversation, when the screen is wide enough;
|
||||||
|
* a phone's screen is not, so here it waits for a tap.
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
private fun ShowCardRow(show: ShowCard, depth: Int, onShow: ((ShowCard) -> Unit)?) {
|
||||||
|
val palette = LocalPalette.current
|
||||||
|
Row(
|
||||||
|
Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(start = (depth * 16).dp)
|
||||||
|
.background(palette.surfaceRaised, Rounded)
|
||||||
|
.border(1.dp, palette.border, Rounded)
|
||||||
|
.then(if (onShow != null) Modifier.clickable { onShow(show) } else Modifier)
|
||||||
|
.padding(start = 12.dp, end = 4.dp, top = 4.dp, bottom = 4.dp)
|
||||||
|
.heightIn(min = 48.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
) {
|
||||||
|
Icon(Icons.Filled.Visibility, contentDescription = stringResource(R.string.shown), modifier = Modifier.size(18.dp), tint = palette.leaf)
|
||||||
|
Spacer(Modifier.width(10.dp))
|
||||||
|
// The one part that gives: a long path shortens, the button keeps its size.
|
||||||
|
Column(Modifier.weight(1f)) {
|
||||||
|
Text(show.name.ifBlank { show.path }, style = MaterialTheme.typography.bodyMedium, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
|
Text(
|
||||||
|
show.path + if (show.line > 0) ":${show.line}" else "",
|
||||||
|
fontFamily = FontFamily.Monospace,
|
||||||
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
color = palette.inkFaint,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (onShow != null) {
|
||||||
|
TextButton(onClick = { onShow(show) }, modifier = Modifier.heightIn(min = 48.dp)) {
|
||||||
|
Text(stringResource(R.string.viewer_open))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,9 +74,11 @@ import androidx.lifecycle.viewmodel.compose.viewModel
|
|||||||
import eu.llembas.android.R
|
import eu.llembas.android.R
|
||||||
import eu.llembas.android.api.Message
|
import eu.llembas.android.api.Message
|
||||||
import eu.llembas.android.api.ModelInfo
|
import eu.llembas.android.api.ModelInfo
|
||||||
|
import eu.llembas.android.api.ShowCard
|
||||||
import eu.llembas.android.assist.Recorder
|
import eu.llembas.android.assist.Recorder
|
||||||
import eu.llembas.android.lembas
|
import eu.llembas.android.lembas
|
||||||
import eu.llembas.android.ui.theme.LocalPalette
|
import eu.llembas.android.ui.theme.LocalPalette
|
||||||
|
import eu.llembas.android.ui.viewer.FileViewer
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@@ -88,6 +90,7 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
|||||||
val snackbar = remember { SnackbarHostState() }
|
val snackbar = remember { SnackbarHostState() }
|
||||||
var menu by remember { mutableStateOf(false) }
|
var menu by remember { mutableStateOf(false) }
|
||||||
var editing by remember { mutableStateOf<Message?>(null) }
|
var editing by remember { mutableStateOf<Message?>(null) }
|
||||||
|
var showing by remember { mutableStateOf<ShowCard?>(null) }
|
||||||
|
|
||||||
LaunchedEffect(chatId) { model.open(chatId) }
|
LaunchedEffect(chatId) { model.open(chatId) }
|
||||||
// A new chat gets its id from its first message; the route follows, so Back and a
|
// A new chat gets its id from its first message; the route follows, so Back and a
|
||||||
@@ -202,13 +205,13 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
|||||||
}
|
}
|
||||||
|
|
||||||
live != null && live.messageId == message.id && live.finished == null -> Column {
|
live != null && live.messageId == message.id && live.finished == null -> Column {
|
||||||
Steps(live.shown)
|
Steps(live.shown, onShow = { showing = it })
|
||||||
if (live.shown.isEmpty()) Text(stringResource(R.string.loading_line), color = palette.inkFaint)
|
if (live.shown.isEmpty()) Text(stringResource(R.string.loading_line), color = palette.inkFaint)
|
||||||
live.metrics?.let { m -> ReplyFoot(message.copy(metrics = m)) }
|
live.metrics?.let { m -> ReplyFoot(message.copy(metrics = m)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> Column {
|
else -> Column {
|
||||||
Steps(message.steps)
|
Steps(message.steps, onShow = { showing = it })
|
||||||
ReplyFoot(message)
|
ReplyFoot(message)
|
||||||
if (live == null && message == rows.lastOrNull()) {
|
if (live == null && message == rows.lastOrNull()) {
|
||||||
Row {
|
Row {
|
||||||
@@ -236,6 +239,10 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showing?.let { file ->
|
||||||
|
state.chat?.id?.let { id -> FileViewer(id, file, onClose = { showing = null }) }
|
||||||
|
}
|
||||||
|
|
||||||
editing?.let { message ->
|
editing?.let { message ->
|
||||||
var text by remember(message.id) { mutableStateOf(message.text.orEmpty()) }
|
var text by remember(message.id) { mutableStateOf(message.text.orEmpty()) }
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import androidx.compose.foundation.shape.CircleShape
|
|||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.automirrored.filled.Chat
|
import androidx.compose.material.icons.automirrored.filled.Chat
|
||||||
import androidx.compose.material.icons.filled.Add
|
import androidx.compose.material.icons.filled.Add
|
||||||
|
import androidx.compose.material.icons.filled.Folder
|
||||||
import androidx.compose.material.icons.filled.Settings
|
import androidx.compose.material.icons.filled.Settings
|
||||||
import androidx.compose.material.icons.filled.Terminal
|
import androidx.compose.material.icons.filled.Terminal
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
@@ -53,7 +54,10 @@ import androidx.lifecycle.viewModelScope
|
|||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
import eu.llembas.android.R
|
import eu.llembas.android.R
|
||||||
import eu.llembas.android.api.Chat
|
import eu.llembas.android.api.Chat
|
||||||
|
import eu.llembas.android.api.Doorstep
|
||||||
|
import eu.llembas.android.api.fit
|
||||||
import eu.llembas.android.lembas
|
import eu.llembas.android.lembas
|
||||||
|
import eu.llembas.android.ui.signin.refusal
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.flow.asStateFlow
|
import kotlinx.coroutines.flow.asStateFlow
|
||||||
import kotlinx.coroutines.flow.update
|
import kotlinx.coroutines.flow.update
|
||||||
@@ -68,12 +72,29 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
|
|||||||
val state = _state.asStateFlow()
|
val state = _state.asStateFlow()
|
||||||
private var kind = "chat"
|
private var kind = "chat"
|
||||||
|
|
||||||
|
/** Why this instance is refused, once it was asked what it is; null while it fits. */
|
||||||
|
private var refused: Int? = null
|
||||||
|
private var checked = false
|
||||||
|
|
||||||
fun load(kind: String) {
|
fun load(kind: String) {
|
||||||
this.kind = kind
|
this.kind = kind
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
_state.update { it.copy(loading = true, error = null) }
|
_state.update { it.copy(loading = true, error = null) }
|
||||||
try {
|
try {
|
||||||
val api = getApplication<Application>().lembas.instances.client() ?: return@launch
|
val api = getApplication<Application>().lembas.instances.client() ?: return@launch
|
||||||
|
// An instance signed in to before it was downgraded, or by 0.1 against a 1.x
|
||||||
|
// server, is refused here as at sign-in. Unreachable is not refused: the chat
|
||||||
|
// list's own error says that better.
|
||||||
|
if (!checked) {
|
||||||
|
runCatching { Doorstep().discover(api.base) }.onSuccess {
|
||||||
|
checked = true
|
||||||
|
refused = refusal(fit(it))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
refused?.let { said ->
|
||||||
|
_state.value = ChatsState(error = getApplication<Application>().getString(said))
|
||||||
|
return@launch
|
||||||
|
}
|
||||||
val page = api.chats(kind = kind)
|
val page = api.chats(kind = kind)
|
||||||
_state.value = ChatsState(chats = page.chats, more = page.more)
|
_state.value = ChatsState(chats = page.chats, more = page.more)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@@ -112,7 +133,7 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
|
|||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun ChatsScreen(onOpen: (String) -> Unit, onNew: () -> Unit, onSettings: () -> Unit, model: ChatsViewModel = viewModel()) {
|
fun ChatsScreen(onOpen: (String) -> Unit, onNew: () -> Unit, onSettings: () -> Unit, onFiles: () -> Unit, model: ChatsViewModel = viewModel()) {
|
||||||
val state by model.state.collectAsStateWithLifecycle()
|
val state by model.state.collectAsStateWithLifecycle()
|
||||||
var tab by rememberSaveable { mutableIntStateOf(0) }
|
var tab by rememberSaveable { mutableIntStateOf(0) }
|
||||||
val kind = if (tab == 0) "chat" else "agent"
|
val kind = if (tab == 0) "chat" else "agent"
|
||||||
@@ -123,6 +144,9 @@ fun ChatsScreen(onOpen: (String) -> Unit, onNew: () -> Unit, onSettings: () -> U
|
|||||||
TopAppBar(
|
TopAppBar(
|
||||||
title = { Text(stringResource(R.string.app_name)) },
|
title = { Text(stringResource(R.string.app_name)) },
|
||||||
actions = {
|
actions = {
|
||||||
|
IconButton(onClick = onFiles) {
|
||||||
|
Icon(Icons.Filled.Folder, contentDescription = stringResource(R.string.files))
|
||||||
|
}
|
||||||
IconButton(onClick = onSettings) {
|
IconButton(onClick = onSettings) {
|
||||||
Icon(Icons.Filled.Settings, contentDescription = stringResource(R.string.settings))
|
Icon(Icons.Filled.Settings, contentDescription = stringResource(R.string.settings))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,195 @@
|
|||||||
|
@file:OptIn(androidx.compose.material3.ExperimentalMaterial3Api::class)
|
||||||
|
|
||||||
|
package eu.llembas.android.ui.files
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import android.text.format.Formatter
|
||||||
|
import androidx.activity.compose.BackHandler
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
|
import androidx.compose.foundation.lazy.items
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||||
|
import androidx.compose.material.icons.filled.Description
|
||||||
|
import androidx.compose.material.icons.filled.Folder
|
||||||
|
import androidx.compose.material.icons.filled.FolderShared
|
||||||
|
import androidx.compose.material3.HorizontalDivider
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.ListItem
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Scaffold
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.material3.TopAppBar
|
||||||
|
import androidx.compose.material3.pulltorefresh.PullToRefreshBox
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.saveable.rememberSaveable
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.text.font.FontFamily
|
||||||
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.lifecycle.AndroidViewModel
|
||||||
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
|
import eu.llembas.android.R
|
||||||
|
import eu.llembas.android.api.FileEntry
|
||||||
|
import eu.llembas.android.lembas
|
||||||
|
import eu.llembas.android.ui.theme.LocalPalette
|
||||||
|
import eu.llembas.android.ui.viewer.TreeFileViewer
|
||||||
|
import kotlinx.coroutines.Job
|
||||||
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
|
import kotlinx.coroutines.flow.asStateFlow
|
||||||
|
import kotlinx.coroutines.flow.update
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
/** One directory of the person's tree, and whether it is on its way. */
|
||||||
|
data class FilesState(
|
||||||
|
val path: String = "/",
|
||||||
|
val parent: String? = null,
|
||||||
|
val entries: List<FileEntry> = emptyList(),
|
||||||
|
val loading: Boolean = false,
|
||||||
|
val error: String? = null,
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The person's files, read-only: `GET /api/v2/files` as the explorer's listing. The tree is read
|
||||||
|
* as the person, with no chat -- their own access, the same the web UI's explorer draws by.
|
||||||
|
*/
|
||||||
|
class FilesViewModel(app: Application) : AndroidViewModel(app) {
|
||||||
|
private val _state = MutableStateFlow(FilesState(loading = true))
|
||||||
|
val state = _state.asStateFlow()
|
||||||
|
private var loading: Job? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens a directory. A refusal (a path no longer readable, the server unreachable) keeps the
|
||||||
|
* directory already shown and says why above it, so the way back is never lost.
|
||||||
|
*/
|
||||||
|
fun open(path: String) {
|
||||||
|
loading?.cancel()
|
||||||
|
loading = viewModelScope.launch {
|
||||||
|
_state.update { it.copy(loading = true, error = null) }
|
||||||
|
try {
|
||||||
|
val api = getApplication<Application>().lembas.instances.client()
|
||||||
|
if (api == null) {
|
||||||
|
_state.update { it.copy(loading = false) }
|
||||||
|
return@launch
|
||||||
|
}
|
||||||
|
val listing = api.files(path)
|
||||||
|
_state.value = FilesState(path = listing.path, parent = listing.parent, entries = listing.entries)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
if (e is kotlinx.coroutines.CancellationException) throw e
|
||||||
|
_state.update { it.copy(loading = false, error = e.message ?: e.javaClass.simpleName) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun reload() = open(_state.value.path)
|
||||||
|
|
||||||
|
fun up(): Boolean {
|
||||||
|
val parent = _state.value.parent ?: return false
|
||||||
|
open(parent)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun FilesScreen(onBack: () -> Unit, model: FilesViewModel = viewModel()) {
|
||||||
|
val state by model.state.collectAsStateWithLifecycle()
|
||||||
|
val palette = LocalPalette.current
|
||||||
|
var viewing by rememberSaveable { mutableStateOf<String?>(null) }
|
||||||
|
LaunchedEffect(Unit) { if (state.entries.isEmpty() && state.error == null) model.open(state.path) }
|
||||||
|
|
||||||
|
// Back goes up one directory first, as a file manager's does; at the top it leaves.
|
||||||
|
BackHandler(enabled = state.parent != null) { model.up() }
|
||||||
|
|
||||||
|
Scaffold(
|
||||||
|
topBar = {
|
||||||
|
TopAppBar(
|
||||||
|
navigationIcon = {
|
||||||
|
IconButton(onClick = { if (!model.up()) onBack() }) {
|
||||||
|
Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(R.string.back))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title = {
|
||||||
|
Column {
|
||||||
|
Text(stringResource(R.string.files), maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
|
Text(
|
||||||
|
if (state.parent == null) stringResource(R.string.files_all) else state.path,
|
||||||
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
fontFamily = if (state.parent == null) null else FontFamily.Monospace,
|
||||||
|
color = palette.inkFaint,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.StartEllipsis,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
},
|
||||||
|
) { padding ->
|
||||||
|
Column(Modifier.padding(padding).fillMaxSize()) {
|
||||||
|
state.error?.let {
|
||||||
|
Text(it, color = MaterialTheme.colorScheme.error, modifier = Modifier.padding(16.dp))
|
||||||
|
}
|
||||||
|
PullToRefreshBox(isRefreshing = state.loading, onRefresh = { model.reload() }, modifier = Modifier.fillMaxSize()) {
|
||||||
|
if (state.entries.isEmpty() && !state.loading && state.error == null) {
|
||||||
|
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.files_empty),
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
modifier = Modifier.padding(32.dp),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LazyColumn(Modifier.fillMaxSize()) {
|
||||||
|
items(state.entries, key = { it.path }) { entry ->
|
||||||
|
EntryRow(entry) { if (entry.isFolder) model.open(entry.path) else viewing = entry.path }
|
||||||
|
HorizontalDivider()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
viewing?.let { path -> TreeFileViewer(path, onClose = { viewing = null }) }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun EntryRow(entry: FileEntry, onOpen: () -> Unit) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
ListItem(
|
||||||
|
modifier = Modifier.fillMaxWidth().clickable(onClick = onOpen),
|
||||||
|
leadingContent = {
|
||||||
|
Icon(
|
||||||
|
when (entry.kind) {
|
||||||
|
"mount" -> Icons.Filled.FolderShared
|
||||||
|
"dir" -> Icons.Filled.Folder
|
||||||
|
else -> Icons.Filled.Description
|
||||||
|
},
|
||||||
|
contentDescription = null,
|
||||||
|
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
headlineContent = { Text(entry.name.ifBlank { entry.path }, maxLines = 1, overflow = TextOverflow.Ellipsis) },
|
||||||
|
supportingContent = if (entry.isFolder) {
|
||||||
|
null
|
||||||
|
} else {
|
||||||
|
{
|
||||||
|
val line = listOfNotNull(Formatter.formatShortFileSize(context, entry.size), entry.mime.ifBlank { null }).joinToString(" · ")
|
||||||
|
Text(line, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -43,6 +43,8 @@ import androidx.lifecycle.viewModelScope
|
|||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
import eu.llembas.android.R
|
import eu.llembas.android.R
|
||||||
import eu.llembas.android.api.Doorstep
|
import eu.llembas.android.api.Doorstep
|
||||||
|
import eu.llembas.android.api.ServerFit
|
||||||
|
import eu.llembas.android.api.fit
|
||||||
import eu.llembas.android.api.normaliseBase
|
import eu.llembas.android.api.normaliseBase
|
||||||
import eu.llembas.android.lembas
|
import eu.llembas.android.lembas
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
@@ -60,8 +62,12 @@ sealed interface SignInState {
|
|||||||
data object Done : SignInState
|
data object Done : SignInState
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The newest API this app reads. A server with a newer one is told about, not guessed at. */
|
/** The sentence for a server this app will not work with, or null when it fits. */
|
||||||
const val APP_API = 1
|
fun refusal(fit: ServerFit): Int? = when (fit) {
|
||||||
|
ServerFit.FITS -> null
|
||||||
|
ServerFit.NOT_LEMBAS, ServerFit.TOO_OLD -> R.string.signin_too_old
|
||||||
|
ServerFit.TOO_NEW -> R.string.signin_too_new
|
||||||
|
}
|
||||||
|
|
||||||
class SignInViewModel(app: Application) : AndroidViewModel(app) {
|
class SignInViewModel(app: Application) : AndroidViewModel(app) {
|
||||||
private val _state = MutableStateFlow<SignInState>(SignInState.Address)
|
private val _state = MutableStateFlow<SignInState>(SignInState.Address)
|
||||||
@@ -76,12 +82,8 @@ class SignInViewModel(app: Application) : AndroidViewModel(app) {
|
|||||||
try {
|
try {
|
||||||
val base = normaliseBase(typed)
|
val base = normaliseBase(typed)
|
||||||
val found = doorstep.discover(base)
|
val found = doorstep.discover(base)
|
||||||
if (found.service != "lembas" || found.appApi < 1 || "app" !in found.scopes) {
|
refusal(fit(found))?.let { said ->
|
||||||
_state.value = SignInState.Failed(getApplication<Application>().getString(R.string.signin_too_old))
|
_state.value = SignInState.Failed(getApplication<Application>().getString(said))
|
||||||
return@launch
|
|
||||||
}
|
|
||||||
if (found.appApi > APP_API) {
|
|
||||||
_state.value = SignInState.Failed(getApplication<Application>().getString(R.string.signin_too_new))
|
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
val device = getApplication<Application>().getString(R.string.device_name)
|
val device = getApplication<Application>().getString(R.string.device_name)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package eu.llembas.android.ui.theme
|
package eu.llembas.android.ui.theme
|
||||||
|
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
|
import androidx.compose.foundation.text.selection.LocalTextSelectionColors
|
||||||
|
import androidx.compose.foundation.text.selection.TextSelectionColors
|
||||||
import androidx.compose.material3.ColorScheme
|
import androidx.compose.material3.ColorScheme
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.darkColorScheme
|
import androidx.compose.material3.darkColorScheme
|
||||||
@@ -55,6 +57,10 @@ fun LembasTheme(choice: String = "", content: @Composable () -> Unit) {
|
|||||||
}
|
}
|
||||||
val palette = if (dark) Moria else Shire
|
val palette = if (dark) Moria else Shire
|
||||||
CompositionLocalProvider(LocalPalette provides palette) {
|
CompositionLocalProvider(LocalPalette provides palette) {
|
||||||
MaterialTheme(colorScheme = scheme(palette, dark), content = content)
|
MaterialTheme(colorScheme = scheme(palette, dark)) {
|
||||||
|
// The web UI's `--selection`: selected text is a tint you can find, not Material's default.
|
||||||
|
val selection = TextSelectionColors(handleColor = palette.accent, backgroundColor = palette.selection)
|
||||||
|
CompositionLocalProvider(LocalTextSelectionColors provides selection, content = content)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at v1.7.0. Do not edit.
|
// Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at v2.0.0-beta.1. Do not edit.
|
||||||
package eu.llembas.android.ui.theme
|
package eu.llembas.android.ui.theme
|
||||||
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
@@ -20,6 +20,7 @@ data class Palette(
|
|||||||
val accentHover: Color,
|
val accentHover: Color,
|
||||||
val accentInk: Color,
|
val accentInk: Color,
|
||||||
val accentSoft: Color,
|
val accentSoft: Color,
|
||||||
|
val selection: Color,
|
||||||
val leaf: Color,
|
val leaf: Color,
|
||||||
val danger: Color,
|
val danger: Color,
|
||||||
val dangerSoft: Color,
|
val dangerSoft: Color,
|
||||||
@@ -49,6 +50,7 @@ val Moria = Palette(
|
|||||||
accentHover = Color(0xFFB4E6F1L),
|
accentHover = Color(0xFFB4E6F1L),
|
||||||
accentInk = Color(0xFF061418L),
|
accentInk = Color(0xFF061418L),
|
||||||
accentSoft = Color(0x1F8FD8E8L),
|
accentSoft = Color(0x1F8FD8E8L),
|
||||||
|
selection = Color(0x528FD8E8L),
|
||||||
leaf = Color(0xFF7EE081L),
|
leaf = Color(0xFF7EE081L),
|
||||||
danger = Color(0xFFF0735FL),
|
danger = Color(0xFFF0735FL),
|
||||||
dangerSoft = Color(0x21F0735FL),
|
dangerSoft = Color(0x21F0735FL),
|
||||||
@@ -78,6 +80,7 @@ val Shire = Palette(
|
|||||||
accentHover = Color(0xFF1F4D30L),
|
accentHover = Color(0xFF1F4D30L),
|
||||||
accentInk = Color(0xFFF8F3E5L),
|
accentInk = Color(0xFFF8F3E5L),
|
||||||
accentSoft = Color(0x1A285F3CL),
|
accentSoft = Color(0x1A285F3CL),
|
||||||
|
selection = Color(0x3D285F3CL),
|
||||||
leaf = Color(0xFF3D6B1CL),
|
leaf = Color(0xFF3D6B1CL),
|
||||||
danger = Color(0xFFA3321FL),
|
danger = Color(0xFFA3321FL),
|
||||||
dangerSoft = Color(0x1AA3321FL),
|
dangerSoft = Color(0x1AA3321FL),
|
||||||
|
|||||||
@@ -0,0 +1,303 @@
|
|||||||
|
@file:OptIn(androidx.compose.material3.ExperimentalMaterial3Api::class)
|
||||||
|
|
||||||
|
package eu.llembas.android.ui.viewer
|
||||||
|
|
||||||
|
import android.content.ClipData
|
||||||
|
import android.content.ClipboardManager
|
||||||
|
import android.content.Context
|
||||||
|
import android.net.Uri
|
||||||
|
import androidx.browser.customtabs.CustomTabsIntent
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
|
import androidx.compose.foundation.lazy.itemsIndexed
|
||||||
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.automirrored.filled.OpenInNew
|
||||||
|
import androidx.compose.material.icons.filled.Close
|
||||||
|
import androidx.compose.material.icons.filled.ContentCopy
|
||||||
|
import androidx.compose.material3.CircularProgressIndicator
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.OutlinedButton
|
||||||
|
import androidx.compose.material3.Scaffold
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.material3.TopAppBar
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
|
import androidx.compose.ui.text.font.FontFamily
|
||||||
|
import androidx.compose.ui.text.rememberTextMeasurer
|
||||||
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.unit.sp
|
||||||
|
import androidx.compose.ui.window.Dialog
|
||||||
|
import androidx.compose.ui.window.DialogProperties
|
||||||
|
import eu.llembas.android.R
|
||||||
|
import eu.llembas.android.api.ApiClient
|
||||||
|
import eu.llembas.android.api.ApiException
|
||||||
|
import eu.llembas.android.api.ShowCard
|
||||||
|
import eu.llembas.android.lembas
|
||||||
|
import eu.llembas.android.ui.MarkdownText
|
||||||
|
import eu.llembas.android.ui.theme.LocalPalette
|
||||||
|
import java.io.IOException
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Markdown longer than this is shown as its lines instead. A TextView holding a whole megabyte
|
||||||
|
* of rendered Markdown stalls the phone; the same text as a lazy list of lines does not.
|
||||||
|
*/
|
||||||
|
private const val MARKDOWN_MAX_CHARS = 200_000
|
||||||
|
|
||||||
|
/** Where a file is on its way into the viewer. */
|
||||||
|
private sealed interface Loaded {
|
||||||
|
data object Loading : Loaded
|
||||||
|
|
||||||
|
/** [kind]: what the server said the file is, when it is only known once it came. */
|
||||||
|
data class Text(val text: String, val kind: String? = null) : Loaded
|
||||||
|
|
||||||
|
/** [unavailable]: this server has no door for the app to read the file through. */
|
||||||
|
data class Failed(val message: String, val unavailable: Boolean = false) : Loaded
|
||||||
|
}
|
||||||
|
|
||||||
|
/** What the viewer's title and body need to know before the text comes. */
|
||||||
|
private data class Viewed(val name: String, val path: String, val line: Int, val kind: String)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What a `show` card opens: the file, full screen, read-only, as the chat sees it now.
|
||||||
|
*
|
||||||
|
* Everything in it came from a model and is untrusted, as on the web page, so the rules are the
|
||||||
|
* same ones the transcript keeps: Markdown goes through [MarkdownText] (no images, no HTML, links
|
||||||
|
* outside for http, https and mailto only); code and text are drawn as lines, never interpreted.
|
||||||
|
* **HTML is shown as its source, never rendered** -- the app has no WebView, and a page a model
|
||||||
|
* wrote does not get one here. The web UI renders it in its sealed frame (an opaque origin with
|
||||||
|
* no network), and "Open in the browser" goes there.
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun FileViewer(chatId: String, show: ShowCard, onClose: () -> Unit) {
|
||||||
|
Viewer(
|
||||||
|
file = Viewed(show.name, show.path, show.line, show.viewKind),
|
||||||
|
key = chatId to show,
|
||||||
|
webUrl = { it.webViewer(chatId, show) },
|
||||||
|
load = { api, _ -> Loaded.Text(api.shownText(chatId, show)) },
|
||||||
|
onClose = onClose,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A file of the person's tree (the Files screen), in the same viewer and under the same rules:
|
||||||
|
* the person's own files are no more trusted than a model's, since a model may have written
|
||||||
|
* them. A file the server withholds (not text, over 1 MB) says why, and offers the web UI.
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun TreeFileViewer(path: String, onClose: () -> Unit) {
|
||||||
|
Viewer(
|
||||||
|
file = Viewed(path.substringAfterLast('/').ifBlank { path }, path, 0, "text"),
|
||||||
|
key = path,
|
||||||
|
webUrl = { it.webFile(path) },
|
||||||
|
load = { api, context ->
|
||||||
|
val file = api.fileContent(path)
|
||||||
|
val withheld = file.withheld
|
||||||
|
when {
|
||||||
|
withheld == null -> Loaded.Text(file.text, file.viewKind)
|
||||||
|
withheld.message.isNotBlank() -> Loaded.Failed(withheld.message)
|
||||||
|
withheld.reason == "too_large" -> Loaded.Failed(context.getString(R.string.viewer_too_large))
|
||||||
|
else -> Loaded.Failed(context.getString(R.string.viewer_not_text))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClose = onClose,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun Viewer(file: Viewed, key: Any, webUrl: (ApiClient) -> String?, load: suspend (ApiClient, Context) -> Loaded, onClose: () -> Unit) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
val palette = LocalPalette.current
|
||||||
|
var loaded by remember(key) { mutableStateOf<Loaded>(Loaded.Loading) }
|
||||||
|
var web by remember(key) { mutableStateOf<String?>(null) }
|
||||||
|
|
||||||
|
LaunchedEffect(key) {
|
||||||
|
val api = context.lembas.instances.client()
|
||||||
|
if (api == null) {
|
||||||
|
loaded = Loaded.Failed(context.getString(R.string.assist_signed_out))
|
||||||
|
return@LaunchedEffect
|
||||||
|
}
|
||||||
|
web = webUrl(api)
|
||||||
|
loaded = try {
|
||||||
|
load(api, context)
|
||||||
|
} catch (e: ApiException) {
|
||||||
|
when {
|
||||||
|
e.status == 413 -> Loaded.Failed(context.getString(R.string.viewer_too_large))
|
||||||
|
|
||||||
|
e.status == 415 -> Loaded.Failed(e.message?.ifBlank { null } ?: context.getString(R.string.viewer_not_text))
|
||||||
|
|
||||||
|
// No such route at all (FastAPI's own "Not Found", or the wrong method): a
|
||||||
|
// server without the app's door to the file. Its own 404 has a sentence.
|
||||||
|
e.status == 405 || (e.status == 404 && e.message == "Not Found") ->
|
||||||
|
Loaded.Failed(context.getString(R.string.viewer_unavailable), unavailable = true)
|
||||||
|
|
||||||
|
else -> Loaded.Failed(e.message ?: context.getString(R.string.viewer_unavailable))
|
||||||
|
}
|
||||||
|
} catch (e: IOException) {
|
||||||
|
Loaded.Failed(e.message ?: e.javaClass.simpleName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Dialog(onDismissRequest = onClose, properties = DialogProperties(usePlatformDefaultWidth = false)) {
|
||||||
|
Scaffold(
|
||||||
|
topBar = {
|
||||||
|
TopAppBar(
|
||||||
|
navigationIcon = {
|
||||||
|
IconButton(onClick = onClose) {
|
||||||
|
Icon(Icons.Filled.Close, contentDescription = stringResource(R.string.close))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title = {
|
||||||
|
Column {
|
||||||
|
Text(file.name.ifBlank { file.path }, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
|
Text(
|
||||||
|
file.path + if (file.line > 0) ":${file.line}" else "",
|
||||||
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
fontFamily = FontFamily.Monospace,
|
||||||
|
color = palette.inkFaint,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
(loaded as? Loaded.Text)?.let { done ->
|
||||||
|
IconButton(onClick = { copy(context, file.name, done.text) }) {
|
||||||
|
Icon(Icons.Filled.ContentCopy, contentDescription = stringResource(R.string.viewer_copy))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
web?.let { url ->
|
||||||
|
IconButton(onClick = { openOutside(context, url) }) {
|
||||||
|
Icon(Icons.AutoMirrored.Filled.OpenInNew, contentDescription = stringResource(R.string.viewer_open_browser))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
},
|
||||||
|
) { padding ->
|
||||||
|
Box(Modifier.padding(padding).fillMaxSize()) {
|
||||||
|
when (val now = loaded) {
|
||||||
|
Loaded.Loading -> CircularProgressIndicator(Modifier.align(Alignment.Center))
|
||||||
|
|
||||||
|
is Loaded.Failed -> Column(
|
||||||
|
Modifier.align(Alignment.Center).padding(32.dp),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
) {
|
||||||
|
Text(now.message, color = palette.inkMuted, textAlign = TextAlign.Center)
|
||||||
|
web?.let { url ->
|
||||||
|
OutlinedButton(onClick = { openOutside(context, url) }, modifier = Modifier.padding(top = 16.dp)) {
|
||||||
|
Text(stringResource(R.string.viewer_open_browser))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
is Loaded.Text -> Body(now.kind ?: file.kind, file.line, now.text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun Body(kind: String, line: Int, text: String) {
|
||||||
|
val palette = LocalPalette.current
|
||||||
|
if (kind == "markdown" && text.length <= MARKDOWN_MAX_CHARS) {
|
||||||
|
Column(Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(16.dp)) {
|
||||||
|
MarkdownText(text, modifier = Modifier.fillMaxWidth())
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val note = when (kind) {
|
||||||
|
"html" -> R.string.viewer_html_source
|
||||||
|
"markdown" -> R.string.viewer_long_markdown
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
Column(Modifier.fillMaxSize()) {
|
||||||
|
note?.let {
|
||||||
|
Text(
|
||||||
|
stringResource(it),
|
||||||
|
style = MaterialTheme.typography.bodySmall,
|
||||||
|
color = palette.inkMuted,
|
||||||
|
modifier = Modifier.fillMaxWidth().background(palette.bgSunken).padding(horizontal = 16.dp, vertical = 10.dp),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Lines(text, line)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A file as numbered lines, opened at the line the card named. The number column's width is
|
||||||
|
* measured, not guessed: it is the width of the longest number in this file, so every line's
|
||||||
|
* text starts at the same x whatever its number, and a wrapped line continues under its own
|
||||||
|
* text rather than under the numbers.
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
private fun Lines(text: String, line: Int) {
|
||||||
|
val palette = LocalPalette.current
|
||||||
|
val rows = remember(text) {
|
||||||
|
val split = text.split('\n')
|
||||||
|
if (split.size > 1 && split.last().isEmpty()) split.dropLast(1) else split
|
||||||
|
}
|
||||||
|
val style = TextStyle(fontFamily = FontFamily.Monospace, fontSize = 13.sp, lineHeight = 18.sp, color = palette.ink)
|
||||||
|
val measurer = rememberTextMeasurer()
|
||||||
|
val density = LocalDensity.current
|
||||||
|
val gutter = remember(rows.size, density) {
|
||||||
|
with(density) { measurer.measure("9".repeat(rows.size.toString().length), style).size.width.toDp() }
|
||||||
|
}
|
||||||
|
val state = rememberLazyListState(initialFirstVisibleItemIndex = (line - 1).coerceIn(0, (rows.size - 1).coerceAtLeast(0)))
|
||||||
|
LazyColumn(
|
||||||
|
state = state,
|
||||||
|
modifier = Modifier.fillMaxSize().background(palette.codeBg),
|
||||||
|
contentPadding = PaddingValues(vertical = 8.dp),
|
||||||
|
) {
|
||||||
|
itemsIndexed(rows) { i, row ->
|
||||||
|
val here = line > 0 && i == line - 1
|
||||||
|
Row(
|
||||||
|
Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.then(if (here) Modifier.background(palette.accentSoft) else Modifier)
|
||||||
|
.padding(horizontal = 12.dp),
|
||||||
|
) {
|
||||||
|
Text((i + 1).toString(), style = style.copy(color = palette.inkFaint), textAlign = TextAlign.End, modifier = Modifier.width(gutter))
|
||||||
|
Spacer(Modifier.width(12.dp))
|
||||||
|
Text(row.ifEmpty { " " }, style = style, modifier = Modifier.weight(1f))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun copy(context: Context, label: String, text: String) {
|
||||||
|
context.getSystemService(ClipboardManager::class.java)?.setPrimaryClip(ClipData.newPlainText(label, text))
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The web UI's viewer, in the browser (a Custom Tab), where the person's own session is. */
|
||||||
|
private fun openOutside(context: Context, url: String) {
|
||||||
|
val uri = Uri.parse(url)
|
||||||
|
if (uri.scheme?.lowercase() !in setOf("http", "https")) return
|
||||||
|
runCatching { CustomTabsIntent.Builder().build().launchUrl(context, uri) }
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<string name="signin_open_browser">Otevřít v prohlížeči</string>
|
<string name="signin_open_browser">Otevřít v prohlížeči</string>
|
||||||
<string name="signin_denied">Přihlášení bylo odmítnuto.</string>
|
<string name="signin_denied">Přihlášení bylo odmítnuto.</string>
|
||||||
<string name="signin_expired">Kód vypršel, než byl schválen. Zkuste to znovu.</string>
|
<string name="signin_expired">Kód vypršel, než byl schválen. Zkuste to znovu.</string>
|
||||||
<string name="signin_too_old">Tato instance ještě nemá rozhraní API pro aplikace. Potřebuje LLeMbas 1.7.0 nebo novější.</string>
|
<string name="signin_too_old">Tato instance používá starší LLeMbas. Tato aplikace potřebuje LLeMbas 2.0 nebo novější.</string>
|
||||||
<string name="signin_too_new">Tato instance používá novější rozhraní API pro aplikace než tato aplikace. Aktualizujte aplikaci.</string>
|
<string name="signin_too_new">Tato instance používá novější rozhraní API pro aplikace než tato aplikace. Aktualizujte aplikaci.</string>
|
||||||
<string name="new_chat">Nová konverzace</string>
|
<string name="new_chat">Nová konverzace</string>
|
||||||
<string name="tab_chats">Konverzace</string>
|
<string name="tab_chats">Konverzace</string>
|
||||||
@@ -58,6 +58,18 @@
|
|||||||
<string name="plan_revise">Přepracovat</string>
|
<string name="plan_revise">Přepracovat</string>
|
||||||
<string name="plan_what_to_change">Co by se mělo změnit?</string>
|
<string name="plan_what_to_change">Co by se mělo změnit?</string>
|
||||||
<string name="plan_carry_out">Provést plán</string>
|
<string name="plan_carry_out">Provést plán</string>
|
||||||
|
<string name="shown">Zobrazeno</string>
|
||||||
|
<string name="viewer_open">Otevřít</string>
|
||||||
|
<string name="viewer_open_browser">Otevřít v prohlížeči</string>
|
||||||
|
<string name="viewer_copy">Kopírovat</string>
|
||||||
|
<string name="viewer_html_source">Toto je zdrojový kód stránky. Samotnou stránku uvidíte po otevření v prohlížeči.</string>
|
||||||
|
<string name="viewer_long_markdown">Dlouhý soubor, proto je zobrazen jako prostý text.</string>
|
||||||
|
<string name="viewer_unavailable">Tento server zatím aplikaci soubor předat neumí. Otevřete ho v prohlížeči.</string>
|
||||||
|
<string name="viewer_too_large">Tento soubor je příliš velký na zobrazení; zobrazit lze nejvýše 1 MB.</string>
|
||||||
|
<string name="viewer_not_text">Toto není textový soubor, proto se zde nezobrazuje.</string>
|
||||||
|
<string name="files">Soubory</string>
|
||||||
|
<string name="files_all">Všechny soubory</string>
|
||||||
|
<string name="files_empty">Zatím tu nic není. Ani hobití nora.</string>
|
||||||
<string name="settings">Nastavení</string>
|
<string name="settings">Nastavení</string>
|
||||||
<string name="settings_instances">Instance</string>
|
<string name="settings_instances">Instance</string>
|
||||||
<string name="sign_out">Odhlásit se</string>
|
<string name="sign_out">Odhlásit se</string>
|
||||||
@@ -74,7 +86,6 @@
|
|||||||
<string name="push_failed">Nebyl zvolen žádný distributor, takže upozornění jsou stále vypnutá.</string>
|
<string name="push_failed">Nebyl zvolen žádný distributor, takže upozornění jsou stále vypnutá.</string>
|
||||||
<string name="channel_replies">Odpovědi</string>
|
<string name="channel_replies">Odpovědi</string>
|
||||||
<string name="channel_asks">Otázky a schválení</string>
|
<string name="channel_asks">Otázky a schválení</string>
|
||||||
<string name="channel_reports">Zprávy</string>
|
|
||||||
<string name="settings_assistant">Asistent</string>
|
<string name="settings_assistant">Asistent</string>
|
||||||
<string name="assistant_explained">Nastavte LLeMbas jako digitálního asistenta telefonu: zvolte ho v Výchozí aplikace › Digitální asistent. Podržení tlačítka napájení, gesto asistenta nebo zkratka na zamykací obrazovce ho pak otevře přes to, co je právě na obrazovce.</string>
|
<string name="assistant_explained">Nastavte LLeMbas jako digitálního asistenta telefonu: zvolte ho v Výchozí aplikace › Digitální asistent. Podržení tlačítka napájení, gesto asistenta nebo zkratka na zamykací obrazovce ho pak otevře přes to, co je právě na obrazovce.</string>
|
||||||
<string name="assistant_open_settings">Otevřít nastavení asistenta</string>
|
<string name="assistant_open_settings">Otevřít nastavení asistenta</string>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<string name="signin_open_browser">Im Browser öffnen</string>
|
<string name="signin_open_browser">Im Browser öffnen</string>
|
||||||
<string name="signin_denied">Die Anmeldung wurde abgelehnt.</string>
|
<string name="signin_denied">Die Anmeldung wurde abgelehnt.</string>
|
||||||
<string name="signin_expired">Der Code ist abgelaufen, bevor er bestätigt wurde. Versuchen Sie es erneut.</string>
|
<string name="signin_expired">Der Code ist abgelaufen, bevor er bestätigt wurde. Versuchen Sie es erneut.</string>
|
||||||
<string name="signin_too_old">Diese Instanz hat noch keine App-API. Sie braucht LLeMbas 1.7.0 oder neuer.</string>
|
<string name="signin_too_old">Auf dieser Instanz läuft ein älteres LLeMbas. Diese App braucht LLeMbas 2.0 oder neuer.</string>
|
||||||
<string name="signin_too_new">Diese Instanz spricht eine neuere App-API als diese App. Aktualisieren Sie die App.</string>
|
<string name="signin_too_new">Diese Instanz spricht eine neuere App-API als diese App. Aktualisieren Sie die App.</string>
|
||||||
<string name="new_chat">Neuer Chat</string>
|
<string name="new_chat">Neuer Chat</string>
|
||||||
<string name="tab_chats">Chats</string>
|
<string name="tab_chats">Chats</string>
|
||||||
@@ -58,6 +58,18 @@
|
|||||||
<string name="plan_revise">Überarbeiten</string>
|
<string name="plan_revise">Überarbeiten</string>
|
||||||
<string name="plan_what_to_change">Was soll sich ändern?</string>
|
<string name="plan_what_to_change">Was soll sich ändern?</string>
|
||||||
<string name="plan_carry_out">Plan ausführen</string>
|
<string name="plan_carry_out">Plan ausführen</string>
|
||||||
|
<string name="shown">Angezeigt</string>
|
||||||
|
<string name="viewer_open">Öffnen</string>
|
||||||
|
<string name="viewer_open_browser">Im Browser öffnen</string>
|
||||||
|
<string name="viewer_copy">Kopieren</string>
|
||||||
|
<string name="viewer_html_source">Das ist der Quelltext der Seite. Die Seite selbst sehen Sie im Browser.</string>
|
||||||
|
<string name="viewer_long_markdown">Eine lange Datei, daher wird sie als reiner Text angezeigt.</string>
|
||||||
|
<string name="viewer_unavailable">Dieser Server kann die Datei der App noch nicht übergeben. Öffnen Sie sie stattdessen im Browser.</string>
|
||||||
|
<string name="viewer_too_large">Diese Datei ist zu groß zum Anzeigen; höchstens 1 MB kann angezeigt werden.</string>
|
||||||
|
<string name="viewer_not_text">Das ist keine Textdatei, deshalb wird sie hier nicht angezeigt.</string>
|
||||||
|
<string name="files">Dateien</string>
|
||||||
|
<string name="files_all">Alle Dateien</string>
|
||||||
|
<string name="files_empty">Hier ist noch nichts. Nicht einmal eine Hobbithöhle.</string>
|
||||||
<string name="settings">Einstellungen</string>
|
<string name="settings">Einstellungen</string>
|
||||||
<string name="settings_instances">Instanzen</string>
|
<string name="settings_instances">Instanzen</string>
|
||||||
<string name="sign_out">Abmelden</string>
|
<string name="sign_out">Abmelden</string>
|
||||||
@@ -74,7 +86,6 @@
|
|||||||
<string name="push_failed">Es wurde kein Distributor gewählt, daher sind die Benachrichtigungen noch ausgeschaltet.</string>
|
<string name="push_failed">Es wurde kein Distributor gewählt, daher sind die Benachrichtigungen noch ausgeschaltet.</string>
|
||||||
<string name="channel_replies">Antworten</string>
|
<string name="channel_replies">Antworten</string>
|
||||||
<string name="channel_asks">Fragen und Bestätigungen</string>
|
<string name="channel_asks">Fragen und Bestätigungen</string>
|
||||||
<string name="channel_reports">Berichte</string>
|
|
||||||
<string name="settings_assistant">Assistent</string>
|
<string name="settings_assistant">Assistent</string>
|
||||||
<string name="assistant_explained">Machen Sie LLeMbas zum digitalen Assistenten des Telefons: Wählen Sie ihn unter Standard-Apps › Digitaler Assistent. Das Halten der Einschalttaste, die Assistenzgeste oder die Verknüpfung auf dem Sperrbildschirm öffnet ihn dann über allem, was gerade angezeigt wird.</string>
|
<string name="assistant_explained">Machen Sie LLeMbas zum digitalen Assistenten des Telefons: Wählen Sie ihn unter Standard-Apps › Digitaler Assistent. Das Halten der Einschalttaste, die Assistenzgeste oder die Verknüpfung auf dem Sperrbildschirm öffnet ihn dann über allem, was gerade angezeigt wird.</string>
|
||||||
<string name="assistant_open_settings">Assistenten-Einstellungen öffnen</string>
|
<string name="assistant_open_settings">Assistenten-Einstellungen öffnen</string>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<string name="signin_open_browser">Abrir en el navegador</string>
|
<string name="signin_open_browser">Abrir en el navegador</string>
|
||||||
<string name="signin_denied">El inicio de sesión fue rechazado.</string>
|
<string name="signin_denied">El inicio de sesión fue rechazado.</string>
|
||||||
<string name="signin_expired">El código caducó antes de ser aprobado. Inténtelo de nuevo.</string>
|
<string name="signin_expired">El código caducó antes de ser aprobado. Inténtelo de nuevo.</string>
|
||||||
<string name="signin_too_old">Esta instancia aún no tiene API para aplicaciones. Necesita LLeMbas 1.7.0 o una versión posterior.</string>
|
<string name="signin_too_old">Esta instancia usa una versión anterior de LLeMbas. Esta aplicación necesita LLeMbas 2.0 o posterior.</string>
|
||||||
<string name="signin_too_new">Esta instancia habla una API de aplicaciones más reciente que esta aplicación. Actualice la aplicación.</string>
|
<string name="signin_too_new">Esta instancia habla una API de aplicaciones más reciente que esta aplicación. Actualice la aplicación.</string>
|
||||||
<string name="new_chat">Nuevo chat</string>
|
<string name="new_chat">Nuevo chat</string>
|
||||||
<string name="tab_chats">Chats</string>
|
<string name="tab_chats">Chats</string>
|
||||||
@@ -58,6 +58,18 @@
|
|||||||
<string name="plan_revise">Revisar</string>
|
<string name="plan_revise">Revisar</string>
|
||||||
<string name="plan_what_to_change">¿Qué debería cambiar?</string>
|
<string name="plan_what_to_change">¿Qué debería cambiar?</string>
|
||||||
<string name="plan_carry_out">Llevar a cabo el plan</string>
|
<string name="plan_carry_out">Llevar a cabo el plan</string>
|
||||||
|
<string name="shown">Mostrado</string>
|
||||||
|
<string name="viewer_open">Abrir</string>
|
||||||
|
<string name="viewer_open_browser">Abrir en el navegador</string>
|
||||||
|
<string name="viewer_copy">Copiar</string>
|
||||||
|
<string name="viewer_html_source">Este es el código fuente de la página. Ábrala en el navegador para ver la página.</string>
|
||||||
|
<string name="viewer_long_markdown">Un archivo largo, por eso se muestra como texto sin formato.</string>
|
||||||
|
<string name="viewer_unavailable">Este servidor todavía no puede entregar el archivo a la aplicación. Ábralo en el navegador.</string>
|
||||||
|
<string name="viewer_too_large">Este archivo es demasiado grande para mostrarlo; se puede mostrar como máximo 1 MB.</string>
|
||||||
|
<string name="viewer_not_text">No es un archivo de texto, así que no se muestra aquí.</string>
|
||||||
|
<string name="files">Archivos</string>
|
||||||
|
<string name="files_all">Todos los archivos</string>
|
||||||
|
<string name="files_empty">Aquí aún no hay nada. Ni siquiera un agujero hobbit.</string>
|
||||||
<string name="settings">Ajustes</string>
|
<string name="settings">Ajustes</string>
|
||||||
<string name="settings_instances">Instancias</string>
|
<string name="settings_instances">Instancias</string>
|
||||||
<string name="sign_out">Cerrar sesión</string>
|
<string name="sign_out">Cerrar sesión</string>
|
||||||
@@ -74,7 +86,6 @@
|
|||||||
<string name="push_failed">No se eligió ningún distribuidor, así que las notificaciones siguen desactivadas.</string>
|
<string name="push_failed">No se eligió ningún distribuidor, así que las notificaciones siguen desactivadas.</string>
|
||||||
<string name="channel_replies">Respuestas</string>
|
<string name="channel_replies">Respuestas</string>
|
||||||
<string name="channel_asks">Preguntas y aprobaciones</string>
|
<string name="channel_asks">Preguntas y aprobaciones</string>
|
||||||
<string name="channel_reports">Informes</string>
|
|
||||||
<string name="settings_assistant">Asistente</string>
|
<string name="settings_assistant">Asistente</string>
|
||||||
<string name="assistant_explained">Convierta LLeMbas en el asistente digital del teléfono: elíjalo en Aplicaciones predeterminadas › App de asistencia digital. Mantener pulsado el botón de encendido, el gesto de asistencia o el acceso directo de la pantalla de bloqueo lo abrirá entonces sobre lo que haya en pantalla.</string>
|
<string name="assistant_explained">Convierta LLeMbas en el asistente digital del teléfono: elíjalo en Aplicaciones predeterminadas › App de asistencia digital. Mantener pulsado el botón de encendido, el gesto de asistencia o el acceso directo de la pantalla de bloqueo lo abrirá entonces sobre lo que haya en pantalla.</string>
|
||||||
<string name="assistant_open_settings">Abrir los ajustes del asistente</string>
|
<string name="assistant_open_settings">Abrir los ajustes del asistente</string>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<string name="signin_open_browser">Ouvrir dans le navigateur</string>
|
<string name="signin_open_browser">Ouvrir dans le navigateur</string>
|
||||||
<string name="signin_denied">La connexion a été refusée.</string>
|
<string name="signin_denied">La connexion a été refusée.</string>
|
||||||
<string name="signin_expired">Le code a expiré avant d\'être approuvé. Réessayez.</string>
|
<string name="signin_expired">Le code a expiré avant d\'être approuvé. Réessayez.</string>
|
||||||
<string name="signin_too_old">Cette instance n\'a pas encore d\'API pour l\'application. Elle nécessite LLeMbas 1.7.0 ou une version plus récente.</string>
|
<string name="signin_too_old">Cette instance utilise une version plus ancienne de LLeMbas. Cette application nécessite LLeMbas 2.0 ou plus récent.</string>
|
||||||
<string name="signin_too_new">Cette instance utilise une API d\'application plus récente que cette application. Mettez à jour l\'application.</string>
|
<string name="signin_too_new">Cette instance utilise une API d\'application plus récente que cette application. Mettez à jour l\'application.</string>
|
||||||
<string name="new_chat">Nouvelle conversation</string>
|
<string name="new_chat">Nouvelle conversation</string>
|
||||||
<string name="tab_chats">Conversations</string>
|
<string name="tab_chats">Conversations</string>
|
||||||
@@ -58,6 +58,18 @@
|
|||||||
<string name="plan_revise">Réviser</string>
|
<string name="plan_revise">Réviser</string>
|
||||||
<string name="plan_what_to_change">Qu\'est-ce qui doit changer ?</string>
|
<string name="plan_what_to_change">Qu\'est-ce qui doit changer ?</string>
|
||||||
<string name="plan_carry_out">Exécuter le plan</string>
|
<string name="plan_carry_out">Exécuter le plan</string>
|
||||||
|
<string name="shown">Affiché</string>
|
||||||
|
<string name="viewer_open">Ouvrir</string>
|
||||||
|
<string name="viewer_open_browser">Ouvrir dans le navigateur</string>
|
||||||
|
<string name="viewer_copy">Copier</string>
|
||||||
|
<string name="viewer_html_source">Ceci est le code source de la page. Ouvrez-la dans le navigateur pour voir la page elle-même.</string>
|
||||||
|
<string name="viewer_long_markdown">Un fichier long, il est donc affiché en texte brut.</string>
|
||||||
|
<string name="viewer_unavailable">Ce serveur ne peut pas encore transmettre le fichier à l\'application. Ouvrez-le plutôt dans le navigateur.</string>
|
||||||
|
<string name="viewer_too_large">Ce fichier est trop volumineux pour être affiché ; 1 Mo au plus peut être affiché.</string>
|
||||||
|
<string name="viewer_not_text">Ce n\'est pas un fichier texte, il n\'est donc pas affiché ici.</string>
|
||||||
|
<string name="files">Fichiers</string>
|
||||||
|
<string name="files_all">Tous les fichiers</string>
|
||||||
|
<string name="files_empty">Rien ici pour l\'instant. Pas même un trou de hobbit.</string>
|
||||||
<string name="settings">Paramètres</string>
|
<string name="settings">Paramètres</string>
|
||||||
<string name="settings_instances">Instances</string>
|
<string name="settings_instances">Instances</string>
|
||||||
<string name="sign_out">Se déconnecter</string>
|
<string name="sign_out">Se déconnecter</string>
|
||||||
@@ -74,7 +86,6 @@
|
|||||||
<string name="push_failed">Aucun distributeur n\'a été choisi, les notifications sont donc toujours désactivées.</string>
|
<string name="push_failed">Aucun distributeur n\'a été choisi, les notifications sont donc toujours désactivées.</string>
|
||||||
<string name="channel_replies">Réponses</string>
|
<string name="channel_replies">Réponses</string>
|
||||||
<string name="channel_asks">Questions et approbations</string>
|
<string name="channel_asks">Questions et approbations</string>
|
||||||
<string name="channel_reports">Rapports</string>
|
|
||||||
<string name="settings_assistant">Assistant</string>
|
<string name="settings_assistant">Assistant</string>
|
||||||
<string name="assistant_explained">Faites de LLeMbas l\'assistant numérique du téléphone : choisissez-le dans Applications par défaut › Application d\'assistance numérique. Maintenir le bouton d\'alimentation, le geste d\'assistance ou le raccourci de l\'écran de verrouillage l\'ouvrira alors par-dessus ce qui est affiché.</string>
|
<string name="assistant_explained">Faites de LLeMbas l\'assistant numérique du téléphone : choisissez-le dans Applications par défaut › Application d\'assistance numérique. Maintenir le bouton d\'alimentation, le geste d\'assistance ou le raccourci de l\'écran de verrouillage l\'ouvrira alors par-dessus ce qui est affiché.</string>
|
||||||
<string name="assistant_open_settings">Ouvrir les paramètres de l\'assistant</string>
|
<string name="assistant_open_settings">Ouvrir les paramètres de l\'assistant</string>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<string name="signin_open_browser">Megnyitás a böngészőben</string>
|
<string name="signin_open_browser">Megnyitás a böngészőben</string>
|
||||||
<string name="signin_denied">A bejelentkezést elutasították.</string>
|
<string name="signin_denied">A bejelentkezést elutasították.</string>
|
||||||
<string name="signin_expired">A kód lejárt, mielőtt jóváhagyták volna. Próbálja újra.</string>
|
<string name="signin_expired">A kód lejárt, mielőtt jóváhagyták volna. Próbálja újra.</string>
|
||||||
<string name="signin_too_old">Ennek a példánynak még nincs alkalmazás-API-ja. LLeMbas 1.7.0 vagy újabb verzió szükséges hozzá.</string>
|
<string name="signin_too_old">Ezen a példányon régebbi LLeMbas fut. Ehhez az alkalmazáshoz LLeMbas 2.0 vagy újabb kell.</string>
|
||||||
<string name="signin_too_new">Ez a példány újabb alkalmazás-API-t használ, mint ez az alkalmazás. Frissítse az alkalmazást.</string>
|
<string name="signin_too_new">Ez a példány újabb alkalmazás-API-t használ, mint ez az alkalmazás. Frissítse az alkalmazást.</string>
|
||||||
<string name="new_chat">Új csevegés</string>
|
<string name="new_chat">Új csevegés</string>
|
||||||
<string name="tab_chats">Csevegések</string>
|
<string name="tab_chats">Csevegések</string>
|
||||||
@@ -58,6 +58,18 @@
|
|||||||
<string name="plan_revise">Átdolgozás</string>
|
<string name="plan_revise">Átdolgozás</string>
|
||||||
<string name="plan_what_to_change">Mi változzon?</string>
|
<string name="plan_what_to_change">Mi változzon?</string>
|
||||||
<string name="plan_carry_out">Terv végrehajtása</string>
|
<string name="plan_carry_out">Terv végrehajtása</string>
|
||||||
|
<string name="shown">Megjelenítve</string>
|
||||||
|
<string name="viewer_open">Megnyitás</string>
|
||||||
|
<string name="viewer_open_browser">Megnyitás a böngészőben</string>
|
||||||
|
<string name="viewer_copy">Másolás</string>
|
||||||
|
<string name="viewer_html_source">Ez az oldal forráskódja. Magát az oldalt a böngészőben megnyitva láthatja.</string>
|
||||||
|
<string name="viewer_long_markdown">Hosszú fájl, ezért egyszerű szövegként jelenik meg.</string>
|
||||||
|
<string name="viewer_unavailable">Ez a szerver még nem tudja átadni a fájlt az alkalmazásnak. Nyissa meg inkább a böngészőben.</string>
|
||||||
|
<string name="viewer_too_large">Ez a fájl túl nagy a megjelenítéshez; legfeljebb 1 MB jeleníthető meg.</string>
|
||||||
|
<string name="viewer_not_text">Ez nem szövegfájl, ezért itt nem jelenik meg.</string>
|
||||||
|
<string name="files">Fájlok</string>
|
||||||
|
<string name="files_all">Minden fájl</string>
|
||||||
|
<string name="files_empty">Itt még nincs semmi. Még egy hobbitlyuk sem.</string>
|
||||||
<string name="settings">Beállítások</string>
|
<string name="settings">Beállítások</string>
|
||||||
<string name="settings_instances">Példányok</string>
|
<string name="settings_instances">Példányok</string>
|
||||||
<string name="sign_out">Kijelentkezés</string>
|
<string name="sign_out">Kijelentkezés</string>
|
||||||
@@ -74,7 +86,6 @@
|
|||||||
<string name="push_failed">Nem választottak elosztót, így az értesítések továbbra is ki vannak kapcsolva.</string>
|
<string name="push_failed">Nem választottak elosztót, így az értesítések továbbra is ki vannak kapcsolva.</string>
|
||||||
<string name="channel_replies">Válaszok</string>
|
<string name="channel_replies">Válaszok</string>
|
||||||
<string name="channel_asks">Kérdések és jóváhagyások</string>
|
<string name="channel_asks">Kérdések és jóváhagyások</string>
|
||||||
<string name="channel_reports">Jelentések</string>
|
|
||||||
<string name="settings_assistant">Asszisztens</string>
|
<string name="settings_assistant">Asszisztens</string>
|
||||||
<string name="assistant_explained">Tegye az LLeMbas-t a telefon digitális asszisztensévé: válassza ki az Alapértelmezett alkalmazások › Digitális asszisztens alkalmazás alatt. A bekapcsológomb lenyomva tartása, az asszisztens-gesztus vagy a lezárási képernyő parancsikonja ezután a képernyőn lévő tartalom felett nyitja meg.</string>
|
<string name="assistant_explained">Tegye az LLeMbas-t a telefon digitális asszisztensévé: válassza ki az Alapértelmezett alkalmazások › Digitális asszisztens alkalmazás alatt. A bekapcsológomb lenyomva tartása, az asszisztens-gesztus vagy a lezárási képernyő parancsikonja ezután a képernyőn lévő tartalom felett nyitja meg.</string>
|
||||||
<string name="assistant_open_settings">Asszisztens beállításainak megnyitása</string>
|
<string name="assistant_open_settings">Asszisztens beállításainak megnyitása</string>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<string name="signin_open_browser">Apri nel browser</string>
|
<string name="signin_open_browser">Apri nel browser</string>
|
||||||
<string name="signin_denied">L\'accesso è stato rifiutato.</string>
|
<string name="signin_denied">L\'accesso è stato rifiutato.</string>
|
||||||
<string name="signin_expired">Il codice è scaduto prima di essere approvato. Riprova.</string>
|
<string name="signin_expired">Il codice è scaduto prima di essere approvato. Riprova.</string>
|
||||||
<string name="signin_too_old">Questa istanza non ha ancora un\'API per l\'app. Richiede LLeMbas 1.7.0 o una versione più recente.</string>
|
<string name="signin_too_old">Questa istanza usa una versione precedente di LLeMbas. Questa app richiede LLeMbas 2.0 o successivo.</string>
|
||||||
<string name="signin_too_new">Questa istanza usa un\'API per l\'app più recente di questa app. Aggiorna l\'app.</string>
|
<string name="signin_too_new">Questa istanza usa un\'API per l\'app più recente di questa app. Aggiorna l\'app.</string>
|
||||||
<string name="new_chat">Nuova chat</string>
|
<string name="new_chat">Nuova chat</string>
|
||||||
<string name="tab_chats">Chat</string>
|
<string name="tab_chats">Chat</string>
|
||||||
@@ -58,6 +58,18 @@
|
|||||||
<string name="plan_revise">Rivedi</string>
|
<string name="plan_revise">Rivedi</string>
|
||||||
<string name="plan_what_to_change">Cosa dovrebbe cambiare?</string>
|
<string name="plan_what_to_change">Cosa dovrebbe cambiare?</string>
|
||||||
<string name="plan_carry_out">Esegui il piano</string>
|
<string name="plan_carry_out">Esegui il piano</string>
|
||||||
|
<string name="shown">Mostrato</string>
|
||||||
|
<string name="viewer_open">Apri</string>
|
||||||
|
<string name="viewer_open_browser">Apri nel browser</string>
|
||||||
|
<string name="viewer_copy">Copia</string>
|
||||||
|
<string name="viewer_html_source">Questo è il sorgente della pagina. Aprila nel browser per vedere la pagina.</string>
|
||||||
|
<string name="viewer_long_markdown">Un file lungo, quindi è mostrato come testo semplice.</string>
|
||||||
|
<string name="viewer_unavailable">Questo server non può ancora passare il file all\'app. Aprilo invece nel browser.</string>
|
||||||
|
<string name="viewer_too_large">Questo file è troppo grande da mostrare; si può mostrare al massimo 1 MB.</string>
|
||||||
|
<string name="viewer_not_text">Non è un file di testo, quindi non viene mostrato qui.</string>
|
||||||
|
<string name="files">File</string>
|
||||||
|
<string name="files_all">Tutti i file</string>
|
||||||
|
<string name="files_empty">Ancora niente qui. Nemmeno una caverna hobbit.</string>
|
||||||
<string name="settings">Impostazioni</string>
|
<string name="settings">Impostazioni</string>
|
||||||
<string name="settings_instances">Istanze</string>
|
<string name="settings_instances">Istanze</string>
|
||||||
<string name="sign_out">Esci</string>
|
<string name="sign_out">Esci</string>
|
||||||
@@ -74,7 +86,6 @@
|
|||||||
<string name="push_failed">Non è stato scelto nessun distributore, quindi le notifiche sono ancora disattivate.</string>
|
<string name="push_failed">Non è stato scelto nessun distributore, quindi le notifiche sono ancora disattivate.</string>
|
||||||
<string name="channel_replies">Risposte</string>
|
<string name="channel_replies">Risposte</string>
|
||||||
<string name="channel_asks">Domande e approvazioni</string>
|
<string name="channel_asks">Domande e approvazioni</string>
|
||||||
<string name="channel_reports">Report</string>
|
|
||||||
<string name="settings_assistant">Assistente</string>
|
<string name="settings_assistant">Assistente</string>
|
||||||
<string name="assistant_explained">Rendi LLeMbas l\'assistente digitale del telefono: selezionalo in App predefinite › App di assistenza digitale. Tenendo premuto il tasto di accensione, il gesto di assistenza o la scorciatoia della schermata di blocco lo apre quindi sopra qualsiasi cosa sia a schermo.</string>
|
<string name="assistant_explained">Rendi LLeMbas l\'assistente digitale del telefono: selezionalo in App predefinite › App di assistenza digitale. Tenendo premuto il tasto di accensione, il gesto di assistenza o la scorciatoia della schermata di blocco lo apre quindi sopra qualsiasi cosa sia a schermo.</string>
|
||||||
<string name="assistant_open_settings">Apri le impostazioni dell\'assistente</string>
|
<string name="assistant_open_settings">Apri le impostazioni dell\'assistente</string>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<string name="signin_open_browser">Otwórz w przeglądarce</string>
|
<string name="signin_open_browser">Otwórz w przeglądarce</string>
|
||||||
<string name="signin_denied">Logowanie zostało odrzucone.</string>
|
<string name="signin_denied">Logowanie zostało odrzucone.</string>
|
||||||
<string name="signin_expired">Kod wygasł, zanim został zatwierdzony. Spróbuj ponownie.</string>
|
<string name="signin_expired">Kod wygasł, zanim został zatwierdzony. Spróbuj ponownie.</string>
|
||||||
<string name="signin_too_old">Ta instancja nie ma jeszcze API aplikacji. Wymaga LLeMbas 1.7.0 lub nowszego.</string>
|
<string name="signin_too_old">Ta instancja działa na starszym LLeMbas. Ta aplikacja wymaga LLeMbas 2.0 lub nowszego.</string>
|
||||||
<string name="signin_too_new">Ta instancja używa nowszego API aplikacji niż ta aplikacja. Zaktualizuj aplikację.</string>
|
<string name="signin_too_new">Ta instancja używa nowszego API aplikacji niż ta aplikacja. Zaktualizuj aplikację.</string>
|
||||||
<string name="new_chat">Nowy czat</string>
|
<string name="new_chat">Nowy czat</string>
|
||||||
<string name="tab_chats">Czaty</string>
|
<string name="tab_chats">Czaty</string>
|
||||||
@@ -58,6 +58,18 @@
|
|||||||
<string name="plan_revise">Popraw</string>
|
<string name="plan_revise">Popraw</string>
|
||||||
<string name="plan_what_to_change">Co powinno się zmienić?</string>
|
<string name="plan_what_to_change">Co powinno się zmienić?</string>
|
||||||
<string name="plan_carry_out">Wykonaj plan</string>
|
<string name="plan_carry_out">Wykonaj plan</string>
|
||||||
|
<string name="shown">Pokazano</string>
|
||||||
|
<string name="viewer_open">Otwórz</string>
|
||||||
|
<string name="viewer_open_browser">Otwórz w przeglądarce</string>
|
||||||
|
<string name="viewer_copy">Kopiuj</string>
|
||||||
|
<string name="viewer_html_source">To jest źródło strony. Otwórz ją w przeglądarce, aby zobaczyć samą stronę.</string>
|
||||||
|
<string name="viewer_long_markdown">Długi plik, dlatego jest pokazany jako zwykły tekst.</string>
|
||||||
|
<string name="viewer_unavailable">Ten serwer nie potrafi jeszcze przekazać pliku aplikacji. Otwórz go w przeglądarce.</string>
|
||||||
|
<string name="viewer_too_large">Ten plik jest za duży, by go pokazać; można pokazać najwyżej 1 MB.</string>
|
||||||
|
<string name="viewer_not_text">To nie jest plik tekstowy, więc nie jest tu pokazywany.</string>
|
||||||
|
<string name="files">Pliki</string>
|
||||||
|
<string name="files_all">Wszystkie pliki</string>
|
||||||
|
<string name="files_empty">Jeszcze nic tu nie ma. Nawet hobbiciej norki.</string>
|
||||||
<string name="settings">Ustawienia</string>
|
<string name="settings">Ustawienia</string>
|
||||||
<string name="settings_instances">Instancje</string>
|
<string name="settings_instances">Instancje</string>
|
||||||
<string name="sign_out">Wyloguj się</string>
|
<string name="sign_out">Wyloguj się</string>
|
||||||
@@ -74,7 +86,6 @@
|
|||||||
<string name="push_failed">Nie wybrano dystrybutora, więc powiadomienia są wciąż wyłączone.</string>
|
<string name="push_failed">Nie wybrano dystrybutora, więc powiadomienia są wciąż wyłączone.</string>
|
||||||
<string name="channel_replies">Odpowiedzi</string>
|
<string name="channel_replies">Odpowiedzi</string>
|
||||||
<string name="channel_asks">Pytania i zatwierdzenia</string>
|
<string name="channel_asks">Pytania i zatwierdzenia</string>
|
||||||
<string name="channel_reports">Raporty</string>
|
|
||||||
<string name="settings_assistant">Asystent</string>
|
<string name="settings_assistant">Asystent</string>
|
||||||
<string name="assistant_explained">Ustaw LLeMbas jako cyfrowego asystenta telefonu: wybierz go w Domyślne aplikacje › Aplikacja asystenta cyfrowego. Przytrzymanie przycisku zasilania, gest asystenta lub skrót z ekranu blokady otwiera go wtedy nad tym, co jest na ekranie.</string>
|
<string name="assistant_explained">Ustaw LLeMbas jako cyfrowego asystenta telefonu: wybierz go w Domyślne aplikacje › Aplikacja asystenta cyfrowego. Przytrzymanie przycisku zasilania, gest asystenta lub skrót z ekranu blokady otwiera go wtedy nad tym, co jest na ekranie.</string>
|
||||||
<string name="assistant_open_settings">Otwórz ustawienia asystenta</string>
|
<string name="assistant_open_settings">Otwórz ustawienia asystenta</string>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<string name="signin_open_browser">Otvoriť v prehliadači</string>
|
<string name="signin_open_browser">Otvoriť v prehliadači</string>
|
||||||
<string name="signin_denied">Prihlásenie bolo odmietnuté.</string>
|
<string name="signin_denied">Prihlásenie bolo odmietnuté.</string>
|
||||||
<string name="signin_expired">Kód vypršal skôr, než bol schválený. Skúste to znova.</string>
|
<string name="signin_expired">Kód vypršal skôr, než bol schválený. Skúste to znova.</string>
|
||||||
<string name="signin_too_old">Táto inštancia ešte nemá API pre aplikácie. Potrebuje LLeMbas 1.7.0 alebo novší.</string>
|
<string name="signin_too_old">Táto inštancia beží na staršom LLeMbas. Táto aplikácia potrebuje LLeMbas 2.0 alebo novší.</string>
|
||||||
<string name="signin_too_new">Táto inštancia používa novšie API pre aplikácie než táto aplikácia. Aktualizujte aplikáciu.</string>
|
<string name="signin_too_new">Táto inštancia používa novšie API pre aplikácie než táto aplikácia. Aktualizujte aplikáciu.</string>
|
||||||
<string name="new_chat">Nová konverzácia</string>
|
<string name="new_chat">Nová konverzácia</string>
|
||||||
<string name="tab_chats">Konverzácie</string>
|
<string name="tab_chats">Konverzácie</string>
|
||||||
@@ -58,6 +58,18 @@
|
|||||||
<string name="plan_revise">Prepracovať</string>
|
<string name="plan_revise">Prepracovať</string>
|
||||||
<string name="plan_what_to_change">Čo by sa malo zmeniť?</string>
|
<string name="plan_what_to_change">Čo by sa malo zmeniť?</string>
|
||||||
<string name="plan_carry_out">Vykonať plán</string>
|
<string name="plan_carry_out">Vykonať plán</string>
|
||||||
|
<string name="shown">Zobrazené</string>
|
||||||
|
<string name="viewer_open">Otvoriť</string>
|
||||||
|
<string name="viewer_open_browser">Otvoriť v prehliadači</string>
|
||||||
|
<string name="viewer_copy">Kopírovať</string>
|
||||||
|
<string name="viewer_html_source">Toto je zdrojový kód stránky. Samotnú stránku uvidíte po otvorení v prehliadači.</string>
|
||||||
|
<string name="viewer_long_markdown">Dlhý súbor, preto je zobrazený ako obyčajný text.</string>
|
||||||
|
<string name="viewer_unavailable">Tento server zatiaľ nevie aplikácii súbor odovzdať. Otvorte ho v prehliadači.</string>
|
||||||
|
<string name="viewer_too_large">Tento súbor je príliš veľký na zobrazenie; zobraziť možno najviac 1 MB.</string>
|
||||||
|
<string name="viewer_not_text">Toto nie je textový súbor, preto sa tu nezobrazuje.</string>
|
||||||
|
<string name="files">Súbory</string>
|
||||||
|
<string name="files_all">Všetky súbory</string>
|
||||||
|
<string name="files_empty">Zatiaľ tu nič nie je. Ani hobitia nora.</string>
|
||||||
<string name="settings">Nastavenia</string>
|
<string name="settings">Nastavenia</string>
|
||||||
<string name="settings_instances">Inštancie</string>
|
<string name="settings_instances">Inštancie</string>
|
||||||
<string name="sign_out">Odhlásiť sa</string>
|
<string name="sign_out">Odhlásiť sa</string>
|
||||||
@@ -74,7 +86,6 @@
|
|||||||
<string name="push_failed">Nebol zvolený žiadny distributor, takže upozornenia sú stále vypnuté.</string>
|
<string name="push_failed">Nebol zvolený žiadny distributor, takže upozornenia sú stále vypnuté.</string>
|
||||||
<string name="channel_replies">Odpovede</string>
|
<string name="channel_replies">Odpovede</string>
|
||||||
<string name="channel_asks">Otázky a schválenia</string>
|
<string name="channel_asks">Otázky a schválenia</string>
|
||||||
<string name="channel_reports">Správy</string>
|
|
||||||
<string name="settings_assistant">Asistent</string>
|
<string name="settings_assistant">Asistent</string>
|
||||||
<string name="assistant_explained">Nastavte LLeMbas ako digitálneho asistenta telefónu: zvoľte ho v Predvolené aplikácie › Digitálny asistent. Podržanie tlačidla napájania, gesto asistenta alebo skratka na uzamknutej obrazovke ho potom otvorí nad tým, čo je práve na obrazovke.</string>
|
<string name="assistant_explained">Nastavte LLeMbas ako digitálneho asistenta telefónu: zvoľte ho v Predvolené aplikácie › Digitálny asistent. Podržanie tlačidla napájania, gesto asistenta alebo skratka na uzamknutej obrazovke ho potom otvorí nad tým, čo je práve na obrazovke.</string>
|
||||||
<string name="assistant_open_settings">Otvoriť nastavenia asistenta</string>
|
<string name="assistant_open_settings">Otvoriť nastavenia asistenta</string>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Moria's --bg, the colour the launcher tile sits on. -->
|
<!-- Moria's background (the bg token), the colour the launcher tile sits on. -->
|
||||||
<color name="launcher_background">#0B0D10</color>
|
<color name="launcher_background">#0B0D10</color>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<string name="signin_open_browser">Open in the browser</string>
|
<string name="signin_open_browser">Open in the browser</string>
|
||||||
<string name="signin_denied">The sign-in was refused.</string>
|
<string name="signin_denied">The sign-in was refused.</string>
|
||||||
<string name="signin_expired">The code expired before it was approved. Try again.</string>
|
<string name="signin_expired">The code expired before it was approved. Try again.</string>
|
||||||
<string name="signin_too_old">This instance has no app API yet. It needs LLeMbas 1.7.0 or newer.</string>
|
<string name="signin_too_old">This instance runs an older LLeMbas. This app needs LLeMbas 2.0 or newer.</string>
|
||||||
<string name="signin_too_new">This instance speaks a newer app API than this app. Update the app.</string>
|
<string name="signin_too_new">This instance speaks a newer app API than this app. Update the app.</string>
|
||||||
<string name="new_chat">New chat</string>
|
<string name="new_chat">New chat</string>
|
||||||
<string name="tab_chats">Chats</string>
|
<string name="tab_chats">Chats</string>
|
||||||
@@ -59,6 +59,18 @@
|
|||||||
<string name="plan_revise">Revise</string>
|
<string name="plan_revise">Revise</string>
|
||||||
<string name="plan_what_to_change">What should change?</string>
|
<string name="plan_what_to_change">What should change?</string>
|
||||||
<string name="plan_carry_out">Carry out the plan</string>
|
<string name="plan_carry_out">Carry out the plan</string>
|
||||||
|
<string name="shown">Shown</string>
|
||||||
|
<string name="viewer_open">Open</string>
|
||||||
|
<string name="viewer_open_browser">Open in the browser</string>
|
||||||
|
<string name="viewer_copy">Copy</string>
|
||||||
|
<string name="viewer_html_source">This is the page\'s source. Open it in the browser to see the page itself.</string>
|
||||||
|
<string name="viewer_long_markdown">A long file, so it is shown as plain text.</string>
|
||||||
|
<string name="viewer_unavailable">This server cannot hand the file to the app yet. Open it in the browser instead.</string>
|
||||||
|
<string name="viewer_too_large">This file is too large to show here; at most 1 MB can be shown.</string>
|
||||||
|
<string name="viewer_not_text">This is not a text file, so it is not shown here.</string>
|
||||||
|
<string name="files">Files</string>
|
||||||
|
<string name="files_all">All files</string>
|
||||||
|
<string name="files_empty">Nothing here yet. Not even a hobbit hole.</string>
|
||||||
<string name="settings">Settings</string>
|
<string name="settings">Settings</string>
|
||||||
<string name="settings_instances">Instances</string>
|
<string name="settings_instances">Instances</string>
|
||||||
<string name="sign_out">Sign out</string>
|
<string name="sign_out">Sign out</string>
|
||||||
@@ -75,7 +87,6 @@
|
|||||||
<string name="push_failed">No distributor was chosen, so notifications are still off.</string>
|
<string name="push_failed">No distributor was chosen, so notifications are still off.</string>
|
||||||
<string name="channel_replies">Replies</string>
|
<string name="channel_replies">Replies</string>
|
||||||
<string name="channel_asks">Questions and approvals</string>
|
<string name="channel_asks">Questions and approvals</string>
|
||||||
<string name="channel_reports">Reports</string>
|
|
||||||
<string name="settings_assistant">Assistant</string>
|
<string name="settings_assistant">Assistant</string>
|
||||||
<string name="assistant_explained">Make LLeMbas the phone\'s digital assistant: choose it under Default apps › Digital assistant app. Then holding the power button, the assist gesture or the lock screen\'s shortcut opens it over whatever is on screen.</string>
|
<string name="assistant_explained">Make LLeMbas the phone\'s digital assistant: choose it under Default apps › Digital assistant app. Then holding the power button, the assist gesture or the lock screen\'s shortcut opens it over whatever is on screen.</string>
|
||||||
<string name="assistant_open_settings">Open the assistant settings</string>
|
<string name="assistant_open_settings">Open the assistant settings</string>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- A self-hosted instance often sits behind its owner's own certificate authority. Trusting
|
<!-- A self-hosted instance often sits behind its owner's own certificate authority. Trusting
|
||||||
the CAs the person installed on this phone (Settings › Security › Install a certificate)
|
the CAs the person installed on this phone (Settings › Security › Install a certificate)
|
||||||
is what lets the app reach it -- the same step the browser needs. No plain HTTP: a token
|
is what lets the app reach it: the same step the browser needs. No plain HTTP: a token
|
||||||
goes with every request. -->
|
goes with every request. -->
|
||||||
<network-security-config>
|
<network-security-config>
|
||||||
<base-config cleartextTrafficPermitted="false">
|
<base-config cleartextTrafficPermitted="false">
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package eu.llembas.android
|
|||||||
import eu.llembas.android.api.ApiClient
|
import eu.llembas.android.api.ApiClient
|
||||||
import eu.llembas.android.api.ApiException
|
import eu.llembas.android.api.ApiException
|
||||||
import eu.llembas.android.api.CardAnswer
|
import eu.llembas.android.api.CardAnswer
|
||||||
|
import eu.llembas.android.api.ShowCard
|
||||||
import eu.llembas.android.api.normaliseBase
|
import eu.llembas.android.api.normaliseBase
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import okhttp3.mockwebserver.MockResponse
|
import okhttp3.mockwebserver.MockResponse
|
||||||
@@ -61,4 +62,39 @@ class ClientTest {
|
|||||||
val body = server.takeRequest().body.readUtf8()
|
val body = server.takeRequest().body.readUtf8()
|
||||||
assertTrue(body, body.contains(""""choices":{"q0":["Tea"]}"""))
|
assertTrue(body, body.contains(""""choices":{"q0":["Tea"]}"""))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun aShownFileIsTheShowRouteAsPlainText() = runTest {
|
||||||
|
server.enqueue(MockResponse().setHeader("Content-Type", "text/plain; charset=utf-8").setBody("# Lembas\n"))
|
||||||
|
server.enqueue(MockResponse().setBody("x"))
|
||||||
|
val api = client()
|
||||||
|
val tree = ShowCard(path = "/home/frodo/recipe.md", nodeId = "node1", versionId = "ver1")
|
||||||
|
assertEquals("# Lembas\n", api.shownText("chat1", tree))
|
||||||
|
assertEquals("/api/v2/chats/chat1/show?node=node1&version=ver1", server.takeRequest().path)
|
||||||
|
api.shownText("chat1", ShowCard(path = "src/oven.py", source = "device", shownId = "shown1"))
|
||||||
|
assertEquals("/api/v2/chats/chat1/show?shown=shown1", server.takeRequest().path)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun aShownFileTheServerWillNotGiveIsItsStatus() = runTest {
|
||||||
|
server.enqueue(MockResponse().setResponseCode(415).setBody("""{"detail":"This is not a text file, so it is not shown here."}"""))
|
||||||
|
try {
|
||||||
|
client().shownText("chat1", ShowCard(nodeId = "n", versionId = "v"))
|
||||||
|
fail("a 415 must throw")
|
||||||
|
} catch (e: ApiException) {
|
||||||
|
assertEquals(415, e.status)
|
||||||
|
assertEquals("This is not a text file, so it is not shown here.", e.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun theFilesRoutesTakeThePathAsAQuery() = runTest {
|
||||||
|
server.enqueue(MockResponse().setBody("""{"path":"/home/frodo","parent":"/home","entries":[]}"""))
|
||||||
|
server.enqueue(MockResponse().setBody("""{"path":"/home/frodo/a b.md","name":"a b.md","text":"hi"}"""))
|
||||||
|
val api = client()
|
||||||
|
assertEquals("/home", api.files("/home/frodo").parent)
|
||||||
|
assertEquals("/api/v2/files?path=%2Fhome%2Ffrodo", server.takeRequest().path)
|
||||||
|
assertEquals("hi", api.fileContent("/home/frodo/a b.md").text)
|
||||||
|
assertEquals("/api/v2/files/content?path=%2Fhome%2Ffrodo%2Fa%20b.md", server.takeRequest().path)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package eu.llembas.android
|
package eu.llembas.android
|
||||||
|
|
||||||
|
import eu.llembas.android.api.APP_API
|
||||||
import eu.llembas.android.api.AskFrame
|
import eu.llembas.android.api.AskFrame
|
||||||
import eu.llembas.android.api.Chat
|
import eu.llembas.android.api.Chat
|
||||||
import eu.llembas.android.api.DoneFrame
|
import eu.llembas.android.api.DoneFrame
|
||||||
|
import eu.llembas.android.api.FileContent
|
||||||
|
import eu.llembas.android.api.FileListing
|
||||||
import eu.llembas.android.api.JobsFrame
|
import eu.llembas.android.api.JobsFrame
|
||||||
import eu.llembas.android.api.LembasJson
|
import eu.llembas.android.api.LembasJson
|
||||||
import eu.llembas.android.api.LiveReply
|
import eu.llembas.android.api.LiveReply
|
||||||
@@ -13,8 +16,12 @@ import eu.llembas.android.api.StatusFrame
|
|||||||
import eu.llembas.android.api.SteeredFrame
|
import eu.llembas.android.api.SteeredFrame
|
||||||
import eu.llembas.android.api.StepsFrame
|
import eu.llembas.android.api.StepsFrame
|
||||||
import eu.llembas.android.api.Tail
|
import eu.llembas.android.api.Tail
|
||||||
|
import eu.llembas.android.api.ToolCall
|
||||||
import kotlinx.serialization.KSerializer
|
import kotlinx.serialization.KSerializer
|
||||||
|
import kotlinx.serialization.builtins.ListSerializer
|
||||||
|
import kotlinx.serialization.json.jsonObject
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
|
import org.junit.Assert.assertFalse
|
||||||
import org.junit.Assert.assertNotNull
|
import org.junit.Assert.assertNotNull
|
||||||
import org.junit.Assert.assertNull
|
import org.junit.Assert.assertNull
|
||||||
import org.junit.Assert.assertTrue
|
import org.junit.Assert.assertTrue
|
||||||
@@ -32,7 +39,67 @@ class ContractTest {
|
|||||||
@Test
|
@Test
|
||||||
fun theVersionIsOneThisAppReads() {
|
fun theVersionIsOneThisAppReads() {
|
||||||
val version = LembasJson.parseToJsonElement(text("version")).toString()
|
val version = LembasJson.parseToJsonElement(text("version")).toString()
|
||||||
assertEquals("""{"app_api":1}""", version)
|
assertEquals("""{"app_api":$APP_API}""", version)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun aShowCardFromTheTreeAndOneFromADevice() {
|
||||||
|
// The server's own `show` cards (`tool_show.json`): what the app reads them by, and the
|
||||||
|
// query that fetches the text from `GET /api/v2/chats/{chat}/show`.
|
||||||
|
val calls = LembasJson.parseToJsonElement(text("tool_show")).jsonObject.getValue("calls")
|
||||||
|
val (tree, device) = LembasJson.decodeFromJsonElement(ListSerializer(ToolCall.serializer()), calls)
|
||||||
|
val show = tree.show!!
|
||||||
|
assertEquals("show", tree.name)
|
||||||
|
assertEquals("recipe.md", show.name)
|
||||||
|
assertEquals("/home/frodo/recipe.md", show.path)
|
||||||
|
assertEquals("markdown", show.viewKind)
|
||||||
|
assertEquals(3, show.line)
|
||||||
|
assertEquals(120L, show.size)
|
||||||
|
assertEquals(listOf("node" to "node1", "version" to "ver1"), show.query)
|
||||||
|
|
||||||
|
val kept = device.show!!
|
||||||
|
assertEquals("device", kept.source)
|
||||||
|
assertEquals("code", kept.viewKind)
|
||||||
|
assertEquals("python", kept.language)
|
||||||
|
// `line: null` reads as no line, and the tree's two ids are empty on a device's card.
|
||||||
|
assertEquals(0, kept.line)
|
||||||
|
assertEquals(listOf("shown" to "shown1"), kept.query)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun aDirectoryOfThePersonsFiles() {
|
||||||
|
val listing = read("files_listing", FileListing.serializer())
|
||||||
|
assertEquals("/home/frodo", listing.path)
|
||||||
|
assertEquals("/home", listing.parent)
|
||||||
|
assertEquals(listOf("recipes", "lembas.md"), listing.entries.map { it.name })
|
||||||
|
assertTrue(listing.entries[0].isFolder)
|
||||||
|
val file = listing.entries[1]
|
||||||
|
assertFalse(file.isFolder)
|
||||||
|
assertEquals(27L, file.size)
|
||||||
|
assertEquals("text/markdown", file.mime)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun aFileAndAWithheldOne() {
|
||||||
|
val file = read("file_content", FileContent.serializer())
|
||||||
|
assertNull(file.withheld)
|
||||||
|
assertEquals("markdown", file.viewKind)
|
||||||
|
assertTrue(file.text.startsWith("# Lembas"))
|
||||||
|
|
||||||
|
val image = read("file_content_withheld", FileContent.serializer())
|
||||||
|
assertEquals("", image.text)
|
||||||
|
assertEquals("not_text", image.withheld!!.reason)
|
||||||
|
assertTrue(image.withheld!!.message.isNotBlank())
|
||||||
|
// An image is no kind the viewer draws, so if its text ever came it would be plain text.
|
||||||
|
assertEquals("text", image.viewKind)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun theTwoPointOhContractHasNoCanvas() {
|
||||||
|
// LLeMbas 2.0 removed the canvas: no `canvas` frame, so no fixture for one. A stream
|
||||||
|
// that still sends it (a 1.x server) is ignored frame by frame, as any unknown event is.
|
||||||
|
assertNull(javaClass.classLoader!!.getResource("event_canvas.json"))
|
||||||
|
assertEquals(LiveReply("m"), LiveReply("m").apply("canvas", """{"tabs": [], "active": ""}"""))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package eu.llembas.android
|
||||||
|
|
||||||
|
import eu.llembas.android.api.Discovery
|
||||||
|
import eu.llembas.android.api.LembasJson
|
||||||
|
import eu.llembas.android.api.ServerFit
|
||||||
|
import eu.llembas.android.api.ToolCall
|
||||||
|
import eu.llembas.android.api.fit
|
||||||
|
import org.junit.Assert.assertEquals
|
||||||
|
import org.junit.Assert.assertNull
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What the server's contract fixtures cannot say: how the app reads a `show` card the server
|
||||||
|
* never wrote (an unknown kind), and which servers it works with at all. The server's own `show`
|
||||||
|
* cards are in `contract/tool_show.json` and read by `ContractTest`.
|
||||||
|
*/
|
||||||
|
class ShowAndServerTest {
|
||||||
|
private fun call(json: String) = LembasJson.decodeFromString(ToolCall.serializer(), json)
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun anUnknownKindIsPlainText() {
|
||||||
|
val c = call("""{"name": "show", "show": {"path": "x.svg", "kind": "svg"}}""")
|
||||||
|
assertEquals("text", c.show!!.viewKind)
|
||||||
|
assertNull(call("""{"name": "bash"}""").show)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun discovery(json: String) = LembasJson.decodeFromString(Discovery.serializer(), json)
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun onlyAServerOnTheTwoPointOhProtocolAndAppApiTwoFits() {
|
||||||
|
val two = """{"service": "lembas", "version": "2.0.0-beta.1", "protocol": 3, "protocols": [3],
|
||||||
|
"app_api": 2, "scopes": ["app", "models"]}"""
|
||||||
|
assertEquals(ServerFit.FITS, fit(discovery(two)))
|
||||||
|
// A 2.0 `dev` server from before the show route and the files: protocol 3, app API 1.
|
||||||
|
assertEquals(ServerFit.TOO_OLD, fit(discovery(two.replace("\"app_api\": 2", "\"app_api\": 1"))))
|
||||||
|
// 1.7: protocol 2, the app API already there -- and still refused.
|
||||||
|
val old = """{"service": "lembas", "version": "1.7.3", "protocol": 2, "protocols": [1, 2],
|
||||||
|
"app_api": 1, "scopes": ["app", "models"]}"""
|
||||||
|
assertEquals(ServerFit.TOO_OLD, fit(discovery(old)))
|
||||||
|
// A server with no protocol at all is older still.
|
||||||
|
assertEquals(ServerFit.TOO_OLD, fit(discovery("""{"service": "lembas", "app_api": 2, "scopes": ["app"]}""")))
|
||||||
|
assertEquals(ServerFit.TOO_NEW, fit(discovery(two.replace("\"app_api\": 2", "\"app_api\": 3"))))
|
||||||
|
assertEquals(ServerFit.NOT_LEMBAS, fit(discovery("""{"service": "other", "protocol": 3}""")))
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"tabs": [
|
|
||||||
{
|
|
||||||
"path": "recipe.md",
|
|
||||||
"title": "recipe.md"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"active": "recipe.md"
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"path": "/home/frodo/lembas.md",
|
||||||
|
"name": "lembas.md",
|
||||||
|
"size": 27,
|
||||||
|
"mime": "text/markdown",
|
||||||
|
"kind": "markdown",
|
||||||
|
"language": "markdown",
|
||||||
|
"sha": "abababababababababababababababababababababababababababababababab",
|
||||||
|
"text": "# Lembas\n\nWrap it in a leaf.\n"
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"path": "/home/frodo/map.png",
|
||||||
|
"name": "map.png",
|
||||||
|
"size": 2048,
|
||||||
|
"mime": "image/png",
|
||||||
|
"kind": "image",
|
||||||
|
"language": "",
|
||||||
|
"sha": "abababababababababababababababababababababababababababababababab",
|
||||||
|
"text": "",
|
||||||
|
"withheld": {
|
||||||
|
"reason": "not_text",
|
||||||
|
"message": "This is not a text file, so it is not shown here."
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"path": "/home/frodo",
|
||||||
|
"parent": "/home",
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"name": "recipes",
|
||||||
|
"path": "/home/frodo/recipes",
|
||||||
|
"kind": "dir",
|
||||||
|
"size": 0,
|
||||||
|
"mime": "",
|
||||||
|
"updated_at": "2026-01-02T03:04:05+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "lembas.md",
|
||||||
|
"path": "/home/frodo/lembas.md",
|
||||||
|
"kind": "file",
|
||||||
|
"size": 27,
|
||||||
|
"mime": "text/markdown",
|
||||||
|
"updated_at": "2026-01-02T03:04:05+00:00"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"ref": "v1.7.0",
|
"ref": "v2.0.0-beta.1",
|
||||||
"commit": "d9592e2d0f67f62d093149f0a1a0b15b8f4c91c6",
|
"commit": "a3b0e660cc4de3d25d75e560afd8441d0fa37a00",
|
||||||
"sha256": "7d0814e428195d1236e4ebaf5d5d8cf6d73900e62824cea143f517ed4cceba34"
|
"sha256": "56068e80b817badd0b2b80af497d8920237b7ee45c939c7f5fe72c50e865609b"
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
"calls": [
|
||||||
|
{
|
||||||
|
"id": "call2",
|
||||||
|
"name": "show",
|
||||||
|
"status": "ok",
|
||||||
|
"query": "/home/frodo/recipe.md",
|
||||||
|
"path": "/home/frodo/recipe.md",
|
||||||
|
"show": {
|
||||||
|
"path": "/home/frodo/recipe.md",
|
||||||
|
"name": "recipe.md",
|
||||||
|
"kind": "markdown",
|
||||||
|
"language": "markdown",
|
||||||
|
"line": 3,
|
||||||
|
"node_id": "node1",
|
||||||
|
"version_id": "ver1",
|
||||||
|
"sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
||||||
|
"size": 120,
|
||||||
|
"mime": "text/markdown"
|
||||||
|
},
|
||||||
|
"block": {
|
||||||
|
"kind": "tool",
|
||||||
|
"title": "/home/frodo/recipe.md",
|
||||||
|
"chips": [],
|
||||||
|
"added": 0,
|
||||||
|
"removed": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "call3",
|
||||||
|
"name": "show",
|
||||||
|
"status": "ok",
|
||||||
|
"path": "src/oven.py",
|
||||||
|
"show": {
|
||||||
|
"path": "src/oven.py",
|
||||||
|
"name": "oven.py",
|
||||||
|
"kind": "code",
|
||||||
|
"language": "python",
|
||||||
|
"line": null,
|
||||||
|
"node_id": "",
|
||||||
|
"version_id": "",
|
||||||
|
"sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
||||||
|
"size": 64,
|
||||||
|
"mime": "text/x-python",
|
||||||
|
"source": "device",
|
||||||
|
"shown_id": "shown1"
|
||||||
|
},
|
||||||
|
"block": {
|
||||||
|
"kind": "tool",
|
||||||
|
"title": "",
|
||||||
|
"chips": [],
|
||||||
|
"added": 0,
|
||||||
|
"removed": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
{"app_api": 1}
|
{"app_api": 2}
|
||||||
@@ -33,7 +33,7 @@ LOCK = ROOT / "tokens.lock.json"
|
|||||||
NAMES = (
|
NAMES = (
|
||||||
"bg", "bg-sunken", "surface", "surface-raised", "surface-hover", "surface-active",
|
"bg", "bg-sunken", "surface", "surface-raised", "surface-hover", "surface-active",
|
||||||
"border", "border-strong", "ink", "ink-muted", "ink-faint", "ink-inverse",
|
"border", "border-strong", "ink", "ink-muted", "ink-faint", "ink-inverse",
|
||||||
"accent", "accent-hover", "accent-ink", "accent-soft", "leaf", "danger", "danger-soft",
|
"accent", "accent-hover", "accent-ink", "accent-soft", "selection", "leaf", "danger", "danger-soft",
|
||||||
"success", "success-soft", "warning", "warning-soft", "bubble-user", "code-bg", "code-border",
|
"success", "success-soft", "warning", "warning-soft", "bubble-user", "code-bg", "code-border",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+30
-5
@@ -2,8 +2,15 @@
|
|||||||
"""Write the app's string resources: English from `strings.py`, the eight translations from
|
"""Write the app's string resources: English from `strings.py`, the eight translations from
|
||||||
the server's catalogues and `strings_own.json`. See `strings.py` for the rule.
|
the server's catalogues and `strings_own.json`. See `strings.py` for the rule.
|
||||||
|
|
||||||
scripts/gen-strings.py (server at ../LLeMbas, or LEMBAS_SERVER)
|
scripts/gen-strings.py <server-ref> the catalogues at that ref of the server's git checkout
|
||||||
scripts/gen-strings.py --check fail if a key the code uses has no English, or the other way round
|
(../LLeMbas, or LEMBAS_SERVER) -- the same ref the
|
||||||
|
contract and the tokens are pinned to
|
||||||
|
scripts/gen-strings.py the server's working tree as it is
|
||||||
|
scripts/gen-strings.py --check fail if a key the code uses has no English, or the other
|
||||||
|
way round
|
||||||
|
|
||||||
|
A ref, not the working tree, is the way to regenerate: the server's checkout is shared, and
|
||||||
|
whatever is uncommitted in it is not what a released server says.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
@@ -12,6 +19,7 @@ import importlib.util
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from xml.sax.saxutils import escape
|
from xml.sax.saxutils import escape
|
||||||
@@ -31,8 +39,18 @@ def android(text: str) -> str:
|
|||||||
return escape(text).replace("'", "\\'").replace('"', '\\"')
|
return escape(text).replace("'", "\\'").replace('"', '\\"')
|
||||||
|
|
||||||
|
|
||||||
def server_catalogue(code: str) -> dict[str, str]:
|
def server_catalogue(code: str, ref: str | None = None) -> dict[str, str]:
|
||||||
path = SERVER / "src/lembas/web/i18n" / f"{code}.py"
|
path = SERVER / "src/lembas/web/i18n" / f"{code}.py"
|
||||||
|
if ref:
|
||||||
|
shown = subprocess.run(
|
||||||
|
["git", "-C", str(SERVER), "show", f"{ref}:src/lembas/web/i18n/{code}.py"],
|
||||||
|
capture_output=True, text=True,
|
||||||
|
)
|
||||||
|
if shown.returncode != 0:
|
||||||
|
return {}
|
||||||
|
scope: dict = {"__name__": f"catalogue_{code}"}
|
||||||
|
exec(compile(shown.stdout, f"{ref}:{code}.py", "exec"), scope) # the server's own file
|
||||||
|
return dict(scope.get("MESSAGES", {}))
|
||||||
if not path.exists():
|
if not path.exists():
|
||||||
return {}
|
return {}
|
||||||
spec = importlib.util.spec_from_file_location(f"catalogue_{code}", path)
|
spec = importlib.util.spec_from_file_location(f"catalogue_{code}", path)
|
||||||
@@ -71,10 +89,17 @@ def main() -> None:
|
|||||||
if "--check" in sys.argv:
|
if "--check" in sys.argv:
|
||||||
print(f"gen-strings: {len(STRINGS)} strings, all used")
|
print(f"gen-strings: {len(STRINGS)} strings, all used")
|
||||||
return
|
return
|
||||||
|
args = [a for a in sys.argv[1:] if not a.startswith("--")]
|
||||||
|
ref = None
|
||||||
|
if args:
|
||||||
|
ref = subprocess.run(
|
||||||
|
["git", "-C", str(SERVER), "rev-parse", "--verify", f"{args[0]}^{{commit}}"],
|
||||||
|
capture_output=True, text=True, check=True,
|
||||||
|
).stdout.strip()
|
||||||
own = json.loads((Path(__file__).parent / "strings_own.json").read_text(encoding="utf-8"))
|
own = json.loads((Path(__file__).parent / "strings_own.json").read_text(encoding="utf-8"))
|
||||||
write(RES / "values", STRINGS)
|
write(RES / "values", STRINGS)
|
||||||
for code in LANGS:
|
for code in LANGS:
|
||||||
catalogue = server_catalogue(code)
|
catalogue = server_catalogue(code, ref)
|
||||||
mine = own.get(code, {})
|
mine = own.get(code, {})
|
||||||
out = {}
|
out = {}
|
||||||
for key, english in STRINGS.items():
|
for key, english in STRINGS.items():
|
||||||
@@ -84,7 +109,7 @@ def main() -> None:
|
|||||||
if text and text.count("%1$s") == english.count("%1$s"):
|
if text and text.count("%1$s") == english.count("%1$s"):
|
||||||
out[key] = text
|
out[key] = text
|
||||||
write(RES / f"values-{code}", out)
|
write(RES / f"values-{code}", out)
|
||||||
print(f"gen-strings: {code}: {len(out)}/{len(STRINGS) - 1}")
|
print(f"gen-strings: {code}: {len(out)}/{len(STRINGS) - 1}" + (f" (server {ref[:12]})" if ref else ""))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
+15
-2
@@ -23,7 +23,7 @@ STRINGS: dict[str, str] = {
|
|||||||
"signin_open_browser": "Open in the browser",
|
"signin_open_browser": "Open in the browser",
|
||||||
"signin_denied": "The sign-in was refused.",
|
"signin_denied": "The sign-in was refused.",
|
||||||
"signin_expired": "The code expired before it was approved. Try again.",
|
"signin_expired": "The code expired before it was approved. Try again.",
|
||||||
"signin_too_old": "This instance has no app API yet. It needs LLeMbas 1.7.0 or newer.",
|
"signin_too_old": "This instance runs an older LLeMbas. This app needs LLeMbas 2.0 or newer.",
|
||||||
"signin_too_new": "This instance speaks a newer app API than this app. Update the app.",
|
"signin_too_new": "This instance speaks a newer app API than this app. Update the app.",
|
||||||
# Chats
|
# Chats
|
||||||
"new_chat": "New chat",
|
"new_chat": "New chat",
|
||||||
@@ -72,6 +72,20 @@ STRINGS: dict[str, str] = {
|
|||||||
"plan_revise": "Revise",
|
"plan_revise": "Revise",
|
||||||
"plan_what_to_change": "What should change?",
|
"plan_what_to_change": "What should change?",
|
||||||
"plan_carry_out": "Carry out the plan",
|
"plan_carry_out": "Carry out the plan",
|
||||||
|
# The file viewer (a `show` card)
|
||||||
|
"shown": "Shown",
|
||||||
|
"viewer_open": "Open",
|
||||||
|
"viewer_open_browser": "Open in the browser",
|
||||||
|
"viewer_copy": "Copy",
|
||||||
|
"viewer_html_source": "This is the page's source. Open it in the browser to see the page itself.",
|
||||||
|
"viewer_long_markdown": "A long file, so it is shown as plain text.",
|
||||||
|
"viewer_unavailable": "This server cannot hand the file to the app yet. Open it in the browser instead.",
|
||||||
|
"viewer_too_large": "This file is too large to show here; at most 1 MB can be shown.",
|
||||||
|
"viewer_not_text": "This is not a text file, so it is not shown here.",
|
||||||
|
# Files (the person's tree, read-only)
|
||||||
|
"files": "Files",
|
||||||
|
"files_all": "All files",
|
||||||
|
"files_empty": "Nothing here yet. Not even a hobbit hole.",
|
||||||
# Settings
|
# Settings
|
||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
"settings_instances": "Instances",
|
"settings_instances": "Instances",
|
||||||
@@ -89,7 +103,6 @@ STRINGS: dict[str, str] = {
|
|||||||
"push_failed": "No distributor was chosen, so notifications are still off.",
|
"push_failed": "No distributor was chosen, so notifications are still off.",
|
||||||
"channel_replies": "Replies",
|
"channel_replies": "Replies",
|
||||||
"channel_asks": "Questions and approvals",
|
"channel_asks": "Questions and approvals",
|
||||||
"channel_reports": "Reports",
|
|
||||||
"settings_assistant": "Assistant",
|
"settings_assistant": "Assistant",
|
||||||
"assistant_explained": "Make LLeMbas the phone's digital assistant: choose it under Default apps › Digital assistant app. Then holding the power button, the assist gesture or the lock screen's shortcut opens it over whatever is on screen.",
|
"assistant_explained": "Make LLeMbas the phone's digital assistant: choose it under Default apps › Digital assistant app. Then holding the power button, the assist gesture or the lock screen's shortcut opens it over whatever is on screen.",
|
||||||
"assistant_open_settings": "Open the assistant settings",
|
"assistant_open_settings": "Open the assistant settings",
|
||||||
|
|||||||
+64
-16
@@ -45,6 +45,7 @@
|
|||||||
"share_default_prompt": "Podívejte se na tohle.",
|
"share_default_prompt": "Podívejte se na tohle.",
|
||||||
"share_label": "Zeptat se LLeMbas",
|
"share_label": "Zeptat se LLeMbas",
|
||||||
"share_sending": "Odesílá se do LLeMbas…",
|
"share_sending": "Odesílá se do LLeMbas…",
|
||||||
|
"shown": "Zobrazeno",
|
||||||
"signin_address": "Adresa instance",
|
"signin_address": "Adresa instance",
|
||||||
"signin_code_intro": "Otevřete instanci v prohlížeči, přihlaste se a schvalte tento kód:",
|
"signin_code_intro": "Otevřete instanci v prohlížeči, přihlaste se a schvalte tento kód:",
|
||||||
"signin_denied": "Přihlášení bylo odmítnuto.",
|
"signin_denied": "Přihlášení bylo odmítnuto.",
|
||||||
@@ -52,7 +53,7 @@
|
|||||||
"signin_intro": "Přihlaste se k instanci LLeMbas. Tento telefon schválíte v prohlížeči, stejně jako u CLI.",
|
"signin_intro": "Přihlaste se k instanci LLeMbas. Tento telefon schválíte v prohlížeči, stejně jako u CLI.",
|
||||||
"signin_open_browser": "Otevřít v prohlížeči",
|
"signin_open_browser": "Otevřít v prohlížeči",
|
||||||
"signin_too_new": "Tato instance používá novější rozhraní API pro aplikace než tato aplikace. Aktualizujte aplikaci.",
|
"signin_too_new": "Tato instance používá novější rozhraní API pro aplikace než tato aplikace. Aktualizujte aplikaci.",
|
||||||
"signin_too_old": "Tato instance ještě nemá rozhraní API pro aplikace. Potřebuje LLeMbas 1.7.0 nebo novější.",
|
"signin_too_old": "Tato instance používá starší LLeMbas. Tato aplikace potřebuje LLeMbas 2.0 nebo novější.",
|
||||||
"theme_moria": "Moria (temná)",
|
"theme_moria": "Moria (temná)",
|
||||||
"theme_shire": "Shire (světlý)",
|
"theme_shire": "Shire (světlý)",
|
||||||
"theme_system": "Podle systému",
|
"theme_system": "Podle systému",
|
||||||
@@ -62,7 +63,12 @@
|
|||||||
"update_check": "Zkontrolovat aktualizaci",
|
"update_check": "Zkontrolovat aktualizaci",
|
||||||
"update_installing": "Instaluje se %1$s…",
|
"update_installing": "Instaluje se %1$s…",
|
||||||
"update_none": "Toto je nejnovější verze.",
|
"update_none": "Toto je nejnovější verze.",
|
||||||
"update_unreachable": "Aktualizaci se nepodařilo stáhnout."
|
"update_unreachable": "Aktualizaci se nepodařilo stáhnout.",
|
||||||
|
"viewer_html_source": "Toto je zdrojový kód stránky. Samotnou stránku uvidíte po otevření v prohlížeči.",
|
||||||
|
"viewer_long_markdown": "Dlouhý soubor, proto je zobrazen jako prostý text.",
|
||||||
|
"viewer_open_browser": "Otevřít v prohlížeči",
|
||||||
|
"viewer_too_large": "Tento soubor je příliš velký na zobrazení; zobrazit lze nejvýše 1 MB.",
|
||||||
|
"viewer_unavailable": "Tento server zatím aplikaci soubor předat neumí. Otevřete ho v prohlížeči."
|
||||||
},
|
},
|
||||||
"de": {
|
"de": {
|
||||||
"about_version": "LLeMbas für Android %1$s",
|
"about_version": "LLeMbas für Android %1$s",
|
||||||
@@ -110,6 +116,7 @@
|
|||||||
"share_default_prompt": "Schauen Sie sich das an.",
|
"share_default_prompt": "Schauen Sie sich das an.",
|
||||||
"share_label": "LLeMbas fragen",
|
"share_label": "LLeMbas fragen",
|
||||||
"share_sending": "Wird an LLeMbas gesendet…",
|
"share_sending": "Wird an LLeMbas gesendet…",
|
||||||
|
"shown": "Angezeigt",
|
||||||
"signin_address": "Adresse der Instanz",
|
"signin_address": "Adresse der Instanz",
|
||||||
"signin_code_intro": "Öffnen Sie die Instanz im Browser, melden Sie sich an und bestätigen Sie diesen Code:",
|
"signin_code_intro": "Öffnen Sie die Instanz im Browser, melden Sie sich an und bestätigen Sie diesen Code:",
|
||||||
"signin_denied": "Die Anmeldung wurde abgelehnt.",
|
"signin_denied": "Die Anmeldung wurde abgelehnt.",
|
||||||
@@ -117,7 +124,7 @@
|
|||||||
"signin_intro": "Melden Sie sich bei einer LLeMbas-Instanz an. Sie bestätigen dieses Telefon im Browser, genau wie bei der CLI.",
|
"signin_intro": "Melden Sie sich bei einer LLeMbas-Instanz an. Sie bestätigen dieses Telefon im Browser, genau wie bei der CLI.",
|
||||||
"signin_open_browser": "Im Browser öffnen",
|
"signin_open_browser": "Im Browser öffnen",
|
||||||
"signin_too_new": "Diese Instanz spricht eine neuere App-API als diese App. Aktualisieren Sie die App.",
|
"signin_too_new": "Diese Instanz spricht eine neuere App-API als diese App. Aktualisieren Sie die App.",
|
||||||
"signin_too_old": "Diese Instanz hat noch keine App-API. Sie braucht LLeMbas 1.7.0 oder neuer.",
|
"signin_too_old": "Auf dieser Instanz läuft ein älteres LLeMbas. Diese App braucht LLeMbas 2.0 oder neuer.",
|
||||||
"theme_moria": "Moria (dunkel)",
|
"theme_moria": "Moria (dunkel)",
|
||||||
"theme_shire": "Shire (hell)",
|
"theme_shire": "Shire (hell)",
|
||||||
"theme_system": "Wie das System",
|
"theme_system": "Wie das System",
|
||||||
@@ -127,7 +134,12 @@
|
|||||||
"update_check": "Nach einem Update suchen",
|
"update_check": "Nach einem Update suchen",
|
||||||
"update_installing": "%1$s wird installiert…",
|
"update_installing": "%1$s wird installiert…",
|
||||||
"update_none": "Dies ist die neueste Version.",
|
"update_none": "Dies ist die neueste Version.",
|
||||||
"update_unreachable": "Das Update konnte nicht abgerufen werden."
|
"update_unreachable": "Das Update konnte nicht abgerufen werden.",
|
||||||
|
"viewer_html_source": "Das ist der Quelltext der Seite. Die Seite selbst sehen Sie im Browser.",
|
||||||
|
"viewer_long_markdown": "Eine lange Datei, daher wird sie als reiner Text angezeigt.",
|
||||||
|
"viewer_open_browser": "Im Browser öffnen",
|
||||||
|
"viewer_too_large": "Diese Datei ist zu groß zum Anzeigen; höchstens 1 MB kann angezeigt werden.",
|
||||||
|
"viewer_unavailable": "Dieser Server kann die Datei der App noch nicht übergeben. Öffnen Sie sie stattdessen im Browser."
|
||||||
},
|
},
|
||||||
"es": {
|
"es": {
|
||||||
"about_version": "LLeMbas para Android %1$s",
|
"about_version": "LLeMbas para Android %1$s",
|
||||||
@@ -175,6 +187,7 @@
|
|||||||
"share_default_prompt": "Échele un vistazo a esto.",
|
"share_default_prompt": "Échele un vistazo a esto.",
|
||||||
"share_label": "Preguntar a LLeMbas",
|
"share_label": "Preguntar a LLeMbas",
|
||||||
"share_sending": "Enviando a LLeMbas…",
|
"share_sending": "Enviando a LLeMbas…",
|
||||||
|
"shown": "Mostrado",
|
||||||
"signin_address": "Dirección de la instancia",
|
"signin_address": "Dirección de la instancia",
|
||||||
"signin_code_intro": "Abra la instancia en el navegador, inicie sesión y apruebe este código:",
|
"signin_code_intro": "Abra la instancia en el navegador, inicie sesión y apruebe este código:",
|
||||||
"signin_denied": "El inicio de sesión fue rechazado.",
|
"signin_denied": "El inicio de sesión fue rechazado.",
|
||||||
@@ -182,7 +195,7 @@
|
|||||||
"signin_intro": "Inicie sesión en una instancia de LLeMbas. Aprobará este teléfono en el navegador, igual que haría con la CLI.",
|
"signin_intro": "Inicie sesión en una instancia de LLeMbas. Aprobará este teléfono en el navegador, igual que haría con la CLI.",
|
||||||
"signin_open_browser": "Abrir en el navegador",
|
"signin_open_browser": "Abrir en el navegador",
|
||||||
"signin_too_new": "Esta instancia habla una API de aplicaciones más reciente que esta aplicación. Actualice la aplicación.",
|
"signin_too_new": "Esta instancia habla una API de aplicaciones más reciente que esta aplicación. Actualice la aplicación.",
|
||||||
"signin_too_old": "Esta instancia aún no tiene API para aplicaciones. Necesita LLeMbas 1.7.0 o una versión posterior.",
|
"signin_too_old": "Esta instancia usa una versión anterior de LLeMbas. Esta aplicación necesita LLeMbas 2.0 o posterior.",
|
||||||
"theme_moria": "Moria (oscuro)",
|
"theme_moria": "Moria (oscuro)",
|
||||||
"theme_shire": "Shire (claro)",
|
"theme_shire": "Shire (claro)",
|
||||||
"theme_system": "Como el sistema",
|
"theme_system": "Como el sistema",
|
||||||
@@ -192,7 +205,12 @@
|
|||||||
"update_check": "Buscar una actualización",
|
"update_check": "Buscar una actualización",
|
||||||
"update_installing": "Instalando %1$s…",
|
"update_installing": "Instalando %1$s…",
|
||||||
"update_none": "Esta es la versión más reciente.",
|
"update_none": "Esta es la versión más reciente.",
|
||||||
"update_unreachable": "No se pudo obtener la actualización."
|
"update_unreachable": "No se pudo obtener la actualización.",
|
||||||
|
"viewer_html_source": "Este es el código fuente de la página. Ábrala en el navegador para ver la página.",
|
||||||
|
"viewer_long_markdown": "Un archivo largo, por eso se muestra como texto sin formato.",
|
||||||
|
"viewer_open_browser": "Abrir en el navegador",
|
||||||
|
"viewer_too_large": "Este archivo es demasiado grande para mostrarlo; se puede mostrar como máximo 1 MB.",
|
||||||
|
"viewer_unavailable": "Este servidor todavía no puede entregar el archivo a la aplicación. Ábralo en el navegador."
|
||||||
},
|
},
|
||||||
"fr": {
|
"fr": {
|
||||||
"about_version": "LLeMbas pour Android %1$s",
|
"about_version": "LLeMbas pour Android %1$s",
|
||||||
@@ -240,6 +258,7 @@
|
|||||||
"share_default_prompt": "Jetez un œil à ceci.",
|
"share_default_prompt": "Jetez un œil à ceci.",
|
||||||
"share_label": "Demander à LLeMbas",
|
"share_label": "Demander à LLeMbas",
|
||||||
"share_sending": "Envoi à LLeMbas…",
|
"share_sending": "Envoi à LLeMbas…",
|
||||||
|
"shown": "Affiché",
|
||||||
"signin_address": "Adresse de l'instance",
|
"signin_address": "Adresse de l'instance",
|
||||||
"signin_code_intro": "Ouvrez l'instance dans le navigateur, connectez-vous et approuvez ce code :",
|
"signin_code_intro": "Ouvrez l'instance dans le navigateur, connectez-vous et approuvez ce code :",
|
||||||
"signin_denied": "La connexion a été refusée.",
|
"signin_denied": "La connexion a été refusée.",
|
||||||
@@ -247,7 +266,7 @@
|
|||||||
"signin_intro": "Connectez-vous à une instance LLeMbas. Vous approuvez ce téléphone dans le navigateur, comme vous le feriez pour la CLI.",
|
"signin_intro": "Connectez-vous à une instance LLeMbas. Vous approuvez ce téléphone dans le navigateur, comme vous le feriez pour la CLI.",
|
||||||
"signin_open_browser": "Ouvrir dans le navigateur",
|
"signin_open_browser": "Ouvrir dans le navigateur",
|
||||||
"signin_too_new": "Cette instance utilise une API d'application plus récente que cette application. Mettez à jour l'application.",
|
"signin_too_new": "Cette instance utilise une API d'application plus récente que cette application. Mettez à jour l'application.",
|
||||||
"signin_too_old": "Cette instance n'a pas encore d'API pour l'application. Elle nécessite LLeMbas 1.7.0 ou une version plus récente.",
|
"signin_too_old": "Cette instance utilise une version plus ancienne de LLeMbas. Cette application nécessite LLeMbas 2.0 ou plus récent.",
|
||||||
"theme_moria": "Moria (sombre)",
|
"theme_moria": "Moria (sombre)",
|
||||||
"theme_shire": "Shire (clair)",
|
"theme_shire": "Shire (clair)",
|
||||||
"theme_system": "Comme le système",
|
"theme_system": "Comme le système",
|
||||||
@@ -257,7 +276,12 @@
|
|||||||
"update_check": "Rechercher une mise à jour",
|
"update_check": "Rechercher une mise à jour",
|
||||||
"update_installing": "Installation de %1$s…",
|
"update_installing": "Installation de %1$s…",
|
||||||
"update_none": "C'est la version la plus récente.",
|
"update_none": "C'est la version la plus récente.",
|
||||||
"update_unreachable": "La mise à jour n'a pas pu être récupérée."
|
"update_unreachable": "La mise à jour n'a pas pu être récupérée.",
|
||||||
|
"viewer_html_source": "Ceci est le code source de la page. Ouvrez-la dans le navigateur pour voir la page elle-même.",
|
||||||
|
"viewer_long_markdown": "Un fichier long, il est donc affiché en texte brut.",
|
||||||
|
"viewer_open_browser": "Ouvrir dans le navigateur",
|
||||||
|
"viewer_too_large": "Ce fichier est trop volumineux pour être affiché ; 1 Mo au plus peut être affiché.",
|
||||||
|
"viewer_unavailable": "Ce serveur ne peut pas encore transmettre le fichier à l'application. Ouvrez-le plutôt dans le navigateur."
|
||||||
},
|
},
|
||||||
"hu": {
|
"hu": {
|
||||||
"about_version": "LLeMbas Androidra %1$s",
|
"about_version": "LLeMbas Androidra %1$s",
|
||||||
@@ -305,6 +329,7 @@
|
|||||||
"share_default_prompt": "Nézze meg ezt.",
|
"share_default_prompt": "Nézze meg ezt.",
|
||||||
"share_label": "Kérdés az LLeMbas-tól",
|
"share_label": "Kérdés az LLeMbas-tól",
|
||||||
"share_sending": "Küldés az LLeMbas-nak…",
|
"share_sending": "Küldés az LLeMbas-nak…",
|
||||||
|
"shown": "Megjelenítve",
|
||||||
"signin_address": "A példány címe",
|
"signin_address": "A példány címe",
|
||||||
"signin_code_intro": "Nyissa meg a példányt a böngészőben, jelentkezzen be, és hagyja jóvá ezt a kódot:",
|
"signin_code_intro": "Nyissa meg a példányt a böngészőben, jelentkezzen be, és hagyja jóvá ezt a kódot:",
|
||||||
"signin_denied": "A bejelentkezést elutasították.",
|
"signin_denied": "A bejelentkezést elutasították.",
|
||||||
@@ -312,7 +337,7 @@
|
|||||||
"signin_intro": "Jelentkezzen be egy LLeMbas példányba. Ezt a telefont a böngészőben hagyja jóvá, ahogyan a CLI-t is tenné.",
|
"signin_intro": "Jelentkezzen be egy LLeMbas példányba. Ezt a telefont a böngészőben hagyja jóvá, ahogyan a CLI-t is tenné.",
|
||||||
"signin_open_browser": "Megnyitás a böngészőben",
|
"signin_open_browser": "Megnyitás a böngészőben",
|
||||||
"signin_too_new": "Ez a példány újabb alkalmazás-API-t használ, mint ez az alkalmazás. Frissítse az alkalmazást.",
|
"signin_too_new": "Ez a példány újabb alkalmazás-API-t használ, mint ez az alkalmazás. Frissítse az alkalmazást.",
|
||||||
"signin_too_old": "Ennek a példánynak még nincs alkalmazás-API-ja. LLeMbas 1.7.0 vagy újabb verzió szükséges hozzá.",
|
"signin_too_old": "Ezen a példányon régebbi LLeMbas fut. Ehhez az alkalmazáshoz LLeMbas 2.0 vagy újabb kell.",
|
||||||
"theme_moria": "Moria (sötét)",
|
"theme_moria": "Moria (sötét)",
|
||||||
"theme_shire": "Shire (világos)",
|
"theme_shire": "Shire (világos)",
|
||||||
"theme_system": "A rendszer szerint",
|
"theme_system": "A rendszer szerint",
|
||||||
@@ -322,7 +347,12 @@
|
|||||||
"update_check": "Frissítés keresése",
|
"update_check": "Frissítés keresése",
|
||||||
"update_installing": "%1$s telepítése…",
|
"update_installing": "%1$s telepítése…",
|
||||||
"update_none": "Ez a legújabb verzió.",
|
"update_none": "Ez a legújabb verzió.",
|
||||||
"update_unreachable": "A frissítést nem sikerült letölteni."
|
"update_unreachable": "A frissítést nem sikerült letölteni.",
|
||||||
|
"viewer_html_source": "Ez az oldal forráskódja. Magát az oldalt a böngészőben megnyitva láthatja.",
|
||||||
|
"viewer_long_markdown": "Hosszú fájl, ezért egyszerű szövegként jelenik meg.",
|
||||||
|
"viewer_open_browser": "Megnyitás a böngészőben",
|
||||||
|
"viewer_too_large": "Ez a fájl túl nagy a megjelenítéshez; legfeljebb 1 MB jeleníthető meg.",
|
||||||
|
"viewer_unavailable": "Ez a szerver még nem tudja átadni a fájlt az alkalmazásnak. Nyissa meg inkább a böngészőben."
|
||||||
},
|
},
|
||||||
"it": {
|
"it": {
|
||||||
"about_version": "LLeMbas per Android %1$s",
|
"about_version": "LLeMbas per Android %1$s",
|
||||||
@@ -370,6 +400,7 @@
|
|||||||
"share_default_prompt": "Dai un'occhiata a questo.",
|
"share_default_prompt": "Dai un'occhiata a questo.",
|
||||||
"share_label": "Chiedi a LLeMbas",
|
"share_label": "Chiedi a LLeMbas",
|
||||||
"share_sending": "Invio a LLeMbas…",
|
"share_sending": "Invio a LLeMbas…",
|
||||||
|
"shown": "Mostrato",
|
||||||
"signin_address": "Indirizzo dell'istanza",
|
"signin_address": "Indirizzo dell'istanza",
|
||||||
"signin_code_intro": "Apri l'istanza nel browser, accedi e approva questo codice:",
|
"signin_code_intro": "Apri l'istanza nel browser, accedi e approva questo codice:",
|
||||||
"signin_denied": "L'accesso è stato rifiutato.",
|
"signin_denied": "L'accesso è stato rifiutato.",
|
||||||
@@ -377,7 +408,7 @@
|
|||||||
"signin_intro": "Accedi a un'istanza LLeMbas. Approvi questo telefono nel browser, come faresti con la CLI.",
|
"signin_intro": "Accedi a un'istanza LLeMbas. Approvi questo telefono nel browser, come faresti con la CLI.",
|
||||||
"signin_open_browser": "Apri nel browser",
|
"signin_open_browser": "Apri nel browser",
|
||||||
"signin_too_new": "Questa istanza usa un'API per l'app più recente di questa app. Aggiorna l'app.",
|
"signin_too_new": "Questa istanza usa un'API per l'app più recente di questa app. Aggiorna l'app.",
|
||||||
"signin_too_old": "Questa istanza non ha ancora un'API per l'app. Richiede LLeMbas 1.7.0 o una versione più recente.",
|
"signin_too_old": "Questa istanza usa una versione precedente di LLeMbas. Questa app richiede LLeMbas 2.0 o successivo.",
|
||||||
"theme_moria": "Moria (scuro)",
|
"theme_moria": "Moria (scuro)",
|
||||||
"theme_shire": "Shire (chiaro)",
|
"theme_shire": "Shire (chiaro)",
|
||||||
"theme_system": "Come il sistema",
|
"theme_system": "Come il sistema",
|
||||||
@@ -387,7 +418,12 @@
|
|||||||
"update_check": "Controlla aggiornamenti",
|
"update_check": "Controlla aggiornamenti",
|
||||||
"update_installing": "Installazione di %1$s…",
|
"update_installing": "Installazione di %1$s…",
|
||||||
"update_none": "Questa è la versione più recente.",
|
"update_none": "Questa è la versione più recente.",
|
||||||
"update_unreachable": "Non è stato possibile scaricare l'aggiornamento."
|
"update_unreachable": "Non è stato possibile scaricare l'aggiornamento.",
|
||||||
|
"viewer_html_source": "Questo è il sorgente della pagina. Aprila nel browser per vedere la pagina.",
|
||||||
|
"viewer_long_markdown": "Un file lungo, quindi è mostrato come testo semplice.",
|
||||||
|
"viewer_open_browser": "Apri nel browser",
|
||||||
|
"viewer_too_large": "Questo file è troppo grande da mostrare; si può mostrare al massimo 1 MB.",
|
||||||
|
"viewer_unavailable": "Questo server non può ancora passare il file all'app. Aprilo invece nel browser."
|
||||||
},
|
},
|
||||||
"pl": {
|
"pl": {
|
||||||
"about_version": "LLeMbas na Androida %1$s",
|
"about_version": "LLeMbas na Androida %1$s",
|
||||||
@@ -435,6 +471,7 @@
|
|||||||
"share_default_prompt": "Zobacz to.",
|
"share_default_prompt": "Zobacz to.",
|
||||||
"share_label": "Zapytaj LLeMbas",
|
"share_label": "Zapytaj LLeMbas",
|
||||||
"share_sending": "Wysyłanie do LLeMbas…",
|
"share_sending": "Wysyłanie do LLeMbas…",
|
||||||
|
"shown": "Pokazano",
|
||||||
"signin_address": "Adres instancji",
|
"signin_address": "Adres instancji",
|
||||||
"signin_code_intro": "Otwórz instancję w przeglądarce, zaloguj się i zatwierdź ten kod:",
|
"signin_code_intro": "Otwórz instancję w przeglądarce, zaloguj się i zatwierdź ten kod:",
|
||||||
"signin_denied": "Logowanie zostało odrzucone.",
|
"signin_denied": "Logowanie zostało odrzucone.",
|
||||||
@@ -442,7 +479,7 @@
|
|||||||
"signin_intro": "Zaloguj się do instancji LLeMbas. Ten telefon zatwierdza się w przeglądarce, tak jak CLI.",
|
"signin_intro": "Zaloguj się do instancji LLeMbas. Ten telefon zatwierdza się w przeglądarce, tak jak CLI.",
|
||||||
"signin_open_browser": "Otwórz w przeglądarce",
|
"signin_open_browser": "Otwórz w przeglądarce",
|
||||||
"signin_too_new": "Ta instancja używa nowszego API aplikacji niż ta aplikacja. Zaktualizuj aplikację.",
|
"signin_too_new": "Ta instancja używa nowszego API aplikacji niż ta aplikacja. Zaktualizuj aplikację.",
|
||||||
"signin_too_old": "Ta instancja nie ma jeszcze API aplikacji. Wymaga LLeMbas 1.7.0 lub nowszego.",
|
"signin_too_old": "Ta instancja działa na starszym LLeMbas. Ta aplikacja wymaga LLeMbas 2.0 lub nowszego.",
|
||||||
"theme_moria": "Moria (ciemny)",
|
"theme_moria": "Moria (ciemny)",
|
||||||
"theme_shire": "Shire (jasny)",
|
"theme_shire": "Shire (jasny)",
|
||||||
"theme_system": "Jak system",
|
"theme_system": "Jak system",
|
||||||
@@ -452,7 +489,12 @@
|
|||||||
"update_check": "Sprawdź aktualizację",
|
"update_check": "Sprawdź aktualizację",
|
||||||
"update_installing": "Instalowanie %1$s…",
|
"update_installing": "Instalowanie %1$s…",
|
||||||
"update_none": "To jest najnowsza wersja.",
|
"update_none": "To jest najnowsza wersja.",
|
||||||
"update_unreachable": "Nie udało się pobrać aktualizacji."
|
"update_unreachable": "Nie udało się pobrać aktualizacji.",
|
||||||
|
"viewer_html_source": "To jest źródło strony. Otwórz ją w przeglądarce, aby zobaczyć samą stronę.",
|
||||||
|
"viewer_long_markdown": "Długi plik, dlatego jest pokazany jako zwykły tekst.",
|
||||||
|
"viewer_open_browser": "Otwórz w przeglądarce",
|
||||||
|
"viewer_too_large": "Ten plik jest za duży, by go pokazać; można pokazać najwyżej 1 MB.",
|
||||||
|
"viewer_unavailable": "Ten serwer nie potrafi jeszcze przekazać pliku aplikacji. Otwórz go w przeglądarce."
|
||||||
},
|
},
|
||||||
"sk": {
|
"sk": {
|
||||||
"about_version": "LLeMbas pre Android %1$s",
|
"about_version": "LLeMbas pre Android %1$s",
|
||||||
@@ -500,6 +542,7 @@
|
|||||||
"share_default_prompt": "Pozrite sa na toto.",
|
"share_default_prompt": "Pozrite sa na toto.",
|
||||||
"share_label": "Spýtať sa LLeMbas",
|
"share_label": "Spýtať sa LLeMbas",
|
||||||
"share_sending": "Odosiela sa do LLeMbas…",
|
"share_sending": "Odosiela sa do LLeMbas…",
|
||||||
|
"shown": "Zobrazené",
|
||||||
"signin_address": "Adresa inštancie",
|
"signin_address": "Adresa inštancie",
|
||||||
"signin_code_intro": "Otvorte inštanciu v prehliadači, prihláste sa a schváľte tento kód:",
|
"signin_code_intro": "Otvorte inštanciu v prehliadači, prihláste sa a schváľte tento kód:",
|
||||||
"signin_denied": "Prihlásenie bolo odmietnuté.",
|
"signin_denied": "Prihlásenie bolo odmietnuté.",
|
||||||
@@ -507,7 +550,7 @@
|
|||||||
"signin_intro": "Prihláste sa do inštancie LLeMbas. Tento telefón schválite v prehliadači, tak ako by ste schválili CLI.",
|
"signin_intro": "Prihláste sa do inštancie LLeMbas. Tento telefón schválite v prehliadači, tak ako by ste schválili CLI.",
|
||||||
"signin_open_browser": "Otvoriť v prehliadači",
|
"signin_open_browser": "Otvoriť v prehliadači",
|
||||||
"signin_too_new": "Táto inštancia používa novšie API pre aplikácie než táto aplikácia. Aktualizujte aplikáciu.",
|
"signin_too_new": "Táto inštancia používa novšie API pre aplikácie než táto aplikácia. Aktualizujte aplikáciu.",
|
||||||
"signin_too_old": "Táto inštancia ešte nemá API pre aplikácie. Potrebuje LLeMbas 1.7.0 alebo novší.",
|
"signin_too_old": "Táto inštancia beží na staršom LLeMbas. Táto aplikácia potrebuje LLeMbas 2.0 alebo novší.",
|
||||||
"theme_moria": "Moria (tmavá)",
|
"theme_moria": "Moria (tmavá)",
|
||||||
"theme_shire": "Shire (svetlá)",
|
"theme_shire": "Shire (svetlá)",
|
||||||
"theme_system": "Podľa systému",
|
"theme_system": "Podľa systému",
|
||||||
@@ -517,6 +560,11 @@
|
|||||||
"update_check": "Skontrolovať aktualizáciu",
|
"update_check": "Skontrolovať aktualizáciu",
|
||||||
"update_installing": "Inštaluje sa %1$s…",
|
"update_installing": "Inštaluje sa %1$s…",
|
||||||
"update_none": "Toto je najnovšia verzia.",
|
"update_none": "Toto je najnovšia verzia.",
|
||||||
"update_unreachable": "Aktualizáciu sa nepodarilo stiahnuť."
|
"update_unreachable": "Aktualizáciu sa nepodarilo stiahnuť.",
|
||||||
|
"viewer_html_source": "Toto je zdrojový kód stránky. Samotnú stránku uvidíte po otvorení v prehliadači.",
|
||||||
|
"viewer_long_markdown": "Dlhý súbor, preto je zobrazený ako obyčajný text.",
|
||||||
|
"viewer_open_browser": "Otvoriť v prehliadači",
|
||||||
|
"viewer_too_large": "Tento súbor je príliš veľký na zobrazenie; zobraziť možno najviac 1 MB.",
|
||||||
|
"viewer_unavailable": "Tento server zatiaľ nevie aplikácii súbor odovzdať. Otvorte ho v prehliadači."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"tag": "v1.7.0",
|
"tag": "v2.0.0-beta.1",
|
||||||
"commit": "d9592e2d0f67f62d093149f0a1a0b15b8f4c91c6",
|
"commit": "a3b0e660cc4de3d25d75e560afd8441d0fa37a00",
|
||||||
"sha256": "a64ee7533a8b78fae1a0465498d70475c149c2f48bf33487c5cb28cf1cf9c82e"
|
"sha256": "8c0359a1b8e62b7170db3d5f9630c1289a1edc91b429fe8a2fa0e41e5588c9ed"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user