Skip to content

Commit f2a6682

Browse files
Try log
1 parent 57456eb commit f2a6682

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/javascript/translate.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,19 @@ document.addEventListener("DOMContentLoaded", function () {
8080
}
8181

8282
document.querySelectorAll("a").forEach((link) => {
83-
if (!isGoogleTranslateUrl(currentUrl)) {
83+
const href = link.getAttribute("href");
84+
console.log(`href: ${href}`);
85+
if (!href) {
8486
return;
8587
}
8688

87-
let originalUrl = getOriginalUrl(link.href);
89+
if (!isGoogleTranslateUrl(href)) {
90+
console.log(href, "Not a Google Translate URL");
91+
return;
92+
}
93+
94+
let originalUrl = getOriginalUrl(href);
95+
console.log("originalUrl", originalUrl);
8896
if (!originalUrl.includes("wiki.gdevelop.io")) {
8997
// If the original URL is not from the wiki, we need to change it to the original URL.
9098
// Otherwise, we just keep the original URL.

0 commit comments

Comments
 (0)