UNPKG

stackpress

Version:

Incept is a content management framework.

25 lines (24 loc) 950 B
import type Request from '@stackpress/ingest/Request'; import type Response from '@stackpress/ingest/Response'; import type { Scalar } from '../types/index.js'; import type { LanguageMap } from './types.js'; export default class Language { protected static _key: string; protected static _languages: LanguageMap; static get locales(): string[]; static get key(): string; static configure(key: string, languages: LanguageMap): typeof Language; static language(name: string): { label: string; translations: Record<string, string>; } | null; static load(req: Request, defaults?: string): Language; protected _locale: string; get label(): string; get locale(): string; get translations(): Record<string, string>; set locale(locale: string); save(res: Response): this; update(locale: string, res: Response): this; translate(phrase: string, ...variables: Scalar[]): string; }