mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-02 19:01:21 +01:00
Merge pull request #574 from hyperstown/main
Fix userLocales is undefined
This commit is contained in:
1 file changed
+6
-4
@@ -2,7 +2,7 @@
|
|||||||
// @name Return YouTube Dislike
|
// @name Return YouTube Dislike
|
||||||
// @namespace https://www.returnyoutubedislike.com/
|
// @namespace https://www.returnyoutubedislike.com/
|
||||||
// @homepage https://www.returnyoutubedislike.com/
|
// @homepage https://www.returnyoutubedislike.com/
|
||||||
// @version 3.0.0
|
// @version 3.0.1
|
||||||
// @encoding utf-8
|
// @encoding utf-8
|
||||||
// @description Return of the YouTube Dislike, Based off https://www.returnyoutubedislike.com/
|
// @description Return of the YouTube Dislike, Based off https://www.returnyoutubedislike.com/
|
||||||
// @icon https://github.com/Anarios/return-youtube-dislike/raw/main/Icons/Return%20Youtube%20Dislike%20-%20Transparent.png
|
// @icon https://github.com/Anarios/return-youtube-dislike/raw/main/Icons/Return%20Youtube%20Dislike%20-%20Transparent.png
|
||||||
@@ -441,7 +441,9 @@ function numberFormat(numberState) {
|
|||||||
?.find((n) => n?.getAttribute("href")?.includes("?locale="))
|
?.find((n) => n?.getAttribute("href")?.includes("?locale="))
|
||||||
?.getAttribute("href")
|
?.getAttribute("href")
|
||||||
)?.searchParams?.get("locale");
|
)?.searchParams?.get("locale");
|
||||||
} catch {}
|
} catch {
|
||||||
|
userLocales = document.documentElement.lang;
|
||||||
|
}
|
||||||
|
|
||||||
let numberDisplay;
|
let numberDisplay;
|
||||||
if (extConfig.numberDisplayRoundDown === false) {
|
if (extConfig.numberDisplayRoundDown === false) {
|
||||||
@@ -449,12 +451,12 @@ function numberFormat(numberState) {
|
|||||||
} else {
|
} else {
|
||||||
numberDisplay = roundDown(numberState);
|
numberDisplay = roundDown(numberState);
|
||||||
}
|
}
|
||||||
return getNumberFormatter(extConfig.numberDisplayFormat).format(
|
return getNumberFormatter(extConfig.numberDisplayFormat, userLocales).format(
|
||||||
numberDisplay
|
numberDisplay
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNumberFormatter(optionSelect) {
|
function getNumberFormatter(optionSelect, userLocales) {
|
||||||
let formatterNotation;
|
let formatterNotation;
|
||||||
let formatterCompactDisplay;
|
let formatterCompactDisplay;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user