import { I18n } from "https://deno.land/x/grammy_i18n@v1.1.0/mod.ts";
Constructors
new
I18n(config: Partial<I18nConfig<C>>)Methods
loadLocale(locale: LocaleId, options: LoadLocaleOptions): Promise<void>
Registers a locale in the Fluent instance based on the provided options.
loadLocalesDir(directory: string): Promise<void>
Loads locales from the specified directory and registers them in the Fluent instance.
loadLocalesDirSync(directory: string): void
Loads locales from any existing nested file or folder within the specified directory and registers them in the Fluent instance.
loadLocaleSync(locale: LocaleId, options: LoadLocaleOptions): void
Synchronously registers a locale in the Fluent instance based on the provided options.
middleware(): MiddlewareFn<C & I18nFlavor>
Returns a middleware to .use on the Bot
instance.
t<K extends string>(): string
Gets a message by its key from the specified locale.
Alias of translate
.
translate<K extends string>(): string
Gets a message by its key from the specified locale.