Last active
August 13, 2025 09:48
-
-
Save SkyyySi/7c0478bd20de6fd769204ab92a87dc82 to your computer and use it in GitHub Desktop.
A simple userscript to switch the shitty AI translations for most Microsoft documentation over to english
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name English language switcher for Microsoft documentation | |
// @namespace https://gist.github.com/SkyyySi/7c0478bd20de6fd769204ab92a87dc82/ | |
// @version 2025-08-13 | |
// @description Switches the shitty AI translations for most Microsoft documentation over to english | |
// @author SkyyySi | |
// @match https://learn.microsoft.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=microsoft.com | |
// @grant none | |
// @license 0BSD | |
// ==/UserScript== | |
((async (document) => { | |
"use strict"; | |
const pathname = document.location.pathname; | |
const pathnameSegments = pathname.split("/"); | |
const currentLocale = pathnameSegments[1]; | |
if (currentLocale === "en-us") { | |
return; | |
} | |
pathnameSegments[1] = "en-us"; | |
const newPathname = pathnameSegments.join("/"); | |
if (newPathname === pathname) { | |
throw new Error(`Attemped to overwrite 'document.location.pathname' with identical string '${pathname}'!`); | |
} | |
document.location.pathname = newPathname; | |
})(document ?? this)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment