mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-31 23:53:25 +00:00
fix home link for english
This commit is contained in:
@@ -189,9 +189,6 @@ export function isSafari() {
|
|||||||
|
|
||||||
export function getURLForLanguage(lang: string | null | undefined, path: string): string {
|
export function getURLForLanguage(lang: string | null | undefined, path: string): string {
|
||||||
let newPath = path.replace(base, '');
|
let newPath = path.replace(base, '');
|
||||||
if (newPath === '/') {
|
|
||||||
newPath = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
let languageInPath = newPath.split('/')[1];
|
let languageInPath = newPath.split('/')[1];
|
||||||
if (!languages.hasOwnProperty(languageInPath)) {
|
if (!languages.hasOwnProperty(languageInPath)) {
|
||||||
@@ -205,6 +202,10 @@ export function getURLForLanguage(lang: string | null | undefined, path: string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newPath === '/' && lang !== 'en') {
|
||||||
|
newPath = '';
|
||||||
|
}
|
||||||
|
|
||||||
if (languageInPath === 'en') {
|
if (languageInPath === 'en') {
|
||||||
if (lang === 'en') {
|
if (lang === 'en') {
|
||||||
return `${base}${newPath}`;
|
return `${base}${newPath}`;
|
||||||
|
Reference in New Issue
Block a user