Skip to main content
Module

x/grammy_i18n/fluent.ts>Fluent

Internationalization for grammY powered by Fluent.
Latest
class Fluent
import { Fluent } from "https://deno.land/x/grammy_i18n@v1.0.2/fluent.ts";

Constructors

new
Fluent(options?: FluentOptions)

Properties

private
readonly
bundles: Set<FluentBundle>
private
optional
defaultBundle: FluentBundle
private
handleWarning: WarningHandler

Methods

private
addBundle(options: AddTranslationOptions, source: string)
private
createBundle(
locales: MaybeArray<LocaleId>,
source: string,
bundleOptions?: FluentBundleOptions,
): FluentBundle
private
matchBundles(locales: LocaleId[]): Set<FluentBundle>
addTranslation(options: AddTranslationOptions): Promise<void>
translate<K extends string>(
localeOrLocales: MaybeArray<LocaleId>,
path: string,
context?: TranslationVariables<K>,
): string
withLocale(localeOrLocales: MaybeArray<LocaleId>)

Returns translation function bound to the specified locale(s).