@nuxtjs/i18n-edge 8.3.0-28536559.8961513 → 8.3.0-28556299.6dcbfbb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -2,6 +2,7 @@ import { unref, useNuxtApp, useRuntimeConfig } from "#imports";
|
|
|
2
2
|
import { getComposer, getLocale, getLocales, getNormalizedLocales } from "../utils.mjs";
|
|
3
3
|
import { getRouteBaseName, localeRoute, switchLocalePath } from "./routing.mjs";
|
|
4
4
|
import { isArray, isObject } from "@intlify/shared";
|
|
5
|
+
import { joinURL } from "ufo";
|
|
5
6
|
export function localeHead(common, {
|
|
6
7
|
addDirAttribute = false,
|
|
7
8
|
addSeoAttributes: seoAttributes = true,
|
|
@@ -44,8 +45,9 @@ export function localeHead(common, {
|
|
|
44
45
|
return metaObject;
|
|
45
46
|
}
|
|
46
47
|
function getBaseUrl() {
|
|
47
|
-
const
|
|
48
|
-
|
|
48
|
+
const nuxtApp = useNuxtApp();
|
|
49
|
+
const i18n = getComposer(nuxtApp.$i18n);
|
|
50
|
+
return joinURL(unref(i18n.baseUrl), nuxtApp.$config.app.baseURL);
|
|
49
51
|
}
|
|
50
52
|
export function getHreflangLinks(common, locales, idAttribute) {
|
|
51
53
|
const baseUrl = getBaseUrl();
|
|
@@ -152,5 +154,5 @@ function hypenToUnderscore(str) {
|
|
|
152
154
|
function toAbsoluteUrl(urlOrPath, baseUrl) {
|
|
153
155
|
if (urlOrPath.match(/^https?:\/\//))
|
|
154
156
|
return urlOrPath;
|
|
155
|
-
return baseUrl
|
|
157
|
+
return joinURL(baseUrl, urlOrPath);
|
|
156
158
|
}
|
package/package.json
CHANGED