Skip to content

Create Bot Translation System and Language Files #2

@dalbrechtmartin

Description

@dalbrechtmartin

🌍 Feature: Create Bot Translation System and Language Files

📋 Description

This issue aims to implement the multilingual support system for SalemBot by creating structured translation files and replacing hardcoded strings with dynamic, locale-aware alternatives.


✅ Goals

  • Provide support for multiple languages in the bot (starting with French and English).
  • Centralize all user-facing text in translation files.
  • Create a helper utility to fetch strings based on the user's language or server default.

📁 File Structure

Translation files will be stored in: src/data/lang/

Each language should have its own JSON file:


🛠️ Implementation

  • Create a get_translation(key: str, lang: str = "us_EN") utility that fetches a localized string.
  • Add support for pluralization and dynamic variables (e.g., "Welcome, {username}!").
  • Replace all hardcoded user-facing strings (e.g., "Meow...", "Welcome", etc.) with dynamic translations.
  • Default to English (us_EN) if translation key or locale is missing.
  • Automatically detect language based on Discord server region or user preference.
  • Include a /language command to allow players to change their language settings.

Metadata

Metadata

Labels

5Between 1 - 2 days of work estimatedIn progressUser story in progressenhancementNew feature or requestuser storyObjective to achieve

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions