mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-31 23:53:25 +00:00
fix home link for languages other than english
This commit is contained in:
@@ -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';
|
||||||
|
Reference in New Issue
Block a user