Skip to content

crelte / translations / TranslationsPlugin

Class: TranslationsPlugin ​

A plugin

Implements ​

Constructors ​

Constructor ​

ts
new TranslationsPlugin(crelte, opts): TranslationsPlugin;

Parameters ​

crelte ​

Crelte

opts ​

TranslationsPluginOptions

Returns ​

TranslationsPlugin

Accessors ​

name ​

Get Signature ​

ts
get name(): string;
Returns ​

string

Implementation of ​

Plugin.name

Methods ​

get() ​

ts
get(lang, namespace): Translations | null;

Parameters ​

lang ​

string

namespace ​

string

Returns ​

Translations | null


load() ​

ts
load(cr, namespace): Promise<Translations>;

load needs to take a CrelteRequest to be able to get the correct site and globals

in crelte 0.5 this should also be possible without a CrelteRequest but with multiple plugin instances / Request State plugins

Parameters ​

cr ​

CrelteRequest

namespace ​

string

Returns ​

Promise<Translations>