Remove unnecessary description and whitespace from nexumi.mdc file
This commit is contained in:
50
packages/shared/src/index.ts
Normal file
50
packages/shared/src/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const LocaleSchema = z.enum(['de', 'en']);
|
||||
export type Locale = z.infer<typeof LocaleSchema>;
|
||||
|
||||
export const GuildSettingsSchema = z.object({
|
||||
guildId: z.string(),
|
||||
locale: LocaleSchema.default('de'),
|
||||
moderationEnabled: z.boolean().default(true)
|
||||
});
|
||||
|
||||
export const ModerationActionSchema = z.enum([
|
||||
'BAN',
|
||||
'UNBAN',
|
||||
'KICK',
|
||||
'TIMEOUT',
|
||||
'UN_TIMEOUT',
|
||||
'WARN_ADD',
|
||||
'WARN_REMOVE',
|
||||
'WARN_CLEAR',
|
||||
'PURGE',
|
||||
'LOCK',
|
||||
'UNLOCK',
|
||||
'SLOWMODE',
|
||||
'NICK_SET',
|
||||
'NICK_RESET',
|
||||
'CASE_EDIT',
|
||||
'CASE_DELETE',
|
||||
'MODNOTE_ADD'
|
||||
]);
|
||||
|
||||
export type ModerationAction = z.infer<typeof ModerationActionSchema>;
|
||||
|
||||
type Dictionary = Record<string, string>;
|
||||
const de: Dictionary = {
|
||||
'generic.noPermission': 'Du hast keine Berechtigung für diese Aktion.',
|
||||
'moderation.success': 'Aktion erfolgreich ausgeführt.',
|
||||
'moderation.reason.none': 'Kein Grund angegeben'
|
||||
};
|
||||
const en: Dictionary = {
|
||||
'generic.noPermission': 'You do not have permission for this action.',
|
||||
'moderation.success': 'Action executed successfully.',
|
||||
'moderation.reason.none': 'No reason provided'
|
||||
};
|
||||
|
||||
const locales: Record<Locale, Dictionary> = { de, en };
|
||||
|
||||
export function t(locale: Locale, key: string): string {
|
||||
return locales[locale][key] ?? key;
|
||||
}
|
||||
Reference in New Issue
Block a user