1 | import { TranslateService } from "./translate.service";
|
2 | export interface MissingTranslationHandlerParams {
|
3 | /**
|
4 | * the key that's missing in translation files
|
5 | */
|
6 | key: string;
|
7 | /**
|
8 | * an instance of the service that was unable to translate the key.
|
9 | */
|
10 | translateService: TranslateService;
|
11 | /**
|
12 | * interpolation params that were passed along for translating the given key.
|
13 | */
|
14 | interpolateParams?: Object;
|
15 | }
|
16 | export declare abstract class MissingTranslationHandler {
|
17 | /**
|
18 | * A function that handles missing translations.
|
19 | *
|
20 | * @param params context for resolving a missing translation
|
21 | * @returns a value or an observable
|
22 | * If it returns a value, then this value is used.
|
23 | * If it return an observable, the value returned by this observable will be used (except if the method was "instant").
|
24 | * If it doesn't return then the key will be used as a value
|
25 | */
|
26 | abstract handle(params: MissingTranslationHandlerParams): any;
|
27 | }
|
28 | /**
|
29 | * This handler is just a placeholder that does nothing, in case you don't need a missing translation handler at all
|
30 | */
|
31 | export declare class FakeMissingTranslationHandler implements MissingTranslationHandler {
|
32 | handle(params: MissingTranslationHandlerParams): string;
|
33 | }
|