Greasy Fork镜像 支持简体中文。

symfony_book_6.4_fanyi

Symfony Book 6.4 翻译库

目前為 2024-08-08 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/503008/1424468/symfony_book_64_fanyi.js

// ==UserScript==
// @name         symfony_book_6.4_fanyi
// @namespace    fireloong
// @version      0.0.4
// @description  Symfony Book 6.4 翻译库
// @author       Itsky71
// @require      https://unpkg.com/[email protected]/dist/jquery.min.js
// @grant        none
// @license      MIT
// ==/UserScript==

function fanyi(translates){
    let n = 0;
    let jsonStr = '';
    $('.ui-heading > h1,.ui-prose .section > h2 > a,.ui-prose p,.pagination-item > a,.pagination-item > span,.ui-prose li').each(function(i,v){
        if(translates.hasOwnProperty($(this).text())) {
            $(this).html(translates[$(this).text()]);
        } else {
            console.log(n,v,$(this).text());
            jsonStr += '\''+$(this).text().replaceAll('\\','\\\\').replaceAll('\'','\\\'').replaceAll("\n",'\\n')+'\': \'\','+"\n";
            n++;
        }
    });
    console.info(jsonStr);
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址