UNPKG

1.05 kBTypeScriptView Raw
1/**
2 * Gets the language set for the page.
3 * @param persistenceType - Where to persist the value. Default is `localStorage` if available.
4 * (In version 8, the default will be `sessionStorage`.)
5 */
6export declare function getLanguage(persistenceType?: 'localStorage' | 'sessionStorage' | 'none'): string | null;
7/**
8 * Sets the language for the page (by adjusting the lang attribute of the html element).
9 * @param language - Language to set.
10 * @param persistenceType - Where to persist the value. Default is `localStorage` if available.
11 * (In version 8, the default will be `sessionStorage`.)
12 */
13export declare function setLanguage(language: string, persistenceType?: 'localStorage' | 'sessionStorage' | 'none'): void;
14/**
15 * Sets the language for the page (by adjusting the lang attribute of the html element).
16 * @deprecated Use string parameter version.
17 * @param language - Language to set.
18 * @param avoidPersisting - If true, don't store the value.
19 */
20export declare function setLanguage(language: string, avoidPersisting?: boolean): void;