Skip to content

Commit b22a889

Browse files
committed
redirect to the language url and added sitemap.xml
1 parent f843fa4 commit b22a889

File tree

2 files changed

+105
-5
lines changed

2 files changed

+105
-5
lines changed

public/sitemap.xml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
3+
xmlns:xhtml="http://www.w3.org/1999/xhtml">
4+
<url>
5+
<loc>http://www.lunatech.com/</loc>
6+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
7+
<xhtml:link
8+
rel="alternate"
9+
hreflang="fr"
10+
href="http://www.lunatech.fr"/>
11+
</url>
12+
<url>
13+
<loc>http://www.lunatech.com/expertises</loc>
14+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
15+
</url>
16+
<url>
17+
<loc>http://www.lunatech.com/expertises/strategic-expertise</loc>
18+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
19+
</url>
20+
<url>
21+
<loc>http://www.lunatech.com/expertises/software-defined-vehicle</loc>
22+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
23+
</url>
24+
<url>
25+
<loc>http://www.lunatech.com/expertises/software-project-delivery</loc>
26+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
27+
</url>
28+
<url>
29+
<loc>http://www.lunatech.com/expertises/system-integration</loc>
30+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
31+
</url>
32+
<url>
33+
<loc>http://www.lunatech.com/expertises/legacy-modernisation</loc>
34+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
35+
</url>
36+
<url>
37+
<loc>http://www.lunatech.com/about</loc>
38+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
39+
</url>
40+
<url>
41+
<loc>http://www.lunatech.com/partners</loc>
42+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
43+
</url>
44+
<url>
45+
<loc>http://www.lunatech.com/open-source</loc>
46+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
47+
</url>
48+
<url>
49+
<loc>http://www.lunatech.com/technologies</loc>
50+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
51+
</url>
52+
<url>
53+
<loc>http://www.lunatech.fr</loc>
54+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
55+
<xhtml:link
56+
rel="alternate"
57+
hreflang="en"
58+
href="http://www.lunatech.com"/>
59+
</url>
60+
<url>
61+
<loc>http://www.lunatech.fr/expertises</loc>
62+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
63+
</url>
64+
<url>
65+
<loc>http://www.lunatech.fr/expertises/strategic-expertise</loc>
66+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
67+
</url>
68+
<url>
69+
<loc>http://www.lunatech.fr/expertises/software-defined-vehicle</loc>
70+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
71+
</url>
72+
<url>
73+
<loc>http://www.lunatech.fr/expertises/software-project-delivery</loc>
74+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
75+
</url>
76+
<url>
77+
<loc>http://www.lunatech.fr/expertises/system-integration</loc>
78+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
79+
</url>
80+
<url>
81+
<loc>http://www.lunatech.fr/expertises/legacy-modernisation</loc>
82+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
83+
</url>
84+
<url>
85+
<loc>http://www.lunatech.fr/about</loc>
86+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
87+
</url>
88+
<url>
89+
<loc>http://www.lunatech.fr/partners</loc>
90+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
91+
</url>
92+
<url>
93+
<loc>http://www.lunatech.fr/open-source</loc>
94+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
95+
</url>
96+
<url>
97+
<loc>http://www.lunatech.fr/technologies</loc>
98+
<lastmod>2024-09-02T20:03:10+00:00</lastmod>
99+
</url>
100+
</urlset>

src/components/Language/Language.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import i18n from '../../i18n';
33
//import { useTranslation } from 'react-i18next';
4-
import { useNavigate } from 'react-router-dom';
4+
import { redirect, useNavigate } from 'react-router-dom';
55

66
import "./Language.scss";
77

@@ -19,16 +19,16 @@ const Language: React.FC<LanguageProps> = ({ changeLanguage }) => {
1919
const handleLanguageChange = (lng: string) => {
2020
changeLanguage(lng);
2121

22-
const currentPath = window.location.pathname;
22+
const currentPath = window.location.href;
2323
let newUrl = '';
2424

2525
if (lng === 'fr') {
26-
newUrl = currentPath.replace('myapp1', 'myapp2');
26+
newUrl = currentPath.replace('\.fr', '\.com');
2727
} else {
28-
newUrl = currentPath.replace('myapp2', 'myapp1');
28+
newUrl = currentPath.replace('\.com', '\.fr');
2929
}
3030

31-
navigate(newUrl);
31+
redirect(newUrl);
3232
};
3333

3434
return (

0 commit comments

Comments
 (0)