Skip to content

Translation

The Signal bot provides three translation modes for cross-language communication in community groups.

Translate text or quoted messages on the fly.

Commands:

  • !translate <language> <text>: Translate text to a language.
  • !tr <language>: Reply to a message to translate it.
  • !tr <text>: Translate to English (default).
  • !trans: Alias for !translate.

Examples:

!translate spanish Hello, how are you?
!tr ja Good morning
!tr es (reply to a message)
!tr Bonjour tout le monde (translates to English)

Languages supported: Over 50 languages including: en, es, fr, de, ja, ko, zh, ar, ru, pt, it, hi, uk, pl, tr, vi, th, nl, sv, and more.

Accepts ISO 639-1 codes (es, ja), full names (spanish, japanese), or common aliases (mandarin -> zh, farsi -> fa).

Rate limit: 10 translations per hour per user.

Requires: AI features enabled in the room (!room ai on).


Automatically translate all non-target-language messages in a room. When enabled, any message not in the configured language gets a translation posted below it.

Commands (Admin only):

  • !room translate on <language>: Enable auto-translate to the target language.
  • !room translate off: Disable auto-translate.
  • !room: Shows current translate status alongside other room settings.

Examples:

!room translate on english Auto-translate everything to English
!room translate on es Auto-translate everything to Spanish
!room translate off Disable

How it works:

  1. Bot detects the language of each message
  2. If it differs from the room’s target language, the message is translated
  3. Translation appears as: 🌐 Spanish -> English: [translated text]

Skipped messages:

  • Commands (starting with !)
  • Short messages (< 5 characters)
  • Emoji-only messages
  • Messages already translated (starting with 🌐)
  • Bot’s own messages

Rate limit: 30 auto-translations per minute per room.


Create a private relay room with bidirectional translation between two groups. The bot translates ALL messages flowing both directions — like a real-time Babel Fish.

Aliases: !trelay, !request_t, !reqt

┌──────────────────────┐ ┌─────────────┐ ┌──────────────────────┐
│ Relay Room │ │ Bot │ │ Target Group │
│ (Users + Bot) │ │ (Babel Fish │ │ (Community) │
│ │ │ Translator)│ │ │
│ User types in │──────>│ Translate │──────>│ "Juan [es]: │
│ Spanish │ │ ES -> EN │ │ Hello everyone!" │
│ │ │ │ │ │
│ "🐟 Sarah: │<──────│ Translate │<──────│ Sarah types │
│ ¡Hola Juan!" │ │ EN -> ES │ │ in English │
└──────────────────────┘ └─────────────┘ └──────────────────────┘

ALL messages from the target group are relayed back to the relay room (not just replies). This is true Babel Fish mode — full bidirectional translation.

Self-relay (create for yourself, single language):

!trelay <my_language> <room#/name>
!trelay spanish 5 (you speak Spanish, group is English by default)
!trelay arabic tech (you speak Arabic, target "tech" group)

Two-language form (specify both languages):

!trelay <my_language> <group_language> <room#/name>
!trelay english spanish 5 (you speak English, group speaks Spanish)
!trelay french arabic tech (you speak French, group speaks Arabic)

Multi-user relay (add others to the relay room):

!trelay english spanish 5 @user1 @user2 @user3
!trelay spanish tech @Maria @Ahmed

Anonymous relay (group names instead of display names):

!trelay --anon spanish 5
!trelay --anon english spanish tech @user1 @user2
FlagDescription
--anon / --annon / -aAnonymous mode: hides display names in both directions. Target group sees “Relay”, relay room sees the target group’s name instead of individual names.
--named / -nNamed mode (default): display names shown in both directions.

Use a group number from !groups (e.g., 5) or a keyword to search group names (e.g., tech). Must be at least 3 characters for keyword search.

  1. Bot creates a private Signal group with the bot + all specified users
  2. Bot sends a bilingual welcome message in the relay room
  3. Bot announces in the target group: 🐟 Babel Fish activated! [users] connected ([language] <-> [language]).
  4. Relay -> Group: Messages typed in the relay room are translated and posted to the target group as Name [xx]: translated text
  5. Group -> Relay: ALL messages in the target group are translated and posted to the relay room as Name: translated text

In anonymous mode (--anon):

  • Relay -> Group: Messages appear as Relay [xx]: translated text (no display names)
  • Group -> Relay: Messages appear as GroupName: translated text (group name instead of individual names)

This is useful when you want to protect the identity of relay participants.

Any user:

  • !relay end: End the relay for the current room (run in the relay room)

Admin only:

  • !relay status: List all active translation relays
  • !relay end @user: End a specific user’s relay
# Self-relay (you speak Spanish, group speaks English by default)
!trelay spanish 5
# Two-language relay (you speak English, group #5 speaks Spanish)
!trelay english spanish 5
# Multi-user relay (you + Maria + Ahmed speak French, group speaks Arabic)
!trelay french arabic tech @Maria @Ahmed
# Anonymous multi-user relay
!trelay --anon spanish 3 @user1 @user2
# Check active relays (admin)
!relay status
# End a relay (in the relay room)
!relay end
# End someone's relay (admin)
!relay end @Maria

Translation features use two database additions (migration 036_translation_features.sql):

signal_groups table additions:

ColumnTypeDescription
translate_enabledBOOLEANWhether auto-translate is on for this room
translate_target_languageVARCHAR(10)ISO 639-1 target language code

translation_relays table:

ColumnTypeDescription
idSERIALPrimary key
user_uuidVARCHAR(255)UUID of the relay user
user_nameVARCHAR(255)Display name of the relay user
user_languageVARCHAR(10)Language the user speaks
relay_group_idVARCHAR(255)Signal group ID of the private relay room
target_group_idVARCHAR(255)Signal group ID of the community group
target_languageVARCHAR(10)Language of the target group (default: en)
anonymousBOOLEANWhether the user’s name is hidden
statusVARCHAR(50)active or ended
message_countINTEGERMessages translated through this relay
created_atTIMESTAMPTZWhen the relay was created
ended_atTIMESTAMPTZWhen the relay was ended

  • Translation uses OpenAI gpt-4o-mini with Local AI fallback
  • Language detection is done before translation to avoid unnecessary API calls
  • Relay messages use the format Name [xx]: text where xx is the language code
  • Auto-translate and relay both skip the bot’s own messages to prevent loops
  • Babel Fish relay forwards ALL target group messages (not just quoted replies)
  • Loop prevention: bot messages, relay-format messages, and commands (!) are skipped
  • Stale relays can be cleaned up after 24 hours of inactivity

For developer documentation including architecture diagrams, code paths, and integration details, see docs/TRANSLATION-SYSTEM.md.