Greasy Fork

AO3 Post New Work EN/CN 作品发表页面中文翻译

This script add additional information in Chinese on the Post New Work page on AO3. Load the web page, hover the mouse on the English content, you should be able to see additional information in Chinese. This script is a work in progress.

目前为 2021-07-05 提交的版本。查看 最新版本

// ==UserScript==
// @name         AO3 Post New Work EN/CN 作品发表页面中文翻译
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  This script add additional information in Chinese on the Post New Work page on AO3. Load the web page, hover the mouse on the English content, you should be able to see additional information in Chinese. This script is a work in progress.
// @author       Alice Wandaland
// @match        https://archiveofourown.org/works/new
// @icon         https://www.google.com/s2/favicons?domain=archiveofourown.org
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    setTimeout (function () {

        function checkAndReplace(path, original, title) {
            if (path.innerText.trim() == original) {
                return path.setAttribute("title",title)
            };
        };

        checkAndReplace(document.querySelector("#work_rating_string > option:nth-child(1)"), "Not Rated", "无分级: 如果您不想为作品表明内容分级");
        checkAndReplace(document.querySelector("#work_rating_string > option:nth-child(2)"), "General Audiences", "普遍级: 适合所有年龄人群");
        checkAndReplace(document.querySelector("#work_rating_string > option:nth-child(3)"), "Teen And Up Audiences", "青少年以上: 不适合13岁以下的观众");
        checkAndReplace(document.querySelector("#work_rating_string > option:nth-child(4)"), "Mature", "限制级: 包含成人主题(性交,暴力等)");
        checkAndReplace(document.querySelector("#work_rating_string > option:nth-child(5)"), "Explicit", "成人级: 包含露骨的成人主题,例如色情、直白的暴力描写等");


    }, 1500);

})();