MCbabel / discord-music-bot

🎶 A powerful, feature-rich Discord Music Bot built with Python and discord.py, allowing seamless integration with YouTube and Spotify. Created with the assistance of ChatGPT to demonstrate the capabilities of AI-driven development.
Other
2 stars 0 forks source link

multi-language support #2

Open TuteOneDev opened 1 month ago

TuteOneDev commented 1 month ago

(No code included)

How

Localization files (opt 1)

Add a directory to the project called ‘texts’ or ‘loc’ which contains .lang files each belonging to a language: en_US.lang -> english es_ES.lang -> español etc

playing_song=Reproduciendo: {song}

Localization files (opt 2)

Add a directory to the project called ‘texts’ or ‘loc’ which contains .py files each belonging to a language:

translations = {
    'PLAYING_SONG': 'Reproduciendo: {song}',
    'LANGUAGE_CHANGED': 'Se ha cambiado el idioma a Español',
}

Keys/Value Parser

it would be necessary to create a parser that obtains each of the translation values and sends messages according to the chosen language

Command

/language <value>
or
/config language <value>

MCbabel commented 1 month ago

Good idea! I'll add it to the next update!