From 41d7b9d4e5d0e10cdac708d9c9cd4838e47240ec Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 9 Oct 2026 10:36:39 -0700 Subject: Translation: posts in another language are shown in yours — "Translated from Spanish · Show original" under the words, automatic by default for posts the language guess calls foreign (Settings → Nostr → Translation switches it off and leaves a Translate link instead), and ⋯ → Translate for any post. The browser's on-device Translator does it when the language pair is already installed (desktop Chrome); otherwise the registrar's new POST /translate (names/translate.js): a cached, 4-at-a-time front for a LibreTranslate container on cs (names/compose-libretranslate.yml, v1.9.6, 32 languages; none for sw/mr/ta/te, so those readers get no offer). Links, nostr: mentions, :emoji:, #tags and long codes are never sent to the model — only the prose between them, batched in one call (src/translate-split.js, shared). Translations are remembered (coinos-translations, 300). tools/translate-test.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Vps2H27rhbG9ZqseGfMrc3 --- src/i18n.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/i18n.js') diff --git a/src/i18n.js b/src/i18n.js index 7f3dfc0..a1b0a79 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -436,6 +436,16 @@ const STR = { postUnmuteThread: 'Unmute this thread', postReport: 'Report…', postEdit: 'Edit', + translateBtn: 'Translate', + translating: 'Translating…', + translated: 'Translated', + translatedFrom: 'Translated from {lang}', + translateShowOriginal: 'Show original', + translateSame: 'This post is already in your language', + translateFailed: 'Couldn’t translate this post', + translateTitle: 'Translation', + translateAutoToggle: 'Translate posts into {lang} automatically', + translateHelp: 'Posts that look like they’re in another language are shown in yours, with a way back to the original. Translations come from your browser when it can, otherwise from coinos’s own LibreTranslate server — posts are public, but the text passes through it.', postEditTitle: 'Edit post', postEditHelp: 'The edit is published beside the original (kind 1010). Apps that read edits show the new text; others keep showing what you first wrote.', postEditedTag: 'edited', -- cgit v1.2.3