fix home link for languages other than english
This commit is contained in:
parent
de38fea917
commit
93d5211d27
1 changed files with 4 additions and 0 deletions
|
@ -189,6 +189,10 @@ 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)) {
|
||||||
languageInPath = 'en';
|
languageInPath = 'en';
|
||||||
|
|
Loading…
Reference in a new issue