Skip to content

feat: translate notes to user's preferred language (#1055) - #1113

Open
ehfcnate wants to merge 1 commit into
PrimalHQ:mainfrom
ehfcnate:feat/note-translate-preferred-language
Open

ehfcnate wants to merge 1 commit into
PrimalHQ:mainfrom
ehfcnate:feat/note-translate-preferred-language

Conversation

@ehfcnate

Copy link
Copy Markdown

Summary

Implements on-demand note translation for #1055, aligned with the web-app architecture:

  • Inline Translate / Show original under feed note content
  • Overflow menu Translate Note action
  • Settings → Translation: enable toggle, provider (LibreTranslate / Google / DeepL), target language, LibreTranslate base URL, optional API key
  • Entity sanitizer protecting URLs, nostr: refs, ln invoices, cashu, bech32, hashtags, and mentions
  • Unit tests for sanitize/restore and offer heuristic

Google and DeepL fail closed without a user-owned API key. LibreTranslate works against a user-configured instance (default https://libretranslate.com).

Lightning Bounty: https://app.lightningbounties.com/issue/eb8d5715-cd31-4bdb-9e8a-68b386e6b934
Closes #1055

Test plan

  • Open Settings → Translation; set target language and LibreTranslate URL
  • On a foreign-language note, tap Translate; confirm translated text appears and entities are unchanged
  • Tap Show original / Show translation toggle
  • Use overflow Translate Note and confirm cache updates inline
  • With Google/DeepL selected and empty API key, confirm clear error toast

Add inline Translate on feed notes, overflow-menu action, and Settings →
Translation for LibreTranslate/Google/DeepL with entity sanitizer so
Nostr/Bitcoin tokens survive provider round-trips.

Closes PrimalHQ#1055
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Translate notes to user's preferred language

1 participant