@@ -4,7 +4,7 @@ import { DecoratorIdentifiers } from '@sapphire/decorators';
44import { Identifiers , container } from '@sapphire/framework' ;
55import type { InternationalizationContext , TFunction } from '@sapphire/plugin-i18next' ;
66import type { Nullish } from '@sapphire/utilities' ;
7- import type { Interaction , LocaleString } from 'discord.js' ;
7+ import type { Interaction , Locale } from 'discord.js' ;
88
99export function translate ( identifier : string ) : string {
1010 switch ( identifier ) {
@@ -120,11 +120,11 @@ export function resolveT(t: TResolvable): TFunction {
120120 * @param locale The locale to get the translation function for.
121121 * @returns The translation function for the specified locale.
122122 */
123- export function getT ( locale ?: LocaleString | string | Nullish ) {
123+ export function getT ( locale ?: Locale | string | Nullish ) {
124124 return container . i18n . getT ( locale ?? 'en-US' ) ;
125125}
126126
127- export function getSupportedLanguageName ( interaction : Interaction ) : LocaleString {
127+ export function getSupportedLanguageName ( interaction : Interaction ) : Locale {
128128 if ( interaction . guildLocale && container . i18n . languages . has ( interaction . guildLocale ) ) return interaction . guildLocale ;
129129 return 'en-US' ;
130130}
@@ -133,7 +133,7 @@ export function getSupportedLanguageT(interaction: Interaction): TFunction {
133133 return getT ( getSupportedLanguageName ( interaction ) ) ;
134134}
135135
136- export function getSupportedUserLanguageName ( interaction : Interaction ) : LocaleString {
136+ export function getSupportedUserLanguageName ( interaction : Interaction ) : Locale {
137137 if ( container . i18n . languages . has ( interaction . locale ) ) return interaction . locale ;
138138 return getSupportedLanguageName ( interaction ) ;
139139}
@@ -146,10 +146,10 @@ export function getSupportedUserLanguageT(interaction: Interaction): TFunction {
146146 * Fetches the language for the given {@link InternationalizationContext}.
147147 * If the language cannot be fetched, defaults to 'en-US'.
148148 * @param context The InternationalizationContext to fetch the language for.
149- * @returns The fetched language as a {@link LocaleString }.
149+ * @returns The fetched language as a {@link Locale }.
150150 */
151151export async function fetchLanguage ( context : InternationalizationContext ) {
152- return ( await container . i18n . fetchLanguage ( context ) ) ! as LocaleString ;
152+ return ( await container . i18n . fetchLanguage ( context ) ) ! as Locale ;
153153}
154154
155155/**
0 commit comments