Greasy Fork is available in English.

Leetcode 切换中文站点

Leetcode 切换为中文站点

// ==UserScript==
// @name         Leetcode 切换中文站点
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Leetcode 切换为中文站点
// @author       You
// @match        https://leetcode.com/*
// @icon         https://www.google.com/s2/favicons?domain=leetcode-cn.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var reg = /.leetcode\.com/;
    var str = window.location.href;
    if (reg.test(window.location.href) &&
        confirm('是否将语言切换为中文')) {
        str = str.replace('leetcode', 'leetcode-cn');
        window.location.href = str;
    }
})();