Localise the Telegram channel's messages (English and Turkish)

Aperta
#237 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
28/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Read crates/channel-telegram/src/bridge.rs, especially the send_redacted and answer_callback_query paths, then inspect pairing.rs, inbox.rs, docs/guide/telegram.md, and docs/contributing/adding-a-language.md. Map every user-facing Telegram string and how pairing state and Telegram language_code are handled before shaping the catalog. Done when the acceptance criteria pass, including translations, fallback and placeholder checks, documentation updates, and the specified Cargo checks.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: daemon area: i18n enhancement help wanted

size: M · first-timer: no

Summary

Localise the Telegram channel's messages. The bot's replies, command responses and approval-card text in Telegram are English string literals; move them into a small message catalog with English and Turkish, choose the language per paired chat, and add a test that every message exists in every language.

Why it matters

The desktop app is available in English and Turkish, but a Turkish-speaking user who approves a tool call from their phone gets English text, on the very screen where understanding the message matters most (an approval). Localising it also prepares the channel for the shared channel API (#196) and more languages.

Current state

  • User-facing strings are literals in crates/channel-telegram/src/bridge.rs, for example "No bots configured.", "Switched active bot to ...", "No active run to stop.", "Could not process message ...", and the callback answers "Unknown or expired request" and "This can only be approved once". Other files in the crate (pairing.rs, inbox.rs) have their own.
  • The UI uses i18next with two locale files and docs/contributing/adding-a-language.md describes the process; check:i18n keeps keys in step. The Rust side has no equivalent.
  • docs/guide/telegram.md documents the channel; Telegram sends a language_code for each user.
  • Approval cards name the tool, command or secret and carry safety wording that must not be weakened by a translation.

Proposal and suggested approach

  1. A message catalog in the crate: an enum of message keys with typed arguments and a render(lang, args) function (a plain Rust table is fine; no heavy dependency), covering every string the bot sends. No behaviour change in English.
  2. Language selection per paired chat: default from the desktop app's UI language setting or the user's Telegram language_code, overridable with a command such as /lang; unknown languages fall back to English. Stored with the existing pairing state.
  3. Turkish translations for all messages, reviewed by a Turkish speaker; the approval text keeps exactly the same facts and the same buttons' meaning.
  4. Tests: every key has every language, placeholders match across languages, the fallback works, and the existing English-text tests keep passing.
  5. Update docs/guide/telegram.md and the adding-a-language guide.

Acceptance criteria

  • With Turkish selected every message the bot sends, including approval cards, errors and callback answers, is Turkish; with English nothing changes.
  • A missing translation or a placeholder mismatch fails a test.
  • Credentials, tokens and tool output are never passed through the catalog or logged differently than before.
  • cargo test -p channel-telegram and cargo clippy -p channel-telegram --all-targets -- -D warnings pass.

Out of scope

A third language (it becomes a data-only change afterwards), translating model replies (the model answers in the user's language already), and the shared channel API refactor (#196).

How to get started

Read crates/channel-telegram/src/bridge.rs (search for send_redacted and answer_callback_query), docs/guide/telegram.md and docs/contributing/adding-a-language.md. Comment here with how you would shape the catalog.

Lingua principale
Rust
Stelle
0
Fork
1
Merge medio
6h 54m
PR unite (30g)
152

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di emreocell/Praxi-Bot

Tutte le issue di emreocell/Praxi-Bot

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.