mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-18 00:33:15 +00:00
Merge pull request #1784 from RoboSats/fix-portuguese-urls
Fix portuguese urls
This commit is contained in:
@ -4,7 +4,7 @@ function matchPageWithSelection(language, currentUrl){
|
|||||||
// checks if parameter is 'en', if so, removes it from the url
|
// checks if parameter is 'en', if so, removes it from the url
|
||||||
newLanguage = language === 'en' ? '' : `${language}`;
|
newLanguage = language === 'en' ? '' : `${language}`;
|
||||||
// regex to match the current url and extract the language and the rest of the url
|
// regex to match the current url and extract the language and the rest of the url
|
||||||
let regex = /(?:(?:(\/(?:docs|contribute|stats)\/))(?:(es|fr)\/)?(.*))|(\/(?:es|fr|pt)\/|\/)$/
|
let regex = /(?:(?:(\/(?:docs|contribute|stats)\/))(?:(es|fr|pt)\/)?(.*))|(\/(?:es|fr|pt)\/|\/)$/
|
||||||
let [fullURL, first, urlLang = 'en', rest, home] = regex.exec(currentUrl);
|
let [fullURL, first, urlLang = 'en', rest, home] = regex.exec(currentUrl);
|
||||||
|
|
||||||
if (home) {
|
if (home) {
|
||||||
|
Reference in New Issue
Block a user