���Root Mod By V1rus_Alfa
User / IP
:
216.73.216.158
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
node_modules
/
@nuxtjs
/
i18n
/
dist
/
runtime
/
routing
/
extends
/
Viewing: i18n.js
import { isObject, isFunction, assign } from "@intlify/shared"; import { computed, effectScope, ref, watch } from "#imports"; import { resolveBaseUrl, isVueI18n, getComposer, inBrowser } from "../utils.js"; import { getRouteBaseName, localeHead, localeLocation, localePath, localeRoute, resolveRoute, switchLocalePath } from "../compatibles/index.js"; import { wrapComposable } from "../../internal.js"; import { initCommonComposableOptions } from "../../utils.js"; export function extendI18n(i18n, { locales = [], localeCodes = [], baseUrl = "", hooks = {}, context = {} } = {}) { const scope = effectScope(); const orgInstall = i18n.install; i18n.install = (vue, ...options) => { const pluginOptions = isPluginOptions(options[0]) ? assign({}, options[0]) : { inject: true }; if (pluginOptions.inject == null) { pluginOptions.inject = true; } const orgComposerExtend = pluginOptions.__composerExtend; pluginOptions.__composerExtend = (localComposer) => { const globalComposer2 = getComposer(i18n); localComposer.locales = computed(() => globalComposer2.locales.value); localComposer.localeCodes = computed(() => globalComposer2.localeCodes.value); localComposer.baseUrl = computed(() => globalComposer2.baseUrl.value); let orgComposerDispose; if (isFunction(orgComposerExtend)) { orgComposerDispose = Reflect.apply(orgComposerExtend, pluginOptions, [localComposer]); } return () => { orgComposerDispose && orgComposerDispose(); }; }; if (i18n.mode === "legacy") { const orgVueI18nExtend = pluginOptions.__vueI18nExtend; pluginOptions.__vueI18nExtend = (vueI18n) => { extendVueI18n(vueI18n, hooks.onExtendVueI18n); let orgVueI18nDispose; if (isFunction(orgVueI18nExtend)) { orgVueI18nDispose = Reflect.apply(orgVueI18nExtend, pluginOptions, [vueI18n]); } return () => { orgVueI18nDispose && orgVueI18nDispose(); }; }; } options[0] = pluginOptions; Reflect.apply(orgInstall, i18n, [vue, ...options]); const globalComposer = getComposer(i18n); scope.run(() => { extendComposer(globalComposer, { locales, localeCodes, baseUrl, hooks, context }); if (i18n.mode === "legacy" && isVueI18n(i18n.global)) { extendVueI18n(i18n.global, hooks.onExtendVueI18n); } }); const app = vue; const exported = i18n.mode === "composition" ? app.config.globalProperties.$i18n : null; if (exported) { extendExportedGlobal(exported, globalComposer, hooks.onExtendExportedGlobal); } if (pluginOptions.inject) { const common = initCommonComposableOptions(i18n); vue.mixin({ methods: { getRouteBaseName: wrapComposable(getRouteBaseName, common), resolveRoute: wrapComposable(resolveRoute, common), localePath: wrapComposable(localePath, common), localeRoute: wrapComposable(localeRoute, common), localeLocation: wrapComposable(localeLocation, common), switchLocalePath: wrapComposable(switchLocalePath, common), localeHead: wrapComposable(localeHead, common) } }); } if (app.unmount) { const unmountApp = app.unmount; app.unmount = () => { scope.stop(); unmountApp(); }; } }; return scope; } function extendComposer(composer, options) { const { locales, localeCodes, baseUrl, context } = options; const _locales = ref(locales); const _localeCodes = ref(localeCodes); const _baseUrl = ref(""); composer.locales = computed(() => _locales.value); composer.localeCodes = computed(() => _localeCodes.value); composer.baseUrl = computed(() => _baseUrl.value); if (inBrowser) { watch( composer.locale, () => { _baseUrl.value = resolveBaseUrl(baseUrl, context); }, { immediate: true } ); } else { _baseUrl.value = resolveBaseUrl(baseUrl, context); } if (options.hooks && options.hooks.onExtendComposer) { options.hooks.onExtendComposer(composer); } } function extendPropertyDescriptors(composer, exported, hook) { const properties = [ { locales: { get() { return composer.locales.value; } }, localeCodes: { get() { return composer.localeCodes.value; } }, baseUrl: { get() { return composer.baseUrl.value; } } } ]; hook && properties.push(hook(composer)); for (const property of properties) { for (const [key, descriptor] of Object.entries(property)) { Object.defineProperty(exported, key, descriptor); } } } function extendExportedGlobal(exported, g, hook) { extendPropertyDescriptors(g, exported, hook); } function extendVueI18n(vueI18n, hook) { const c = getComposer(vueI18n); extendPropertyDescriptors(c, vueI18n, hook); } function isPluginOptions(options) { return isObject(options) && ("inject" in options || "__composerExtend" in options || "__vueI18nExtend" in options); }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa