Skip to content

Commit

Permalink
fix: add missing message handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet committed Dec 28, 2023
1 parent d4a78bf commit 88d0d12
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 6 deletions.
40 changes: 40 additions & 0 deletions src/languages/de/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Handler } from '#lib/i18n/structures/Handler';
import { TimeTypes } from '@sapphire/time-utilities';

export class ExtendedHandler extends Handler {
public constructor() {
super({
name: 'de',
duration: {
[TimeTypes.Year]: {
1: 'Jahr',
DEFAULT: 'Jahre'
},
[TimeTypes.Month]: {
1: 'Monat',
DEFAULT: 'Monate'
},
[TimeTypes.Week]: {
1: 'Woche',
DEFAULT: 'Wochen'
},
[TimeTypes.Day]: {
1: 'Tag',
DEFAULT: 'Tage'
},
[TimeTypes.Hour]: {
1: 'Stunde',
DEFAULT: 'Stunden'
},
[TimeTypes.Minute]: {
1: 'Minute',
DEFAULT: 'Minuten'
},
[TimeTypes.Second]: {
1: 'Sekunde',
DEFAULT: 'Sekunden'
}
}
});
}
}
40 changes: 40 additions & 0 deletions src/languages/en-GB/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Handler } from '#lib/i18n/structures/Handler';
import { TimeTypes } from '@sapphire/time-utilities';

export class ExtendedHandler extends Handler {
public constructor() {
super({
name: 'en-GB',
duration: {
[TimeTypes.Year]: {
1: 'year',
DEFAULT: 'years'
},
[TimeTypes.Month]: {
1: 'month',
DEFAULT: 'months'
},
[TimeTypes.Week]: {
1: 'week',
DEFAULT: 'weeks'
},
[TimeTypes.Day]: {
1: 'day',
DEFAULT: 'days'
},
[TimeTypes.Hour]: {
1: 'hour',
DEFAULT: 'hours'
},
[TimeTypes.Minute]: {
1: 'minute',
DEFAULT: 'minutes'
},
[TimeTypes.Second]: {
1: 'second',
DEFAULT: 'seconds'
}
}
});
}
}
40 changes: 40 additions & 0 deletions src/languages/es-419/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Handler } from '#lib/i18n/structures/Handler';
import { TimeTypes } from '@sapphire/time-utilities';

export class ExtendedHandler extends Handler {
public constructor() {
super({
name: 'es-419',
duration: {
[TimeTypes.Year]: {
1: 'año',
DEFAULT: 'años'
},
[TimeTypes.Month]: {
1: 'mes',
DEFAULT: 'meses'
},
[TimeTypes.Week]: {
1: 'semana',
DEFAULT: 'semanas'
},
[TimeTypes.Day]: {
1: 'día',
DEFAULT: 'días'
},
[TimeTypes.Hour]: {
1: 'hora',
DEFAULT: 'horas'
},
[TimeTypes.Minute]: {
1: 'minuto',
DEFAULT: 'minutos'
},
[TimeTypes.Second]: {
1: 'segundo',
DEFAULT: 'segundos'
}
}
});
}
}
40 changes: 40 additions & 0 deletions src/languages/es-ES/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Handler } from '#lib/i18n/structures/Handler';
import { TimeTypes } from '@sapphire/time-utilities';

export class ExtendedHandler extends Handler {
public constructor() {
super({
name: 'es-ES',
duration: {
[TimeTypes.Year]: {
1: 'año',
DEFAULT: 'años'
},
[TimeTypes.Month]: {
1: 'mes',
DEFAULT: 'meses'
},
[TimeTypes.Week]: {
1: 'semana',
DEFAULT: 'semanas'
},
[TimeTypes.Day]: {
1: 'día',
DEFAULT: 'días'
},
[TimeTypes.Hour]: {
1: 'hora',
DEFAULT: 'horas'
},
[TimeTypes.Minute]: {
1: 'minuto',
DEFAULT: 'minutos'
},
[TimeTypes.Second]: {
1: 'segundo',
DEFAULT: 'segundos'
}
}
});
}
}
10 changes: 4 additions & 6 deletions src/languages/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import type { Handler } from '#lib/i18n/structures/Handler';
import { ExtendedHandler as DeDeHandler } from '#root/languages/de-DE/constants';
import { ExtendedHandler as DeHandler } from '#root/languages/de/constants';
import { ExtendedHandler as EnGbHandler } from '#root/languages/en-GB/constants';
import { ExtendedHandler as EnUsHandler } from '#root/languages/en-US/constants';
import { ExtendedHandler as EsEsHandler } from '#root/languages/es-ES/constants';
import { ExtendedHandler as NbNoHandler } from '#root/languages/nb-NO/constants';
import { ExtendedHandler as NlNlHandler } from '#root/languages/nl-NL/constants';
import { ExtendedHandler as NlHandler } from '#root/languages/nl/constants';

export const handlers = new Map<string, Handler>([
['de-DE', new DeDeHandler()],
['de', new DeHandler()],
['en-US', new EnUsHandler()],
['en-GB', new EnGbHandler()],
['es-ES', new EsEsHandler()],
['nb-NO', new NbNoHandler()],
['nl-NL', new NlNlHandler()]
['nl', new NlHandler()]
]);

export function getHandler(name: string): Handler {
Expand Down
40 changes: 40 additions & 0 deletions src/languages/nl/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Handler } from '#lib/i18n/structures/Handler';
import { TimeTypes } from '@sapphire/time-utilities';

export class ExtendedHandler extends Handler {
public constructor() {
super({
name: 'nl',
duration: {
[TimeTypes.Year]: {
1: 'jaar',
DEFAULT: 'jaren'
},
[TimeTypes.Month]: {
1: 'maand',
DEFAULT: 'maanden'
},
[TimeTypes.Week]: {
1: 'week',
DEFAULT: 'weken'
},
[TimeTypes.Day]: {
1: 'dag',
DEFAULT: 'dagen'
},
[TimeTypes.Hour]: {
1: 'uur',
DEFAULT: 'uren'
},
[TimeTypes.Minute]: {
1: 'minuut',
DEFAULT: 'minuten'
},
[TimeTypes.Second]: {
1: 'seconde',
DEFAULT: 'seconden'
}
}
});
}
}

0 comments on commit 88d0d12

Please sign in to comment.