@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
31 lines (30 loc) • 1.12 kB
TypeScript
export declare class Language {
private readonly supportedLocales;
readonly locale: string;
readonly languageCode: string;
translations: Record<string, string>;
readonly customTranslations: any;
loaded: Promise<any>;
constructor(locale?: string, customTranslations?: object);
/**
* Returns a translated string from a key in the current {@link Language.locale}
* @param key - Translation key
* @param options - Translation options
* @returns Translated string
*/
get(key: string, options?: any): string;
/**
* Returns a localized string for an amount
* @param amount - Amount to be converted
* @param currencyCode - Currency code of the amount
* @param options - Options for String.prototype.toLocaleString
*/
amount(amount: number, currencyCode: string, options?: object): string;
/**
* Returns a localized string for a date
* @param date - Date to be localized
* @param options - Options for {@link Date.toLocaleDateString}
*/
date(date: string, options?: object): string;
}
export default Language;