@odoo/o-spreadsheet
Version:
A spreadsheet component
22 lines (21 loc) • 1.11 kB
TypeScript
type SprintfValues = (string | String | number)[] | [{
[key: string]: string | number;
}];
export type TranslationFunction = (string: string, ...values: SprintfValues) => string;
/***
* Allow to inject a translation function from outside o-spreadsheet. This should be called before instantiating
* a model.
* @param tfn the function that will do the translation
* @param loaded a function that returns true when the translation is loaded
*/
export declare function setTranslationMethod(tfn: TranslationFunction, loaded?: () => boolean): void;
/**
* If no translation function has been set, this will mark the translation are loaded.
*
* By default, the translations should not be set as loaded, otherwise top-level translated constants will never be
* translated. But if by the time the model is instantiated no custom translation function has been set, we can set
* the default translation function as loaded so o-spreadsheet can be run in standalone with no translations.
*/
export declare function setDefaultTranslationMethod(): void;
export declare const _t: TranslationFunction;
export {};