Update README and moderation commands for localization and migration support

- Revised README to include database migration steps and a new section for database management.
- Enhanced moderation command responses to utilize localized messages for unknown commands.
- Refactored moderation commands to use centralized command data definitions, improving maintainability and consistency.
- Added localization support for command descriptions and options in both German and English.
- Versioned Prisma migrations for better tracking of database changes.
This commit is contained in:
smueller
2026-07-22 12:06:16 +02:00
parent 405b70bdfc
commit a44f4d6641
12 changed files with 784 additions and 164 deletions

View File

@@ -0,0 +1,17 @@
import { describe, expect, it } from 'vitest';
import { commandLocale, localizedChoice } from './discord-localization.js';
describe('discord localization helpers', () => {
it('maps command locales to Discord localization keys', () => {
const locale = commandLocale('moderation.ban.description');
expect(locale.description).toBe('Ban a user');
expect(locale.descriptionLocalizations.de).toBe('Bannt einen Nutzer');
expect(locale.descriptionLocalizations['en-US']).toBe('Ban a user');
});
it('maps choice labels with localizations', () => {
const choice = localizedChoice('moderation.choice.ban', 'BAN');
expect(choice.value).toBe('BAN');
expect(choice.name_localizations?.de).toBe('Ban');
});
});