diff --git a/src/components/ui/LanguagePicker.astro b/src/components/ui/LanguagePicker.astro index 3e3f1d3..b50c20c 100644 --- a/src/components/ui/LanguagePicker.astro +++ b/src/components/ui/LanguagePicker.astro @@ -74,29 +74,10 @@ import Icon from "./icons/Icon.astro"; // Disable the selection of the same language if (lang === url.pathname.split("/")[1]) return; - // If on product detail page, adjust the slug - if (url.pathname.includes("/products/")) { - let productSlug = pathParts[pathParts.length - 1]; // Get the last part of the URL which is the slug - - if (lang === "fr") { - // If switching to French, ensure the slug has "-fr" - if (!productSlug.endsWith("-fr")) { - productSlug += "-fr"; - } - } else { - // If switching to English, remove "-fr" from the slug - if (productSlug.endsWith("-fr")) { - productSlug = productSlug.replace("-fr", ""); - } - } - - // Update the last part of the path with the adjusted slug - pathParts[pathParts.length - 1] = productSlug; - } - if ( url.pathname.includes("/post") || - url.pathname.includes("/insight") + url.pathname.includes("/insight") || + url.pathname.includes("/products") ) { if (url.pathname.includes("en")) { pathParts.unshift(lang); diff --git a/src/content/products/en/a765.md b/src/content/products/en/a765.md index a09ddeb..89cfc13 100644 --- a/src/content/products/en/a765.md +++ b/src/content/products/en/a765.md @@ -51,5 +51,4 @@ tableData: blueprints: first: "@/images/blueprint-1.avif" second: "@/images/blueprint-2.avif" -slug: a765 --- diff --git a/src/content/products/en/b203.md b/src/content/products/en/b203.md index 0a298bc..9455370 100644 --- a/src/content/products/en/b203.md +++ b/src/content/products/en/b203.md @@ -51,6 +51,5 @@ specificationsRight: subTitle: "Ideal for a wide array of uses, from construction environments to mechanical assemblies that demand strong and secure joints." blueprints: first: "@/images/blueprint-1.avif" - second: "@/images/blueprint-2.avif" -slug: b203 + second: "@/images/blueprint-2.avif" --- diff --git a/src/content/products/en/f303.md b/src/content/products/en/f303.md index b83e7fe..8c70e9d 100644 --- a/src/content/products/en/f303.md +++ b/src/content/products/en/f303.md @@ -51,6 +51,5 @@ specificationsRight: subTitle: "Ideal for use in construction, machinery, automotive, and other heavy-duty applications that demand strong and reliable fastening." blueprints: first: "@/images/blueprint-1.avif" - second: "@/images/blueprint-2.avif" -slug: f303 + second: "@/images/blueprint-2.avif" --- diff --git a/src/content/products/en/t845.md b/src/content/products/en/t845.md index 9d0f409..dcf35cc 100644 --- a/src/content/products/en/t845.md +++ b/src/content/products/en/t845.md @@ -51,6 +51,5 @@ specificationsRight: subTitle: "Ideal for use in a wide range of industrial machinery, equipment, and assemblies that demand precise and secure fastening." blueprints: first: "@/images/blueprint-1.avif" - second: "@/images/blueprint-2.avif" -slug: t845 + second: "@/images/blueprint-2.avif" --- diff --git a/src/content/products/fr/a765.md b/src/content/products/fr/a765.md index f1c7657..1770797 100644 --- a/src/content/products/fr/a765.md +++ b/src/content/products/fr/a765.md @@ -51,5 +51,4 @@ tableData: blueprints: first: "@/images/blueprint-1.avif" second: "@/images/blueprint-2.avif" -slug: a765-fr --- diff --git a/src/content/products/fr/b203.md b/src/content/products/fr/b203.md index c332d71..254d696 100644 --- a/src/content/products/fr/b203.md +++ b/src/content/products/fr/b203.md @@ -52,5 +52,4 @@ specificationsRight: blueprints: first: "@/images/blueprint-1.avif" second: "@/images/blueprint-2.avif" -slug: b203-fr --- diff --git a/src/content/products/fr/f303.md b/src/content/products/fr/f303.md index db99cb4..2baa88b 100644 --- a/src/content/products/fr/f303.md +++ b/src/content/products/fr/f303.md @@ -51,6 +51,5 @@ specificationsRight: subTitle: "Idéal pour une utilisation dans la construction, les machines, l'automobile et d'autres applications lourdes nécessitant une fixation solide et fiable." blueprints: first: "@/images/blueprint-1.avif" - second: "@/images/blueprint-2.avif" -slug: f303-fr + second: "@/images/blueprint-2.avif" --- diff --git a/src/content/products/fr/t845.md b/src/content/products/fr/t845.md index 636a1d9..03ccd2a 100644 --- a/src/content/products/fr/t845.md +++ b/src/content/products/fr/t845.md @@ -51,6 +51,5 @@ specificationsRight: subTitle: "Idéal pour une utilisation dans une large gamme de machines industrielles, équipements et assemblages nécessitant une fixation précise et sécurisée." blueprints: first: "@/images/blueprint-1.avif" - second: "@/images/blueprint-2.avif" -slug: t845-fr + second: "@/images/blueprint-2.avif" ---