From 29a36b1ecf76b98fd07ae54527ef0544606d7074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E6=98=AF=E4=B8=80=E6=9D=A1=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E7=9A=84=E5=8C=BA?= Date: Thu, 5 Nov 2026 17:11:03 +0800 Subject: [PATCH] sensenova 0.2.1: localized labels for the provider options (#738) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two provider options (`create_key`, `prune_old_keys`) carry `labels`, `descriptions` and `confirms` in zh, zh-TW, ja and de, which magpie's host passes through (`optionsOf` → `inLanguages`) and the GUI picks by locale (`optionWords`). The English `prune_old_keys` description now also says a key whose creation time can't be read is never deleted, as `pruneKeys` does, so all five languages say the same thing. Version 0.2.1. Run at 77a164b25 on mote (macOS, Bun 1.4.2): - `bun test packages/sensenova`: 57 pass, 0 fail. `bun scripts/check.mjs`: exit 0. - A probe loading `SenseNovaAuthPlugin` and passing every option string through host.js's caps (label 60, description/confirm 300): all 20 localized strings come through whole (longest: de prune description, 257). - No `{{` in the file. Each translation read against the English. Co-authored-by: yunwang2442-creator --- packages/sensenova/index.mjs | 32 +++++++++++++++++++++++++++++++- packages/sensenova/package.json | 2 +- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/packages/sensenova/index.mjs b/packages/sensenova/index.mjs index 5f0480e..3052b8d 100644 --- a/packages/sensenova/index.mjs +++ b/packages/sensenova/index.mjs @@ -334,16 +334,46 @@ export async function SenseNovaAuthPlugin({ client, magpie } = {}, options = {}) { key: "create_key", label: "Create an API key on browser sign-in", + labels: { + zh: "浏览器登录时自动创建 API Key", + "zh-TW": "瀏覽器登入時自動建立 API Key", + ja: "ブラウザーサインイン時に API Key を自動作成", + de: "Bei Browser-Anmeldung automatisch einen API Key erstellen", + }, description: "After a browser sign-in, create a Token Plan API key on the account if this machine has none to reuse.", + descriptions: { + zh: "浏览器登录后,如果这台机器上没有可复用的 Key,就在账号里创建一个。", + "zh-TW": "瀏覽器登入後,如果這台機器上沒有可重用的 Key,就在帳號裡建立一個。", + ja: "ブラウザーでサインインした後、このマシンに再利用できる Key がなければ、アカウントに 1 つ作成します。", + de: "Wenn dieser Rechner nach der Browser-Anmeldung keinen wiederverwendbaren Key hat, wird einer auf dem Konto erstellt.", + }, default: true, }, { key: "prune_old_keys", label: "Prune old magpie API keys", + labels: { + zh: "清理旧的 magpie API Key", + "zh-TW": "清理舊的 magpie API Key", + ja: "古い magpie API Key を削除", + de: "Alte magpie API Keys löschen", + }, description: - "Keep the newest two keys this sign-in's account created and delete older ones. Manual keys and keys named for another SenseNova account are never touched; two saved sign-ins of the same account share the prefix.", + "Keep the newest two keys this sign-in's account created and delete older ones. Manual keys and keys named for another SenseNova account are never touched; a key whose creation time cannot be read is never deleted; two saved sign-ins of the same account share the prefix.", + descriptions: { + zh: "只保留本账号最新的两个 Key,删除更旧的。手动创建的 Key、以及名字属于别的 SenseNova 账号的 Key 永不删除;创建时间读不出的 Key 也永不删除;同一账号的两条登录记录共用前缀。", + "zh-TW": "只保留本帳號最新的兩個 Key,刪除更舊的。手動建立的 Key、以及名字屬於別的 SenseNova 帳號的 Key 永不刪除;建立時間讀不出的 Key 也永不刪除;同一帳號的兩條登入記錄共用前綴。", + ja: "このアカウントで最新の 2 本だけを残し、それより古いものを削除します。手動で作った Key、および別の SenseNova アカウント名の Key は絶対に削除しません。作成日時を読めない Key も絶対に削除しません。同じアカウントの 2 つのサインイン記録は同じプレフィックスを共有します。", + de: "Behält die zwei neuesten Keys dieses Kontos und löscht ältere. Manuelle Keys und Keys eines anderen SenseNova-Kontos bleiben unberührt; ein Key ohne lesbare Erstellungszeit wird nie gelöscht; zwei gespeicherte Anmeldungen desselben Kontos teilen das Präfix.", + }, confirm: "Old magpie-* keys of this account will be deleted; manual keys and other accounts' keys are kept.", + confirms: { + zh: "本账号较旧的 magpie-* Key 会被删除;手动创建的和别的账号的 Key 会保留。", + "zh-TW": "本帳號較舊的 magpie-* Key 會被刪除;手動建立的和別的帳號的 Key 會保留。", + ja: "このアカウントの古い magpie-* Key は削除されます。手動で作った Key と、別のアカウントの Key は保持されます。", + de: "Ältere magpie-* Keys dieses Kontos werden gelöscht; manuell erstellte Keys und Keys anderer Konten bleiben erhalten.", + }, }, ], diff --git a/packages/sensenova/package.json b/packages/sensenova/package.json index 3a34d90..434e1ac 100644 --- a/packages/sensenova/package.json +++ b/packages/sensenova/package.json @@ -1,6 +1,6 @@ { "name": "@magpie-community/opencode-sensenova-auth", - "version": "0.2.0", + "version": "0.2.1", "description": "SenseNova (SenseTime 日日新) Token Plan in OpenCode and magpie: browser or password sign-in for the credit pools, windows and grants, plus the plan's models through a Token Plan API key", "type": "module", "main": "./opencode.mjs",