• We've moved. Our community is now at ownd.sh — latest discussions and updates live there.

Speak Without Knowing the Language! - Useful Shoutbox Tampermonkey Script - 100+ Lang

lguesslmlose

Divine
Divine
Rep
0
0
0
Rep
1307
Vouches
26
0
0
Vouches
26
Posts
2,855
Likes
1,868
Bits
5 YEARS
5 YEARS OF SERVICE
image.png


You don't need to know any language anymore!

Chat with people in the shoutbox in your own language!

Script:

Hidden Content

 

Code:

Code:
// ==UserScript==

// @name         ownd.sh Auto Translator by lguesslmlose

// @namespace    http://tampermonkey.net/

// @version      4.2

// @description  You can use perfectly and you don't need to learn any language!

// @author       lguesslmlose

// @match        https://ownd.sh/*

// @grant        GM_xmlhttpRequest

// @grant        GM_setValue

// @grant        GM_getValue

// @connect      translate.googleapis.com

// ==/UserScript==

(function() {

    'use strict';

    const style = document.createElement('style');

    style.textContent = `

        #translator-container {

            display: flex;

            flex-direction: column;

            gap: 6px;

            padding: 8px;

            background: rgba(42, 42, 42, 0.9);

            border: 1px solid #444;

            border-radius: 6px;

            margin-top: 8px;

        }

        .translator-main-row {

            display: flex;

            align-items: center;

            gap: 6px;

            flex-wrap: nowrap;

        }

        .translator-controls-row {

            display: flex;

            align-items: center;

            gap: 6px;

            flex-wrap: wrap;

        }

        .translator-select {

            padding: 5px 8px;

            background: #2a2a2a;

            border: 2px solid #444;

            border-radius: 4px;

            color: #fff;

            font-size: 11px;

            cursor: pointer;

            flex: 1;

            min-width: 90px;

        }

        .translator-select:focus {

            outline: none;

            border-color: #7184e3;

        }

        #translator-arrow {

            color: #7184e3;

            font-size: 14px;

            font-weight: bold;

            padding: 0 2px;

        }

        .translator-btn {

            padding: 5px 10px;

            background: #7184e3;

            color: #fff;

            border: none;

            border-radius: 4px;

            cursor: pointer;

            font-weight: bold;

            font-size: 11px;

            transition: all 0.3s;

            white-space: nowrap;

            flex-shrink: 0;

        }

        .translator-btn:hover {

            background: #5a6bc4;

        }

        .translator-btn.icon-btn {

            padding: 5px 8px;

            font-size: 13px;

        }

        .translator-btn.swap-btn {

            background: #4CAF50;

        }

        .translator-btn.swap-btn:hover {

            background: #45a049;

        }

        .translator-btn.fav-btn {

            background: #FF9800;

        }

        .translator-btn.fav-btn:hover {

            background: #e68900;

        }

        #translator-status {

            color: #4CAF50;

            font-size: 10px;

            white-space: nowrap;

            margin-left: auto;

        }

        .toggle-group {

            display: flex;

            align-items: center;

            gap: 4px;

            padding: 3px 6px;

            background: rgba(50, 50, 50, 0.5);

            border-radius: 4px;

            cursor: pointer;

            user-select: none;

        }

        .toggle-group label {

            color: #aaa;

            font-size: 10px;

            cursor: pointer;

            white-space: nowrap;

        }

        .toggle-switch {

            position: relative;

            width: 30px;

            height: 16px;

            background: #555;

            border-radius: 8px;

            transition: background 0.3s;

            cursor: pointer;

            flex-shrink: 0;

        }

        .toggle-switch.active {

            background: #4CAF50;

        }

        .toggle-slider {

            position: absolute;

            top: 2px;

            left: 2px;

            width: 12px;

            height: 12px;

            background: white;

            border-radius: 50%;

            transition: transform 0.3s;

        }

        .toggle-switch.active .toggle-slider {

            transform: translateX(14px);

        }

        .speed-control {

            display: flex;

            align-items: center;

            gap: 4px;

            padding: 3px 6px;

            background: rgba(50, 50, 50, 0.5);

            border-radius: 4px;

        }

        .speed-control label {

            color: #aaa;

            font-size: 10px;

            white-space: nowrap;

        }

        .speed-slider {

            width: 60px;

            height: 3px;

            background: #555;

            border-radius: 2px;

            outline: none;

            cursor: pointer;

        }

        .speed-slider::-webkit-slider-thumb {

            appearance: none;

            width: 10px;

            height: 10px;

            background: #7184e3;

            border-radius: 50%;

            cursor: pointer;

        }

        .speed-slider::-moz-range-thumb {

            width: 10px;

            height: 10px;

            background: #7184e3;

            border-radius: 50%;

            cursor: pointer;

            border: none;

        }

        .speed-value {

            color: #7184e3;

            font-size: 10px;

            min-width: 25px;

        }

        .favorites-dropdown {

            position: relative;

        }

        .favorites-list {

            position: absolute;

            top: 28px;

            left: 0;

            background: #2a2a2a;

            border: 2px solid #444;

            border-radius: 4px;

            padding: 4px;

            display: none;

            z-index: 1000;

            min-width: 140px;

            max-height: 200px;

            overflow-y: auto;

        }

        .favorites-list.active {

            display: block;

        }

        .favorite-item {

            padding: 5px 8px;

            color: #fff;

            cursor: pointer;

            font-size: 11px;

            border-radius: 3px;

            display: flex;

            justify-content: space-between;

            align-items: center;

            gap: 5px;

        }

        .favorite-item:hover {

            background: #444;

        }

        .favorite-item .remove {

            color: #ff4444;

            font-size: 9px;

            cursor: pointer;

            flex-shrink: 0;

        }

    `;

    document.head.appendChild(style);

    const languages = {

        'af': 'Afrikaans', 'sq': 'Albanian', 'am': 'Amharic', 'ar': 'Arabic', 'hy': 'Armenian',

        'az': 'Azerbaijani', 'eu': 'Basque', 'be': 'Belarusian', 'bn': 'Bengali', 'bs': 'Bosnian',

        'bg': 'Bulgarian', 'ca': 'Catalan', 'ceb': 'Cebuano', 'ny': 'Chichewa', 'zh': 'Chinese',

        'co': 'Corsican', 'hr': 'Croatian', 'cs': 'Czech', 'da': 'Danish', 'nl': 'Dutch',

        'en': 'English', 'eo': 'Esperanto', 'et': 'Estonian', 'tl': 'Filipino', 'fi': 'Finnish',

        'fr': 'French', 'fy': 'Frisian', 'gl': 'Galician', 'ka': 'Georgian', 'de': 'German',

        'el': 'Greek', 'gu': 'Gujarati', 'ht': 'Haitian', 'ha': 'Hausa', 'haw': 'Hawaiian',

        'he': 'Hebrew', 'hi': 'Hindi', 'hmn': 'Hmong', 'hu': 'Hungarian', 'is': 'Icelandic',

        'ig': 'Igbo', 'id': 'Indonesian', 'ga': 'Irish', 'it': 'Italian', 'ja': 'Japanese',

        'jw': 'Javanese', 'kn': 'Kannada', 'kk': 'Kazakh', 'km': 'Khmer', 'ko': 'Korean',

        'ku': 'Kurdish', 'ky': 'Kyrgyz', 'lo': 'Lao', 'la': 'Latin', 'lv': 'Latvian',

        'lt': 'Lithuanian', 'lb': 'Luxembourgish', 'mk': 'Macedonian', 'mg': 'Malagasy',

        'ms': 'Malay', 'ml': 'Malayalam', 'mt': 'Maltese', 'mi': 'Maori', 'mr': 'Marathi',

        'mn': 'Mongolian', 'my': 'Myanmar', 'ne': 'Nepali', 'no': 'Norwegian', 'ps': 'Pashto',

        'fa': 'Persian', 'pl': 'Polish', 'pt': 'Portuguese', 'pa': 'Punjabi', 'ro': 'Romanian',

        'ru': 'Russian', 'sm': 'Samoan', 'gd': 'Scots Gaelic', 'sr': 'Serbian', 'st': 'Sesotho',

        'sn': 'Shona', 'sd': 'Sindhi', 'si': 'Sinhala', 'sk': 'Slovak', 'sl': 'Slovenian',

        'so': 'Somali', 'es': 'Spanish', 'su': 'Sundanese', 'sw': 'Swahili', 'sv': 'Swedish',

        'tg': 'Tajik', 'ta': 'Tamil', 'te': 'Telugu', 'th': 'Thai', 'tr': 'Turkish',

        'uk': 'Ukrainian', 'ur': 'Urdu', 'uz': 'Uzbek', 'vi': 'Vietnamese', 'cy': 'Welsh',

        'xh': 'Xhosa', 'yi': 'Yiddish', 'yo': 'Yoruba', 'zu': 'Zulu'

    };

    let autoTranslateEnabled = false;

    let autoDetectEnabled = false;

    let typingTimer;

    let typingDelay = 700;

    let lastTranslatedText = '';

    let isTranslating = false;

    let favorites = GM_getValue('translator_favorites', []);

    function translateText(text, fromLang, toLang) {

        return new Promise((resolve, reject) => {

            const url = `https://translate.googleapis.com/translate_a/single?client=gtx&sl=${fromLang}&tl=${toLang}&dt=t&q=${encodeURIComponent(text)}`;

            GM_xmlhttpRequest({

                method: 'GET',

                url: url,

                onload: function(response) {

                    try {

                        const data = JSON.parse(response.responseText);

                        if (data && data[0]) {

                            const translatedText = data[0].map(item => item[0]).join('');

                            resolve(translatedText);

                        } else {

                            reject('Translation failed');

                        }

                    } catch (e) {

                        reject(e);

                    }

                },

                onerror: function(error) {

                    reject(error);

                }

            });

        });

    }

    function guessLanguage(text) {

        if (/[şğüöçıİ]/i.test(text)) return 'tr';

        if (/[\u0600-\u06FF]/.test(text)) return 'ar';

        if (/[\u4E00-\u9FFF]/.test(text)) return 'zh';

        if (/[\u3040-\u309F\u30A0-\u30FF]/.test(text)) return 'ja';

        if (/[\uAC00-\uD7AF]/.test(text)) return 'ko';

        if (/[\u0400-\u04FF]/.test(text)) return 'ru';

        if (/[\u0370-\u03FF]/.test(text)) return 'el';

        if (/[\u0590-\u05FF]/.test(text)) return 'he';

        return 'en';

    }

    function saveFavorite(fromLang, toLang) {

        const pair = `${fromLang}|${toLang}`;

        if (!favorites.includes(pair)) {

            favorites.push(pair);

            GM_setValue('translator_favorites', favorites);

            updateFavoritesList();

        }

    }

    function removeFavorite(pair) {

        favorites = favorites.filter(f => f !== pair);

        GM_setValue('translator_favorites', favorites);

        updateFavoritesList();

    }

    function updateFavoritesList() {

        const favList = document.getElementById('favorites-list');

        if (!favList) return;

        favList.innerHTML = '';

        if (favorites.length === 0) {

            favList.innerHTML = '<div class="favorite-item" style="color: #888;">No favorites</div>';

            return;

        }

        favorites.forEach(pair => {

            const [from, to] = pair.split('|');

            const item = document.createElement('div');

            item.className = 'favorite-item';

            item.innerHTML = `

                <span>${languages[from]} → ${languages[to]}</span>

                <span class="remove">✕</span>

            `;

            item.querySelector('span:first-child').addEventListener('click', () => {

                document.getElementById('from-lang').value = from;

                document.getElementById('to-lang').value = to;

                favList.classList.remove('active');

            });

            item.querySelector('.remove').addEventListener('click', (e) => {

                e.stopPropagation();

                removeFavorite(pair);

            });

            favList.appendChild(item);

        });

    }

    function initTranslator() {

        const messageInput = document.getElementById('message_input');

        if (!messageInput) {

            setTimeout(initTranslator, 1000);

            return;

        }

        if (document.getElementById('translator-container')) {

            return;

        }

        let languageOptions = '';

        for (let code in languages) {

            languageOptions += `<option value="${code}">${languages[code]}</option>`;

        }

        const inputParent = messageInput.parentElement;

        const translatorContainer = document.createElement('div');

        translatorContainer.id = 'translator-container';

        translatorContainer.innerHTML = `

            <div class="translator-main-row">

                <select id="from-lang" class="translator-select">${languageOptions}</select>

                <button id="swap-btn" class="translator-btn icon-btn swap-btn" title="Swap (Ctrl+E)">⇄</button>

                <select id="to-lang" class="translator-select">${languageOptions}</select>

                <button id="translate-btn" class="translator-btn">Translate</button>

                <div class="favorites-dropdown">

                    <button id="fav-btn" class="translator-btn icon-btn fav-btn" title="Favorites">★</button>

                    <div id="favorites-list" class="favorites-list"></div>

                </div>

                <button id="add-fav-btn" class="translator-btn fav-btn" title="Save favorite">+</button>

                <span id="translator-status"></span>

            </div>

            <div class="translator-controls-row">

                <div class="toggle-group" id="auto-toggle">

                    <label>Auto</label>

                    <div class="toggle-switch" id="toggle-switch">

                        <div class="toggle-slider"></div>

                    </div>

                </div>

                <div class="toggle-group" id="auto-detect-toggle">

                    <label>Detect</label>

                    <div class="toggle-switch" id="auto-detect-switch">

                        <div class="toggle-slider"></div>

                    </div>

                </div>

                <div class="speed-control">

                    <label>Speed</label>

                    <input type="range" id="speed-slider" class="speed-slider" min="300" max="2000" step="100" value="700">

                    <span class="speed-value" id="speed-value">0.7s</span>

                </div>

            </div>

        `;

        if (messageInput.nextSibling) {

            inputParent.insertBefore(translatorContainer, messageInput.nextSibling);

        } else {

            inputParent.appendChild(translatorContainer);

        }

        document.getElementById('from-lang').value = 'tr';

        document.getElementById('to-lang').value = 'en';

        const translateBtn = document.getElementById('translate-btn');

        const statusSpan = document.getElementById('translator-status');

        const fromLangSelect = document.getElementById('from-lang');

        const toLangSelect = document.getElementById('to-lang');

        const toggleSwitch = document.getElementById('toggle-switch');

        const autoToggle = document.getElementById('auto-toggle');

        const swapBtn = document.getElementById('swap-btn');

        const favBtn = document.getElementById('fav-btn');

        const favList = document.getElementById('favorites-list');

        const addFavBtn = document.getElementById('add-fav-btn');

        const speedSlider = document.getElementById('speed-slider');

        const speedValue = document.getElementById('speed-value');

        const autoDetectToggle = document.getElementById('auto-detect-toggle');

        const autoDetectSwitch = document.getElementById('auto-detect-switch');

        updateFavoritesList();

        speedSlider.addEventListener('input', function() {

            typingDelay = parseInt(this.value);

            speedValue.textContent = (typingDelay / 1000).toFixed(1) + 's';

        });

        swapBtn.addEventListener('click', function() {

            const temp = fromLangSelect.value;

            fromLangSelect.value = toLangSelect.value;

            toLangSelect.value = temp;

        });

        favBtn.addEventListener('click', function(e) {

            e.stopPropagation();

            favList.classList.toggle('active');

        });

        document.addEventListener('click', function() {

            favList.classList.remove('active');

        });

        addFavBtn.addEventListener('click', function() {

            saveFavorite(fromLangSelect.value, toLangSelect.value);

            statusSpan.textContent = '⭐ Saved!';

            statusSpan.style.color = '#FF9800';

            setTimeout(() => { statusSpan.textContent = ''; }, 2000);

        });

        autoDetectToggle.addEventListener('click', function() {

            autoDetectEnabled = !autoDetectEnabled;

            autoDetectSwitch.classList.toggle('active', autoDetectEnabled);

        });

        function shouldTranslate(message) {

            if (message.length < 3) return false;

            if (message === lastTranslatedText) return false;

            if (isTranslating) return false;

            return true;

        }

        async function doTranslation() {

            const message = messageInput.value.trim();

            if (!message || message.length < 3) {

                statusSpan.textContent = '❌ Empty!';

                statusSpan.style.color = '#ff4444';

                return;

            }

            let fromLang = fromLangSelect.value;

            const toLang = toLangSelect.value;

            if (autoDetectEnabled) {

                fromLang = guessLanguage(message);

                fromLangSelect.value = fromLang;

            }

            if (fromLang === toLang) {

                statusSpan.textContent = '❌ Same!';

                statusSpan.style.color = '#ff4444';

                return;

            }

            if (isTranslating) return;

            isTranslating = true;

            statusSpan.textContent = '?';

            statusSpan.style.color = '#FFA500';

            try {

                const translatedText = await translateText(message, fromLang, toLang);

                messageInput.value = translatedText;

                lastTranslatedText = translatedText;

                statusSpan.textContent = '✅';

                statusSpan.style.color = '#4CAF50';

                setTimeout(() => {

                    const sendButton = document.querySelector('input[name="send"]') ||

                                     document.querySelector('button[name="send"]') ||

                                     document.querySelector('#shoutbox_send_button');

                    if (sendButton) {

                        sendButton.click();

                        lastTranslatedText = '';

                    } else {

                        const enterEvent = new KeyboardEvent('keydown', {

                            key: 'Enter',

                            keyCode: 13,

                            which: 13,

                            bubbles: true

                        });

                        messageInput.dispatchEvent(enterEvent);

                        lastTranslatedText = '';

                    }

                }, 300);

            } catch (error) {

                statusSpan.textContent = '❌';

                statusSpan.style.color = '#ff4444';

            } finally {

                isTranslating = false;

            }

        }

        translateBtn.addEventListener('click', doTranslation);

        autoToggle.addEventListener('click', function() {

            autoTranslateEnabled = !autoTranslateEnabled;

            toggleSwitch.classList.toggle('active', autoTranslateEnabled);

            statusSpan.textContent = autoTranslateEnabled ? '?' : '?';

            statusSpan.style.color = autoTranslateEnabled ? '#4CAF50' : '#ff4444';

            if (!autoTranslateEnabled) lastTranslatedText = '';

        });

        messageInput.addEventListener('input', function() {

            if (!autoTranslateEnabled) return;

            clearTimeout(typingTimer);

            const message = messageInput.value.trim();

            if (!message || message.length < 3 || !shouldTranslate(message)) return;

            statusSpan.textContent = '⏳';

            statusSpan.style.color = '#FFA500';

            typingTimer = setTimeout(async function() {

                let fromLang = fromLangSelect.value;

                const toLang = toLangSelect.value;

                if (autoDetectEnabled) {

                    fromLang = guessLanguage(message);

                    fromLangSelect.value = fromLang;

                }

                if (fromLang === toLang || !shouldTranslate(messageInput.value.trim())) return;

                isTranslating = true;

                statusSpan.textContent = '?';

                try {

                    const translatedText = await translateText(message, fromLang, toLang);

                    messageInput.value = translatedText;

                    lastTranslatedText = translatedText;

                    statusSpan.textContent = '✅';

                    statusSpan.style.color = '#4CAF50';

                } catch (error) {

                    statusSpan.textContent = '❌';

                    statusSpan.style.color = '#ff4444';

                } finally {

                    isTranslating = false;

                }

            }, typingDelay);

        });

        document.addEventListener('keydown', function(e) {

            if (e.ctrlKey && e.key === 'q') {

                e.preventDefault();

                translateBtn.click();

            } else if (e.ctrlKey && e.key === 'e') {

                e.preventDefault();

                swapBtn.click();

            }

        });

        messageInput.addEventListener('keydown', function(e) {

            if (e.key === 'Enter' && e.shiftKey) {

                e.preventDefault();

                translateBtn.click();

            } else if (e.key === 'Enter') {

                setTimeout(() => { lastTranslatedText = ''; }, 100);

            }

        });

        messageInput.addEventListener('input', function() {

            if (messageInput.value.trim() === '') lastTranslatedText = '';

        });

    }

    if (document.readyState === 'loading') {

        document.addEventListener('DOMContentLoaded', function() {

            setTimeout(initTranslator, 2000);

        });

    } else {

        setTimeout(initTranslator, 2000);

    }

    const observer = new MutationObserver(function(mutations) {

        if (document.getElementById('message_input') && !document.getElementById('translator-container')) {

            initTranslator();

        }

    });

    observer.observe(document.body, {

        childList: true,

        subtree: true

    });

})();

Features:

By activating the Auto option and setting the duration in the Speed section, you can easily perform automatic translation and send it!

You can enable the automatic language detection feature by activating the Detect option!

Add languages to favorites feature!


Have a nice chat!

Note:According to the forum rules, the local language of the Shoutbox is English only. Neither I nor the forum will accept responsibility in this matter!

Beware of scammers who impersonate me!

 

lguesslmlose

Divine
Divine
Rep
0
0
0
Rep
1307
Vouches
26
0
0
Vouches
26
Posts
2,855
Likes
1,868
Bits
5 YEARS
5 YEARS OF SERVICE
This is a bump

Beware of scammers who impersonate me!

 

Winter

Divine
Divine
Winter Rep
0
0
Rep
2678
Winter Vouches
112
0
0
Vouches
112
Posts
10,526
Likes
1,770
Bits
7 YEARS
7 YEARS OF SERVICE
nice goated sir @lguesslmlose



----------------------------------------------

⚠️ Beware of fake accounts.

Before conducting any form of business confirm my identity through onsite PM.

I do not operate under any other usernames. Stay safe!.
 
Winter's signature

juliass

Royal
Royal
juliass Rep
0
0
Rep
804
juliass Vouches
0
0
0
Vouches
0
Posts
1,382
Likes
1,521
Bits
2 YEARS
2 YEARS OF SERVICE
clean UI
hype.png


 

I do not buy, sell or exchange anything

GzZjykf.gif
 

Attachments

  • hype.png
    hype.png
    802 bytes · Views: 0
juliass's signature

correia32

Well-known member
correia32 Rep
0
0
Rep
0
correia32 Vouches
0
0
0
Vouches
0
Posts
111
Likes
0
Bits
1 YEAR
1 YEAR OF SERVICE
(29 October, 2025 - 01:04 AM)lguesslmlose Wrote: Show More
image.png


You don't need to know any language anymore!

Chat with people in the shoutbox in your own language!

Script:

Features:

By activating the Auto option and setting the duration in the Speed section, you can easily perform automatic translation and send it!

You can enable the automatic language detection feature by activating the Detect option!

Add languages to favorites feature!


Have a nice chat!

Note:According to the forum rules, the local language of the Shoutbox is English only. Neither I nor the forum will accept responsibility in this matter!

NEW
 

179,168

126,023

1,405,739

Top