@rockpack/localazer
Version:
This module can help you organize localization in your React application
33 lines (32 loc) • 1.03 kB
TypeScript
import { Component } from 'react';
import { LocaleData } from './utils';
export interface LanguagesInterface {
[key: string]: LocaleData;
}
interface LocalizationObserverInterface {
currentLanguage: string;
defaultLanguage: string;
languages: LanguagesInterface;
defaultLocaleData?: LocaleData;
onChange?: (locale: string) => void;
children?: JSX.Element;
}
interface Components {
[key: number]: Component;
}
export declare const components: Components;
export declare const getID: () => number;
export default class LocalizationObserver extends Component<LocalizationObserverInterface> {
static defaultProps: {
currentLanguage: string;
defaultLanguage: string;
languages: {};
defaultLocaleData: any;
};
constructor(props: any);
componentDidUpdate(prevProps: any): void;
changeLocalization(locale: string): void;
updateComponents(localeData: any, locale: any): void;
render(): JSX.Element;
}
export {};