piral-translate
Version:
Plugin for providing translated messages in Piral.
15 lines (14 loc) • 615 B
TypeScript
import type { GlobalStateContext } from 'piral-core';
import { Localizable } from './types';
export declare function createActions(localizer: Localizable): {
selectLanguage(ctx: GlobalStateContext, selected: string): void;
translate(_: GlobalStateContext, key: string, variables: any): string;
setTranslations(ctx: GlobalStateContext, language: string, data: any): void;
getTranslations(ctx: GlobalStateContext, language: string): {
global: import("./types").Translations;
locals: {
name: string;
value: import("./types").Translations;
}[];
};
};