@lovalingo/lovalingo 0.0.17 → 0.0.19
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.
|
@@ -586,11 +586,17 @@ navigateRef, // For path mode routing
|
|
|
586
586
|
if (isAssetPath(url.pathname))
|
|
587
587
|
return null;
|
|
588
588
|
const parts = url.pathname.split('/').filter(Boolean);
|
|
589
|
-
|
|
590
|
-
|
|
589
|
+
// Root ("/") should be locale-prefixed too (e.g. clicking a logo linking to "https://example.com")
|
|
590
|
+
// when we are currently on a locale URL like "/de/...".
|
|
591
|
+
if (parts.length === 0) {
|
|
592
|
+
return `/${locale}${url.search}${url.hash}`;
|
|
593
|
+
}
|
|
591
594
|
if (supportedLocales.includes(parts[0]))
|
|
592
595
|
return null; // already locale-prefixed
|
|
593
|
-
const
|
|
596
|
+
const pathWithoutLeadingSlashes = url.pathname.replace(/^\/+/, '');
|
|
597
|
+
const nextPathname = pathWithoutLeadingSlashes
|
|
598
|
+
? `/${locale}/${pathWithoutLeadingSlashes}`
|
|
599
|
+
: `/${locale}`;
|
|
594
600
|
return `${nextPathname}${url.search}${url.hash}`;
|
|
595
601
|
};
|
|
596
602
|
const ORIGINAL_HREF_KEY = 'data-Lovalingo-href-original';
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.0.
|
|
1
|
+
export declare const VERSION = "0.0.19";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.0.
|
|
1
|
+
export const VERSION = "0.0.19";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovalingo/lovalingo",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "React translation library with automatic routing, real-time AI translation, and zero-flash rendering. One-line language routing setup.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|