Greasy Fork is available in English.

Youtube in Italiano

Traduce automaticamente i sottotitoli in Italiano

// ==UserScript==
// @name         Youtube in Italiano
// @version      1.2
// @description  Traduce automaticamente i sottotitoli in Italiano
// @author       Jonny One
// @match        https://www.youtube.com/watch*
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @grant        none
// @noframes
// @run-at       document-idle
// @namespace https://greasyfork.org/users/59738
// ==/UserScript==

(function() {
    'use strict';

    function TraduciInItaliano(){
        var sub = $('[role="menuitem"]:contains("Sottotitoli")');
        if(!sub.length) return;
        sub.click();
        var subc = $('[role="menuitemradio"]:contains("Italiano")');
        if (subc.length) {
            subc.click();
        } else {
            var autoTrans = $('[role="menuitemradio"]:contains("Traduzione automatica")');
            if (!autoTrans.length) return;
            autoTrans.click();
            var autoTransC = $('[role="menuitemradio"]:contains("Italiano")');
            if (!autoTransC.length) return;
            autoTransC.click();
        }
    }
    
    function onLoadStart(){
        $('.ytp-subtitles-button[aria-pressed="true"]').click();
        $('.ytp-subtitles-button').click();
        $('.ytp-settings-button').click();
        TraduciInItaliano();
        $('.ytp-settings-button').click();
        $('.ytp-subtitles-button').click();
    }
        $('video').on('loadstart', onLoadStart).trigger('loadstart');
})();