Prevent adding extra `/` when concatenating locale paths (#2665)
* Formatting the locales pathname to be more accurate Before this change, the URL would refer `https://localhost//static/locales/${locale}.json` which technically works in most web browsers, but it does not work in Cordova at all, so this changes the links to be more accurately: `https://localhost/static/locales/${locale}.json` * Removing usage of `path` because it requires a polyfill/shim * Linting the code
This commit is contained in:
parent
a621c83a90
commit
f722340962
|
@ -60,7 +60,7 @@ class CustomVueI18n extends VueI18n {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.pathname) {
|
if (url.pathname) {
|
||||||
url.pathname += `/static/locales/${locale}.json`
|
url.pathname += `${!url.pathname.endsWith('/') ? '/' : ''}static/locales/${locale}.json`
|
||||||
} else {
|
} else {
|
||||||
url.pathname = `/static/locales/${locale}.json`
|
url.pathname = `/static/locales/${locale}.json`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue