aboutsummaryrefslogtreecommitdiff
path: root/resources/vue-gettext.d.ts
blob: f24827c4262b6904a20cb711d89c403cea27590a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
declare module "vue-gettext" {
    import GettextPlugin from 'vue-gettext';

    interface StringDict {
        [key: string]: string;
    }

    type TranslationDict = StringDict;

    interface TranslationDicts {
        [key: string]: TranslationDict | null;
    }

    interface gettextConfig {
        getTextPluginMuteLanguages: string[],
        getTextPluginSilent: boolean,
        language: string,
        silent: boolean
    }

    declare namespace translate {
        function getTranslation(msgid: string, n?: number, context?: string, defaultPlural?: string, language?: string): string;
        function gettext(msgid: string, language?: string): string;
        function pgettext(context: string, msgid: string, language?: string): string;
        function ngettext(msgid: string, plural: string, n: number, language?: string): string;
        function npgettext(context: string, msgid: string, plural: string, n: number, language?: string): string;
        function initTranslations(translations: TranslationDicts, config: gettextConfig): void;
        function gettextInterpolate(message: string, context: object, disableHtmlEscaping?: boolean): string;
    }

    export { translate, StringDict, TranslationDict, TranslationDicts };

    export default GettextPlugin;
}