fix home link for english
This commit is contained in:
parent
1555799533
commit
25e05f9855
1 changed files with 4 additions and 3 deletions
|
@ -189,9 +189,6 @@ export function isSafari() {
|
|||
|
||||
export function getURLForLanguage(lang: string | null | undefined, path: string): string {
|
||||
let newPath = path.replace(base, '');
|
||||
if (newPath === '/') {
|
||||
newPath = '';
|
||||
}
|
||||
|
||||
let languageInPath = newPath.split('/')[1];
|
||||
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 (lang === 'en') {
|
||||
return `${base}${newPath}`;
|
||||
|
|
Loading…
Reference in a new issue