How to use the vue-i18n.useI18n function in vue-i18n

To help you get started, we’ve selected a few vue-i18n examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facette / facette / ui / src / components / grid / grid-item.vue View on Github external
setup(props: Record, ctx: SetupContext): Record {
        const i18n = useI18n();

        let locked = true;

        const onDrag = (ev: DragEvent): void => {
            switch (ev.type) {
                case "dragend":
                    ctx.emit("drag-item", null);
                    locked = true;

                    break;

                case "dragstart":
                    if (locked) {
                        ev.preventDefault();
                    } else {
                        ctx.emit("drag-item", props.index);
github facette / facette / ui / src / views / admin / info / info.vue View on Github external
setup(): Record {
        const i18n = useI18n();
        const store = useStore();
        const ui = useUI();

        const {erred, loading, onFetchRejected} = common;

        const version = ref(null);

        const apiOptions = computed(() => store.state.apiOptions);

        const getVersion = (): void => {
            store.commit("loading", true);

            api.version()
                .then(response => {
                    version.value = response.data ?? null;
                }, onFetchRejected)
github facette / facette / ui / src / views / admin / charts / sidebar.vue View on Github external
setup(): Record {
        const i18n = useI18n();
        const store = useStore();

        const {loading, prevRoute, sidebar} = common;

        const routeData = computed(() => store.state.routeData);

        return {
            i18n,
            loading,
            prevRoute,
            routeData,
            sidebar,
        };
    },
};
github facette / facette / ui / src / views / admin / database / database.vue View on Github external
setup(): Record {
        const i18n = useI18n();
        const store = useStore();
        const ui = useUI();

        const file = ref(null);

        const apiOptions = computed(() => store.state.apiOptions);

        const dump = (): void => {
            location.href = `${apiPrefix}/store`;
        };

        const restore = async (): Promise => {
            const curFile = file.value?.files?.[0];
            if (file.value === null || curFile === undefined) {
                throw Error("cannot get file");
            }
github facette / facette / ui / src / views / admin / charts / edit.vue View on Github external
setup(): Record {
        const i18n = useI18n();
        const router = useRouter();
        const store = useStore();
        const ui = useUI();

        const {
            applyRouteParams,
            beforeRoute,
            erred,
            loading,
            modifiers,
            onFetchRejected,
            prevRoute,
            routeGuarded,
            watchGuard,
            unwatchGuard,
        } = common;
github facette / facette / ui / src / components / modal / confirm.vue View on Github external
setup(): Record {
        const i18n = useI18n();

        const button = ref(cloneDeep(defaultParams.button));
        const message = ref(defaultParams.message);

        const onShow = (params: ModalConfirmParams): void => {
            button.value = merge({}, defaultParams.button, params.button);
            message.value = params.message;
        };

        return {
            button,
            i18n,
            message,
            onShow,
        };
    },
github facette / facette / ui / src / views / common / toolbar.vue View on Github external
setup(): Record {
        const i18n = useI18n();
        const ui = useUI();

        const {toggleSidebar} = common;

        const fullscreen = ref(false);

        const fullscreenSupport = computed((): boolean => document.fullscreenEnabled);

        const toggleFullscreen = (): void => {
            if (document.fullscreen) {
                document.exitFullscreen();
            } else {
                document.documentElement.requestFullscreen();
            }
        };
github facette / facette / ui / src / views / admin / charts / modal / series.vue View on Github external
setup(): Record {
        const i18n = useI18n();

        let checkTimeout: number | null = null;

        const edit = ref(false);
        const error = ref(null);
        const loadingMetrics = ref(false);
        const metricsCount = ref(null);
        const series = ref(cloneDeep(defaultSeries));

        const axes = ref>([
            {label: i18n.t("labels.charts.axes.left"), value: "left"},
            {label: i18n.t("labels.charts.axes.right"), value: "right"},
        ]);

        const checkExpr = async (value: string): Promise => {
            try {
github facette / facette / ui / src / views / admin / providers / form / prometheus.vue View on Github external
setup(props: Record): Record {
        const i18n = useI18n();

        const secured = computed(() => {
            return Boolean(((props.settings.url ?? "") as string).startsWith("https://"));
        });

        return {
            i18n,
            secured,
        };
    },
};
github facette / facette / ui / src / views / admin / charts / form / yaxis.vue View on Github external
setup(): Record {
        const i18n = useI18n();

        return {
            i18n,
        };
    },
};

vue-i18n

Internationalization plugin for Vue.js

MIT
Latest version published 2 months ago

Package Health Score

95 / 100
Full package analysis