Skip to content
Functionplugin-i18nv0.1.0

commandTranslations

Wraps one locale's command translations. Export it as the default from locales/<locale>.ts, like locales/pl.ts. Before each deploy, the plugin adds the translations to your commands.

commandTranslations(
    translations: CommandTranslations
): CommandTranslationFile
// locales/pl.ts
import { commandTranslations } from '@seedcord/plugin-i18n';

export default commandTranslations({
    slash: {
        config: {
            name: 'konfiguracja',
            description: 'Ustawienia bota',
            subcommands: {
                set: { name: 'ustaw', description: 'Zmień ustawienie' }
            }
        },
        search: {
            options: {
                category: { choices: { books: 'książki', films: 'filmy' } }
            }
        }
    },
    userMenus: { 'View Profile': 'Pokaż profil' }
});