Nostr Note Translation Helper

Single-file local browser helper for translating copied public Nostr note text without keys or account access.

Nostr Note Translation Helper

What It Does

I made a tiny local browser helper: paste the note text, choose a target language, and open a translation without giving any Nostr app your keys or logging in.

Use

  1. Open translation-helper.html in a browser.
  2. Paste public Nostr note text.
  3. Pick a target language.
  4. Open Google Translate or DeepL.

Safety Boundary

  • No login, nsec, signer URL, wallet, API key, or direct-message access is required.
  • The helper does not post to Nostr, sign events, store text, move funds, or call a private backend.
  • It only opens the user's chosen translation site with text they pasted locally.

Revenue claim: none.

Single-File Helper

Save the following as translation-helper.html and open it locally:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Nostr Note Translation Helper</title>
  <style>
    :root { color-scheme: light dark; font-family: Arial, sans-serif; }
    body { max-width: 760px; margin: 0 auto; padding: 24px; line-height: 1.45; }
    textarea, select, button { font: inherit; }
    textarea { width: 100%; min-height: 180px; box-sizing: border-box; padding: 12px; }
    .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
    button { padding: 8px 12px; cursor: pointer; }
    .boundary { border-left: 4px solid #3b7; padding-left: 12px; color: #345; }
    @media (prefers-color-scheme: dark) { .boundary { color: #cfe; } }
  </style>
</head>
<body>
  <h1>Nostr Note Translation Helper</h1>
  <p>Paste public Nostr note text below, choose a target language, and open a translation page. No login, no keys, no wallet, no account access.</p>
  <label for="noteText">Nostr note text</label>
  <textarea id="noteText" placeholder="Paste the public note text here"></textarea>
  <div class="row">
    <label for="targetLanguage">Translate to</label>
    <select id="targetLanguage"><option value="en">English</option>
<option value="es">Spanish</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="it">Italian</option>
<option value="pt">Portuguese</option>
<option value="ja">Japanese</option>
<option value="ko">Korean</option>
<option value="zh-CN">Chinese (Simplified)</option>
<option value="ar">Arabic</option>
<option value="he">Hebrew</option>
<option value="uk">Ukrainian</option></select>
    <button type="button" id="googleButton">Open Google Translate</button>
    <button type="button" id="deeplButton">Open DeepL</button>
    <button type="button" id="clearButton">Clear</button>
  </div>
  <p class="boundary">Boundary: this page does not contact Nostr relays, sign events, store text, or ask for private material. It only opens a translation site with text you pasted.</p>
  <script>
    const noteText = document.getElementById("noteText");
    const targetLanguage = document.getElementById("targetLanguage");
    const googleButton = document.getElementById("googleButton");
    const deeplButton = document.getElementById("deeplButton");
    const clearButton = document.getElementById("clearButton");
    function cleanedText() {
      return noteText.value.replace(/\s+/g, " ").trim();
    }
    function requireText() {
      const text = cleanedText();
      if (!text) {
        noteText.focus();
        throw new Error("Paste public note text first.");
      }
      return text;
    }
    googleButton.addEventListener("click", () => {
      const text = encodeURIComponent(requireText());
      const target = encodeURIComponent(targetLanguage.value);
      window.open("https://translate.google.com/?sl=auto&tl=" + target + "&text=" + text + "&op=translate", "_blank", "noopener,noreferrer");
    });
    deeplButton.addEventListener("click", () => {
      const text = encodeURIComponent(requireText());
      const target = encodeURIComponent(targetLanguage.value.split("-")[0]);
      window.open("https://www.deepl.com/translator#auto/" + target + "/" + text, "_blank", "noopener,noreferrer");
    });
    clearButton.addEventListener("click", () => {
      noteText.value = "";
      noteText.focus();
    });
  </script>
</body>
</html>

Revenue claim: none. This is a free/pro-bono grant with no payment request.