Android 1.0 for server 2.0: the file viewer, and older servers refused
CI / check (push) Canceled after 0s

The show card. A tool call may now carry `show` (event["show"], harness spec 3.0.0): a file's
name, path, kind, line and which copy -- node and version in the chat's tree, or the copy a linked
device sent (shown_id). The transcript draws it as a card with Open; the viewer is a full-screen,
read-only dialog that fetches the text and opens at the named line. Markdown goes through the same
Markwon setup as a reply (rule 4); code, text and Markdown over 200 000 characters are numbered
lines in a lazy list, the number column measured from the file's longest number. HTML is never
rendered: no WebView exists in the app, so it is shown as source, and "Open in the browser" opens
the web UI's viewer, which renders it in its sealed frame. Copy takes the whole file.

The text comes from GET /api/v2/chats/{chat}/show?node=&version= (or ?shown=), plain text, at most
1 MB. That route is the app's half of a contract the server does not have yet: /api/v2 neither
publishes `show` on a tool call nor serves the file to a token. Until it does, the card does not
appear, and a viewer that meets a missing route says so and offers the browser.

Older servers are refused: the discovery document's device-link protocol must be 3 (LLeMbas 2.0),
at sign-in and, for an instance signed in to before, when the chat list opens. The protocol and
not the version string, because the server's dev still says 1.7.x before its first beta.

Also: gen-strings.py takes a server ref like the other two generators, so the strings come from
the same commit as the contract and the tokens rather than from a shared working tree; the
Reports notification channel goes (2.0 has no reports) and is deleted on first start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Opus 5.5 committed 2026-10-28 04:31:07 +00:00
1 parent 052d0a3894
commit fd1af60dbb
25 files changed
+754 -62

No files matched your search

+26
View File
@@ -5,6 +5,32 @@ is in alpha and releases come off `main`.
## [Unreleased]
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.
- **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.
### 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.
- 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
The first version: a native client for a LLeMbas instance (server 1.7.0 or newer), and the
+5 -3
View File
@@ -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)
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
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
`./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 |
|---|---|---|
| `ui/theme/Tokens.kt` | `scripts/fetch-tokens.py <server-ref>` | `tokens.css` |
| `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`).
@@ -18,15 +18,16 @@ class LembasApp : Application() {
listOf(
NotificationChannel(CHANNEL_REPLIES, getString(R.string.channel_replies), NotificationManager.IMPORTANCE_DEFAULT),
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 {
const val CHANNEL_REPLIES = "replies"
const val CHANNEL_ASKS = "asks"
const val CHANNEL_REPORTS = "reports"
}
}
@@ -227,6 +227,38 @@ 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: the server rebuilds the
* chat's view and checks the path again, so a grant taken away since takes the file away too.
* Always plain text -- 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 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 --------------------------------------------------------------------------------
suspend fun pushKey(): PushKey = get("/push")
@@ -265,6 +297,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()
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)
}
}
@@ -0,0 +1,26 @@
package eu.llembas.android.api
/** The newest app API this app reads. A server with a newer one is told about, not guessed at. */
const val APP_API = 1
/**
* 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 < 1 || "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 name: 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,
val login: Login = Login(),
val scopes: List<String> = emptyList(),
@@ -191,9 +194,45 @@ data class ToolCall(
val truncated: Boolean = false,
val job: JsonElement? = 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(),
)
/**
* 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")
}
}
@Serializable
data class SteerNote(val id: String = "", val text: String = "")
@@ -113,7 +113,6 @@ object Notifications {
)
val channel = when (payload.kind) {
"ask" -> LembasApp.CHANNEL_ASKS
"report" -> LembasApp.CHANNEL_REPORTS
else -> LembasApp.CHANNEL_REPLIES
}
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.Search
import androidx.compose.material.icons.filled.Terminal
import androidx.compose.material.icons.filled.Visibility
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
@@ -46,6 +48,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import eu.llembas.android.R
import eu.llembas.android.api.Message
import eu.llembas.android.api.ShowCard
import eu.llembas.android.api.Step
import eu.llembas.android.api.ToolCall
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
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)) {
steps.forEach { step ->
when (step.kind) {
"thinking" -> Thinking(step)
"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) }
}
}
@@ -140,10 +146,15 @@ private fun iconFor(kind: String): ImageVector = when (kind) {
* scroller, so a megabyte of output never becomes the page.
*/
@Composable
fun ToolCallBlock(call: ToolCall, depth: Int = 0) {
fun ToolCallBlock(call: ToolCall, depth: Int = 0, onShow: ((ShowCard) -> Unit)? = null) {
val palette = LocalPalette.current
var open by rememberSaveable(call.id ?: call.block.title) { mutableStateOf(call.block.kind == "edit") }
val failed = call.status == "error" || !call.error.isNullOrEmpty()
val shown = call.show
if (shown != null && !failed) {
ShowCardRow(shown, depth, onShow)
return
}
Column(
Modifier
.fillMaxWidth()
@@ -192,7 +203,49 @@ fun ToolCallBlock(call: ToolCall, depth: Int = 0) {
if (call.truncated) {
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.api.Message
import eu.llembas.android.api.ModelInfo
import eu.llembas.android.api.ShowCard
import eu.llembas.android.assist.Recorder
import eu.llembas.android.lembas
import eu.llembas.android.ui.theme.LocalPalette
import eu.llembas.android.ui.viewer.FileViewer
import kotlinx.coroutines.launch
@OptIn(ExperimentalMaterial3Api::class)
@@ -88,6 +90,7 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
val snackbar = remember { SnackbarHostState() }
var menu by remember { mutableStateOf(false) }
var editing by remember { mutableStateOf<Message?>(null) }
var showing by remember { mutableStateOf<ShowCard?>(null) }
LaunchedEffect(chatId) { model.open(chatId) }
// 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 {
Steps(live.shown)
Steps(live.shown, onShow = { showing = it })
if (live.shown.isEmpty()) Text(stringResource(R.string.loading_line), color = palette.inkFaint)
live.metrics?.let { m -> ReplyFoot(message.copy(metrics = m)) }
}
else -> Column {
Steps(message.steps)
Steps(message.steps, onShow = { showing = it })
ReplyFoot(message)
if (live == null && message == rows.lastOrNull()) {
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 ->
var text by remember(message.id) { mutableStateOf(message.text.orEmpty()) }
AlertDialog(
@@ -53,7 +53,10 @@ import androidx.lifecycle.viewModelScope
import androidx.lifecycle.viewmodel.compose.viewModel
import eu.llembas.android.R
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.ui.signin.refusal
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.update
@@ -68,12 +71,29 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
val state = _state.asStateFlow()
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) {
this.kind = kind
viewModelScope.launch {
_state.update { it.copy(loading = true, error = null) }
try {
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)
_state.value = ChatsState(chats = page.chats, more = page.more)
} catch (e: Exception) {
@@ -43,6 +43,8 @@ import androidx.lifecycle.viewModelScope
import androidx.lifecycle.viewmodel.compose.viewModel
import eu.llembas.android.R
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.lembas
import kotlinx.coroutines.Job
@@ -60,8 +62,12 @@ sealed interface SignInState {
data object Done : SignInState
}
/** The newest API this app reads. A server with a newer one is told about, not guessed at. */
const val APP_API = 1
/** The sentence for a server this app will not work with, or null when it fits. */
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) {
private val _state = MutableStateFlow<SignInState>(SignInState.Address)
@@ -76,12 +82,8 @@ class SignInViewModel(app: Application) : AndroidViewModel(app) {
try {
val base = normaliseBase(typed)
val found = doorstep.discover(base)
if (found.service != "lembas" || found.appApi < 1 || "app" !in found.scopes) {
_state.value = SignInState.Failed(getApplication<Application>().getString(R.string.signin_too_old))
return@launch
}
if (found.appApi > APP_API) {
_state.value = SignInState.Failed(getApplication<Application>().getString(R.string.signin_too_new))
refusal(fit(found))?.let { said ->
_state.value = SignInState.Failed(getApplication<Application>().getString(said))
return@launch
}
val device = getApplication<Application>().getString(R.string.device_name)
@@ -0,0 +1,261 @@
@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.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
data class Text(val text: String) : Loaded
/** [unavailable]: this server has no door for the app to read a shown file through. */
data class Failed(val message: String, val unavailable: Boolean = false) : Loaded
}
/**
* 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) {
val context = LocalContext.current
val palette = LocalPalette.current
var loaded by remember(chatId, show) { mutableStateOf<Loaded>(Loaded.Loading) }
var web by remember(chatId, show) { mutableStateOf<String?>(null) }
LaunchedEffect(chatId, show) {
val api = context.lembas.instances.client()
if (api == null) {
loaded = Loaded.Failed(context.getString(R.string.assist_signed_out))
return@LaunchedEffect
}
web = api.webViewer(chatId, show)
loaded = try {
Loaded.Text(api.shownText(chatId, show))
} catch (e: ApiException) {
when {
e.status == 413 -> Loaded.Failed(context.getString(R.string.viewer_too_large))
// No such route at all (FastAPI's own "Not Found", or the wrong method): a
// server without the app's door to shown files. 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(show.name.ifBlank { show.path }, maxLines = 1, overflow = TextOverflow.Ellipsis)
Text(
show.path + if (show.line > 0) ":${show.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, show.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(show, now.text)
}
}
}
}
}
@Composable
private fun Body(show: ShowCard, text: String) {
val palette = LocalPalette.current
val kind = show.viewKind
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, show.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) }
}
+9 -2
View File
@@ -11,7 +11,7 @@
<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_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="new_chat">Nová konverzace</string>
<string name="tab_chats">Konverzace</string>
@@ -58,6 +58,14 @@
<string name="plan_revise">Přepracovat</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="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="settings">Nastavení</string>
<string name="settings_instances">Instance</string>
<string name="sign_out">Odhlásit se</string>
@@ -74,7 +82,6 @@
<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_asks">Otázky a schválení</string>
<string name="channel_reports">Zprávy</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_open_settings">Otevřít nastavení asistenta</string>
+9 -2
View File
@@ -11,7 +11,7 @@
<string name="signin_open_browser">Im Browser öffnen</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_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="new_chat">Neuer Chat</string>
<string name="tab_chats">Chats</string>
@@ -58,6 +58,14 @@
<string name="plan_revise">Überarbeiten</string>
<string name="plan_what_to_change">Was soll sich ändern?</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="settings">Einstellungen</string>
<string name="settings_instances">Instanzen</string>
<string name="sign_out">Abmelden</string>
@@ -74,7 +82,6 @@
<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_asks">Fragen und Bestätigungen</string>
<string name="channel_reports">Berichte</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_open_settings">Assistenten-Einstellungen öffnen</string>
+9 -2
View File
@@ -11,7 +11,7 @@
<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_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="new_chat">Nuevo chat</string>
<string name="tab_chats">Chats</string>
@@ -58,6 +58,14 @@
<string name="plan_revise">Revisar</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="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="settings">Ajustes</string>
<string name="settings_instances">Instancias</string>
<string name="sign_out">Cerrar sesión</string>
@@ -74,7 +82,6 @@
<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_asks">Preguntas y aprobaciones</string>
<string name="channel_reports">Informes</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_open_settings">Abrir los ajustes del asistente</string>
+9 -2
View File
@@ -11,7 +11,7 @@
<string name="signin_open_browser">Ouvrir dans le navigateur</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_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="new_chat">Nouvelle conversation</string>
<string name="tab_chats">Conversations</string>
@@ -58,6 +58,14 @@
<string name="plan_revise">Réviser</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="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="settings">Paramètres</string>
<string name="settings_instances">Instances</string>
<string name="sign_out">Se déconnecter</string>
@@ -74,7 +82,6 @@
<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_asks">Questions et approbations</string>
<string name="channel_reports">Rapports</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_open_settings">Ouvrir les paramètres de l\'assistant</string>
+9 -2
View File
@@ -11,7 +11,7 @@
<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_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="new_chat">Új csevegés</string>
<string name="tab_chats">Csevegések</string>
@@ -58,6 +58,14 @@
<string name="plan_revise">Átdolgozás</string>
<string name="plan_what_to_change">Mi változzon?</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="settings">Beállítások</string>
<string name="settings_instances">Példányok</string>
<string name="sign_out">Kijelentkezés</string>
@@ -74,7 +82,6 @@
<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_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="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>
+9 -2
View File
@@ -11,7 +11,7 @@
<string name="signin_open_browser">Apri nel browser</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_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="new_chat">Nuova chat</string>
<string name="tab_chats">Chat</string>
@@ -58,6 +58,14 @@
<string name="plan_revise">Rivedi</string>
<string name="plan_what_to_change">Cosa dovrebbe cambiare?</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="settings">Impostazioni</string>
<string name="settings_instances">Istanze</string>
<string name="sign_out">Esci</string>
@@ -74,7 +82,6 @@
<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_asks">Domande e approvazioni</string>
<string name="channel_reports">Report</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_open_settings">Apri le impostazioni dell\'assistente</string>
+9 -2
View File
@@ -11,7 +11,7 @@
<string name="signin_open_browser">Otwórz w przeglądarce</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_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="new_chat">Nowy czat</string>
<string name="tab_chats">Czaty</string>
@@ -58,6 +58,14 @@
<string name="plan_revise">Popraw</string>
<string name="plan_what_to_change">Co powinno się zmienić?</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="settings">Ustawienia</string>
<string name="settings_instances">Instancje</string>
<string name="sign_out">Wyloguj się</string>
@@ -74,7 +82,6 @@
<string name="push_failed">Nie wybrano dystrybutora, więc powiadomienia są wciąż wyłączone.</string>
<string name="channel_replies">Odpowiedzi</string>
<string name="channel_asks">Pytania i zatwierdzenia</string>
<string name="channel_reports">Raporty</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_open_settings">Otwórz ustawienia asystenta</string>
+9 -2
View File
@@ -11,7 +11,7 @@
<string name="signin_open_browser">Otvoriť v prehliadači</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_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="new_chat">Nová konverzácia</string>
<string name="tab_chats">Konverzácie</string>
@@ -58,6 +58,14 @@
<string name="plan_revise">Prepracovať</string>
<string name="plan_what_to_change">Čo by sa malo zmeniť?</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="settings">Nastavenia</string>
<string name="settings_instances">Inštancie</string>
<string name="sign_out">Odhlásiť sa</string>
@@ -74,7 +82,6 @@
<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_asks">Otázky a schválenia</string>
<string name="channel_reports">Správy</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_open_settings">Otvoriť nastavenia asistenta</string>
+9 -2
View File
@@ -12,7 +12,7 @@
<string name="signin_open_browser">Open in the browser</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_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="new_chat">New chat</string>
<string name="tab_chats">Chats</string>
@@ -59,6 +59,14 @@
<string name="plan_revise">Revise</string>
<string name="plan_what_to_change">What should change?</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="settings">Settings</string>
<string name="settings_instances">Instances</string>
<string name="sign_out">Sign out</string>
@@ -75,7 +83,6 @@
<string name="push_failed">No distributor was chosen, so notifications are still off.</string>
<string name="channel_replies">Replies</string>
<string name="channel_asks">Questions and approvals</string>
<string name="channel_reports">Reports</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_open_settings">Open the assistant settings</string>
@@ -0,0 +1,77 @@
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
/**
* The `show` card and the server gate. The card's shape is the server's own payload
* (`services/tools/files.py` `_run_show` for a tree file, `services/shown.py` `payload` for a
* device's) -- written out here because the server's contract fixtures do not carry a `show`
* call yet. When they do, this moves into `ContractTest`.
*/
class ShowAndServerTest {
private fun call(json: String) = LembasJson.decodeFromString(ToolCall.serializer(), json)
@Test
fun aTreeFileShowCard() {
val c = call(
"""
{"id": "call3", "name": "show", "status": "ok", "path": "/home/frodo/notes/road.md",
"show": {"path": "/home/frodo/notes/road.md", "name": "road.md", "kind": "markdown",
"language": "", "line": 12, "node_id": "n1", "version_id": "v7",
"sha": "ab12", "size": 2048, "mime": "text/markdown"},
"block": {"kind": "show", "title": "/home/frodo/notes/road.md"}}
""",
)
val show = c.show!!
assertEquals("road.md", show.name)
assertEquals("markdown", show.viewKind)
assertEquals(12, show.line)
assertEquals(listOf("node" to "n1", "version" to "v7"), show.query)
}
@Test
fun aDeviceFileShowCardNamesTheKeptCopy() {
val c = call(
"""
{"name": "show", "show": {"path": "src/main.rs", "name": "main.rs", "kind": "code",
"language": "rust", "line": 0, "node_id": "", "version_id": "", "sha": "cd34",
"size": 10, "mime": "text/plain", "source": "device", "shown_id": "s9",
"url": "/api/chats/chat1/shown/s9"}}
""",
)
assertEquals("device", c.show!!.source)
assertEquals(listOf("shown" to "s9"), c.show!!.query)
assertEquals("rust", c.show!!.language)
}
@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 onlyAServerOnTheTwoPointOhProtocolFits() {
val two = """{"service": "lembas", "version": "2.0.0-beta.1", "protocol": 3, "protocols": [3],
"app_api": 1, "scopes": ["app", "models"]}"""
assertEquals(ServerFit.FITS, fit(discovery(two)))
// 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": 1, "scopes": ["app"]}""")))
assertEquals(ServerFit.TOO_NEW, fit(discovery(two.replace("\"app_api\": 1", "\"app_api\": 2"))))
assertEquals(ServerFit.NOT_LEMBAS, fit(discovery("""{"service": "other", "protocol": 3}""")))
}
}
+30 -5
View File
@@ -2,8 +2,15 @@
"""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.
scripts/gen-strings.py (server at ../LLeMbas, or LEMBAS_SERVER)
scripts/gen-strings.py --check fail if a key the code uses has no English, or the other way round
scripts/gen-strings.py <server-ref> the catalogues at that ref of the server's git checkout
(../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
@@ -12,6 +19,7 @@ import importlib.util
import json
import os
import re
import subprocess
import sys
from pathlib import Path
from xml.sax.saxutils import escape
@@ -31,8 +39,18 @@ def android(text: str) -> str:
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"
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():
return {}
spec = importlib.util.spec_from_file_location(f"catalogue_{code}", path)
@@ -71,10 +89,17 @@ def main() -> None:
if "--check" in sys.argv:
print(f"gen-strings: {len(STRINGS)} strings, all used")
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"))
write(RES / "values", STRINGS)
for code in LANGS:
catalogue = server_catalogue(code)
catalogue = server_catalogue(code, ref)
mine = own.get(code, {})
out = {}
for key, english in STRINGS.items():
@@ -84,7 +109,7 @@ def main() -> None:
if text and text.count("%1$s") == english.count("%1$s"):
out[key] = text
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__":
+10 -2
View File
@@ -23,7 +23,7 @@ STRINGS: dict[str, str] = {
"signin_open_browser": "Open in the browser",
"signin_denied": "The sign-in was refused.",
"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.",
# Chats
"new_chat": "New chat",
@@ -72,6 +72,15 @@ STRINGS: dict[str, str] = {
"plan_revise": "Revise",
"plan_what_to_change": "What should change?",
"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.",
# Settings
"settings": "Settings",
"settings_instances": "Instances",
@@ -89,7 +98,6 @@ STRINGS: dict[str, str] = {
"push_failed": "No distributor was chosen, so notifications are still off.",
"channel_replies": "Replies",
"channel_asks": "Questions and approvals",
"channel_reports": "Reports",
"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_open_settings": "Open the assistant settings",
+64 -16
View File
@@ -45,6 +45,7 @@
"share_default_prompt": "Podívejte se na tohle.",
"share_label": "Zeptat se LLeMbas",
"share_sending": "Odesílá se do LLeMbas…",
"shown": "Zobrazeno",
"signin_address": "Adresa instance",
"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.",
@@ -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_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_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_shire": "Shire (světlý)",
"theme_system": "Podle systému",
@@ -62,7 +63,12 @@
"update_check": "Zkontrolovat aktualizaci",
"update_installing": "Instaluje se %1$s…",
"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": {
"about_version": "LLeMbas für Android %1$s",
@@ -110,6 +116,7 @@
"share_default_prompt": "Schauen Sie sich das an.",
"share_label": "LLeMbas fragen",
"share_sending": "Wird an LLeMbas gesendet…",
"shown": "Angezeigt",
"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_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_open_browser": "Im Browser öffnen",
"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_shire": "Shire (hell)",
"theme_system": "Wie das System",
@@ -127,7 +134,12 @@
"update_check": "Nach einem Update suchen",
"update_installing": "%1$s wird installiert…",
"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": {
"about_version": "LLeMbas para Android %1$s",
@@ -175,6 +187,7 @@
"share_default_prompt": "Échele un vistazo a esto.",
"share_label": "Preguntar a LLeMbas",
"share_sending": "Enviando a LLeMbas…",
"shown": "Mostrado",
"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_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_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_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_shire": "Shire (claro)",
"theme_system": "Como el sistema",
@@ -192,7 +205,12 @@
"update_check": "Buscar una actualización",
"update_installing": "Instalando %1$s…",
"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": {
"about_version": "LLeMbas pour Android %1$s",
@@ -240,6 +258,7 @@
"share_default_prompt": "Jetez un œil à ceci.",
"share_label": "Demander à LLeMbas",
"share_sending": "Envoi à LLeMbas…",
"shown": "Affiché",
"signin_address": "Adresse de l'instance",
"signin_code_intro": "Ouvrez l'instance dans le navigateur, connectez-vous et approuvez ce code :",
"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_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_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_shire": "Shire (clair)",
"theme_system": "Comme le système",
@@ -257,7 +276,12 @@
"update_check": "Rechercher une mise à jour",
"update_installing": "Installation de %1$s…",
"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": {
"about_version": "LLeMbas Androidra %1$s",
@@ -305,6 +329,7 @@
"share_default_prompt": "Nézze meg ezt.",
"share_label": "Kérdés az LLeMbas-tól",
"share_sending": "Küldés az LLeMbas-nak…",
"shown": "Megjelenítve",
"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_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_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_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_shire": "Shire (világos)",
"theme_system": "A rendszer szerint",
@@ -322,7 +347,12 @@
"update_check": "Frissítés keresése",
"update_installing": "%1$s telepítése…",
"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": {
"about_version": "LLeMbas per Android %1$s",
@@ -370,6 +400,7 @@
"share_default_prompt": "Dai un'occhiata a questo.",
"share_label": "Chiedi a LLeMbas",
"share_sending": "Invio a LLeMbas…",
"shown": "Mostrato",
"signin_address": "Indirizzo dell'istanza",
"signin_code_intro": "Apri l'istanza nel browser, accedi e approva questo codice:",
"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_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_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_shire": "Shire (chiaro)",
"theme_system": "Come il sistema",
@@ -387,7 +418,12 @@
"update_check": "Controlla aggiornamenti",
"update_installing": "Installazione di %1$s…",
"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": {
"about_version": "LLeMbas na Androida %1$s",
@@ -435,6 +471,7 @@
"share_default_prompt": "Zobacz to.",
"share_label": "Zapytaj LLeMbas",
"share_sending": "Wysyłanie do LLeMbas…",
"shown": "Pokazano",
"signin_address": "Adres instancji",
"signin_code_intro": "Otwórz instancję w przeglądarce, zaloguj się i zatwierdź ten kod:",
"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_open_browser": "Otwórz w przeglądarce",
"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_shire": "Shire (jasny)",
"theme_system": "Jak system",
@@ -452,7 +489,12 @@
"update_check": "Sprawdź aktualizację",
"update_installing": "Instalowanie %1$s…",
"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": {
"about_version": "LLeMbas pre Android %1$s",
@@ -500,6 +542,7 @@
"share_default_prompt": "Pozrite sa na toto.",
"share_label": "Spýtať sa LLeMbas",
"share_sending": "Odosiela sa do LLeMbas…",
"shown": "Zobrazené",
"signin_address": "Adresa inštancie",
"signin_code_intro": "Otvorte inštanciu v prehliadači, prihláste sa a schváľte tento kód:",
"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_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_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_shire": "Shire (svetlá)",
"theme_system": "Podľa systému",
@@ -517,6 +560,11 @@
"update_check": "Skontrolovať aktualizáciu",
"update_installing": "Inštaluje sa %1$s…",
"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."
}
}