// ==UserScript== // @name X Translator // @name:ru X Translator // @name:zh-CN X Translator // @name:es X Translator // @name:pt-BR X Translator // @name:de X Translator // @name:fr X Translator // @name:ja X Translator // @namespace https://github.com/NemoKing1210/x-translator // @version 1.3.1 // @author NemoKing1210 // @description Translate X posts in place on x.com // @description:ru Переводит посты X прямо на x.com // @description:zh-CN 在 x.com 上就地翻译 X 帖子 // @description:es Traduce publicaciones de X en x.com // @description:pt-BR Traduz posts do X diretamente no x.com // @description:de Übersetzt X-Posts direkt auf x.com // @description:fr Traduit les posts X directement sur x.com // @description:ja x.com 上で X の投稿をその場で翻訳 // @license MIT // @icon https://abs.twimg.com/favicons/twitter.3.ico // @homepage https://github.com/NemoKing1210/x-translator // @homepageURL https://github.com/NemoKing1210/x-translator // @source https://github.com/NemoKing1210/x-translator.git // @supportURL https://github.com/NemoKing1210/x-translator/issues // @match https://x.com/* // @match https://www.x.com/* // @match https://twitter.com/* // @match https://www.twitter.com/* // @tag x // @tag twitter // @tag translate // @connect translate.googleapis.com // @connect api-free.deepl.com // @connect api.deepl.com // @connect api.cognitive.microsofttranslator.com // @connect api.openai.com // @connect translate.api.cloud.yandex.net // @connect libretranslate.com // @connect * // @grant GM_addStyle // @grant GM_getValue // @grant GM_registerMenuCommand // @grant GM_setValue // @grant GM_xmlhttpRequest // @run-at document-idle // @noframes // ==/UserScript== (t=>{if(typeof GM_addStyle=="function"){GM_addStyle(t);return}const e=document.createElement("style");e.textContent=t,document.head.append(e)})(' html[data-xt-theme=light]{--xt-accent: #1d9bf0;--xt-accent-hover: #1a8cd8;--xt-danger: #f4212e;--xt-danger-bg: rgba(244, 33, 46, .1);--xt-danger-border: rgba(244, 33, 46, .4);--xt-success: #00ba7c;--xt-warn: #ffd400;--xt-fg: #0f1419;--xt-fg-muted: #536471;--xt-surface: #ffffff;--xt-elevated: #f7f9f9;--xt-border: #eff3f4;--xt-hover: rgba(15, 20, 25, .1);--xt-inset: rgba(15, 20, 25, .03);--xt-shadow: 0 0 15px rgba(101, 119, 134, .2), 0 0 3px 1px rgba(101, 119, 134, .15);--xt-backdrop: rgba(0, 0, 0, .4);--xt-input-bg: #ffffff;--xt-input-border: #cfd9de;--xt-option-bg: #ffffff;--xt-toggle-off: #cfd9de;--xt-chrome-fg: #0f1419;--xt-nav-hover: rgba(15, 20, 25, .1);--xt-link: #1d9bf0}html[data-xt-theme=dim]{--xt-accent: #1d9bf0;--xt-accent-hover: #1a8cd8;--xt-danger: #f4212e;--xt-danger-bg: rgba(244, 33, 46, .12);--xt-danger-border: rgba(244, 33, 46, .45);--xt-success: #00ba7c;--xt-warn: #ffd400;--xt-fg: #f7f9f9;--xt-fg-muted: #8b98a5;--xt-surface: #15202b;--xt-elevated: #1e2732;--xt-border: #38444d;--xt-hover: rgba(247, 249, 249, .1);--xt-inset: rgba(255, 255, 255, .03);--xt-shadow: 0 0 15px rgba(0, 0, 0, .4), 0 0 3px 1px rgba(0, 0, 0, .25);--xt-backdrop: rgba(91, 112, 131, .4);--xt-input-bg: #15202b;--xt-input-border: #38444d;--xt-option-bg: #1e2732;--xt-toggle-off: #38444d;--xt-chrome-fg: #f7f9f9;--xt-nav-hover: rgba(247, 249, 249, .1);--xt-link: #1d9bf0}html[data-xt-theme=dark],html:not([data-xt-theme]){--xt-accent: #1d9bf0;--xt-accent-hover: #1a8cd8;--xt-danger: #f4212e;--xt-danger-bg: rgba(244, 33, 46, .12);--xt-danger-border: rgba(244, 33, 46, .45);--xt-success: #00ba7c;--xt-warn: #ffd400;--xt-fg: #e7e9ea;--xt-fg-muted: #71767b;--xt-surface: #000000;--xt-elevated: #16181c;--xt-border: #2f3336;--xt-hover: rgba(231, 233, 234, .1);--xt-inset: rgba(255, 255, 255, .03);--xt-shadow: 0 0 15px rgba(255, 255, 255, .08), 0 0 3px 1px rgba(255, 255, 255, .05);--xt-backdrop: rgba(91, 112, 131, .4);--xt-input-bg: #000000;--xt-input-border: #333639;--xt-option-bg: #16181c;--xt-toggle-off: #333639;--xt-chrome-fg: #e7e9ea;--xt-nav-hover: rgba(231, 233, 234, .1);--xt-link: #1d9bf0}.xt-menu-item,.xt-menu-item__label,.xt-menu-item__icon{color:var(--xt-chrome-fg)!important}.xt-menu-item svg,.xt-menu-item svg [fill]:not([fill=none]){color:var(--xt-chrome-fg)!important;fill:var(--xt-chrome-fg)!important}.xt-menu-item:hover{background-color:var(--xt-hover)}.xt-toolbar{display:block;width:100%;flex:0 0 auto;align-self:stretch;margin-top:.25rem;box-sizing:border-box}.xt-toolbar--quiet{display:none}.xt-btn[hidden]{display:none!important}.xt-btn{appearance:none;display:inline-flex;align-items:center;gap:.3rem;margin:0;padding:.15rem 0;border:0;border-radius:4px;background:transparent;color:var(--xt-accent);font:inherit;font-size:13px;font-weight:400;line-height:16px;cursor:pointer;transition:color .15s ease}.xt-btn:hover:not(:disabled){color:var(--xt-accent-hover);text-decoration:underline;text-underline-offset:2px}.xt-btn:focus-visible{outline:2px solid var(--xt-accent);outline-offset:2px}.xt-btn:disabled{opacity:.7;cursor:wait}.xt-btn.is-loading{pointer-events:none;text-decoration:none}.xt-btn__spinner{display:inline-block;width:.85em;height:.85em;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;flex:0 0 auto;animation:xt-spin .65s linear infinite}.xt-btn__icon{display:block;flex:0 0 auto;width:1em;height:1em;opacity:.72;color:inherit}.xt-btn:hover:not(:disabled) .xt-btn__icon{opacity:1}.xt-btn__label{min-width:0}.xt-btn--retry{margin-top:.35rem}.xt-header-action{display:flex;flex-direction:row;align-items:center;justify-content:center;flex:0 0 auto}.xt-header-action--quote{margin-left:auto;align-self:center}.xt-btn--header{position:relative;z-index:0;color:var(--xt-fg-muted);font-size:15px;font-weight:400;line-height:1;width:20px;height:20px;min-width:20px;min-height:20px;padding:0;justify-content:center;border-radius:999px;background:transparent;text-decoration:none!important;overflow:visible}.xt-btn--header:before{content:"";position:absolute;top:50%;left:50%;width:34px;height:34px;transform:translate(-50%,-50%);border-radius:999px;background-color:transparent;transition:background-color .15s ease;z-index:-1}.xt-btn--header .xt-btn__icon{width:1.25em;height:1.25em;opacity:1}.xt-btn--header .xt-btn__label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.xt-btn--header:hover:not(:disabled){color:var(--xt-accent);background-color:transparent;text-decoration:none}.xt-btn--header:hover:not(:disabled):before{background-color:#1d9bf01a}.xt-btn--header:focus-visible{outline:none}.xt-btn--header:focus-visible:before{outline:2px solid var(--xt-accent);outline-offset:0}.xt-btn--header.is-loading,.xt-btn--header:disabled{color:var(--xt-fg-muted)}@keyframes xt-spin{to{transform:rotate(360deg)}}.xt-text--hover-peek{cursor:help;position:relative}.xt-text--blur-ready{position:relative;filter:blur(0);opacity:1;transition:filter .55s cubic-bezier(.33,1,.68,1),opacity .55s cubic-bezier(.33,1,.68,1)}.xt-text--translating{filter:blur(2.25px);opacity:.72;user-select:none;pointer-events:none}.xt-text--peeking{position:relative;outline:1px solid var(--xt-border);outline-offset:2px;display:block!important;-webkit-line-clamp:unset!important;line-clamp:unset!important;max-height:none!important;overflow:visible!important;-webkit-box-orient:initial!important}.xt-peek-badge{position:fixed;z-index:2147483000;display:inline-flex;align-items:center;gap:.2rem;margin:0;padding:.1rem .45rem;border-radius:999px;border:1px solid var(--xt-border);background:var(--xt-elevated);color:var(--xt-fg-muted);font-size:11px;font-weight:700;letter-spacing:.02em;line-height:1.2;white-space:nowrap;pointer-events:none;box-shadow:var(--xt-shadow)}.xt-split{display:flex;flex-direction:column;gap:.55rem}.xt-split__pane{min-width:0}.xt-split__pane--translated{padding-top:.45rem;border-top:1px solid var(--xt-border)}.xt-split__label{font-size:13px;font-weight:400;letter-spacing:0;text-transform:none;color:var(--xt-fg-muted);margin-bottom:.15rem}.xt-split__body{white-space:pre-wrap;word-break:break-word;line-height:1.45;color:var(--xt-fg)}.xt-result{display:grid;grid-template-rows:0fr;width:100%;box-sizing:border-box;margin-top:0;opacity:0;transform:translateY(-2px);transition:grid-template-rows .28s cubic-bezier(.22,1,.36,1),opacity .22s ease,transform .22s ease,margin-top .22s ease}.xt-result.is-open{grid-template-rows:1fr;margin-top:.5rem;opacity:1;transform:translateY(0)}.xt-result.is-closing{grid-template-rows:0fr;margin-top:0;opacity:0;transform:translateY(-2px)}.xt-result__clip{overflow:hidden;min-height:0}.xt-result__inner{padding:.65rem .75rem;border-radius:12px;border:1px solid var(--xt-border);background:var(--xt-elevated);color:var(--xt-fg)}.xt-result__label{font-size:13px;font-weight:400;letter-spacing:0;text-transform:none;color:var(--xt-fg-muted);margin-bottom:.2rem}.xt-result__meta{font-size:13px;color:var(--xt-fg-muted);margin-bottom:.3rem}.xt-result__text{white-space:pre-wrap;word-break:break-word;line-height:1.45;color:var(--xt-fg);font-size:inherit}.xt-result__text a,.xt-text--translated a{color:var(--xt-link);text-decoration:none}.xt-result__text a:hover,.xt-text--translated a:hover{text-decoration:underline;text-underline-offset:2px}.xt-result__error{color:var(--xt-danger);font-size:13px;line-height:1.4}.xt-toast-host{position:fixed;inset:16px 16px auto auto;transform:none;z-index:2147483000;display:flex;flex-direction:column-reverse;align-items:flex-end;gap:12px;width:min(356px,calc(100vw - 32px));pointer-events:none}.xt-toast{pointer-events:auto;position:relative;display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;width:100%;padding:12px 8px 12px 12px;border-radius:16px;border:1px solid var(--xt-border);background:var(--xt-surface);color:var(--xt-fg);box-shadow:var(--xt-shadow);font:inherit;letter-spacing:normal;opacity:0;transform:translate(12px);transition:opacity .18s ease,transform .18s ease;overflow:hidden}.xt-toast.is-visible{opacity:1;transform:translate(0)}.xt-toast.is-leaving{opacity:0;transform:translate(12px)}.xt-toast__icon{display:grid;place-items:center;flex:0 0 auto;width:36px;height:36px;margin:0;border-radius:999px;background:#1d9bf01f;color:var(--xt-accent)}.xt-toast__icon svg{width:18px;height:18px;display:block}.xt-toast--success .xt-toast__icon{background:#00ba7c1f;color:var(--xt-success)}.xt-toast--warning .xt-toast__icon{background:#ffd40024;color:#ca8a04}html[data-xt-theme=dim] .xt-toast--warning .xt-toast__icon,html[data-xt-theme=dark] .xt-toast--warning .xt-toast__icon,html:not([data-xt-theme]) .xt-toast--warning .xt-toast__icon{color:var(--xt-warn)}.xt-toast--error .xt-toast__icon{background:var(--xt-danger-bg);color:var(--xt-danger)}.xt-toast__body{display:flex;flex-direction:column;gap:2px;min-width:0;padding:2px 0}.xt-toast__title{font-weight:700;font-size:15px;line-height:20px;color:var(--xt-fg)}.xt-toast__text{font-size:13px;font-weight:400;line-height:16px;color:var(--xt-fg-muted)}.xt-toast__close{appearance:none;display:grid;place-items:center;flex:0 0 auto;align-self:start;width:34px;height:34px;margin:0;padding:0;border:0;border-radius:999px;background:transparent;color:var(--xt-fg);cursor:pointer;transition:background .15s ease}.xt-toast__close:hover{background:var(--xt-hover)}.xt-toast__close:focus-visible{outline:2px solid var(--xt-accent);outline-offset:2px}.xt-toast__close svg{width:18px;height:18px;display:block}.xt-toast__bar{position:absolute;left:0;right:0;bottom:0;height:3px;width:100%;transform-origin:left center;background:var(--xt-accent);opacity:.85;animation:xt-toast-bar linear forwards}.xt-toast--success .xt-toast__bar{background:var(--xt-success)}.xt-toast--warning .xt-toast__bar{background:var(--xt-warn)}.xt-toast--error .xt-toast__bar{background:var(--xt-danger)}@keyframes xt-toast-bar{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.xt-settings-backdrop{position:fixed;inset:0;z-index:2147483100;display:grid;place-items:center;padding:16px;background:var(--xt-backdrop);overscroll-behavior:none;touch-action:none}html.xt-scroll-lock,html.xt-scroll-lock body.xt-scroll-lock{overflow:hidden!important;overscroll-behavior:none}body.xt-scroll-lock{position:fixed;left:0;right:0;width:100%}.xt-settings{display:flex;flex-direction:column;width:min(920px,100%);max-height:min(90vh,800px);overflow:hidden;touch-action:auto;overscroll-behavior:contain;border-radius:16px;border:1px solid var(--xt-border);background:var(--xt-surface);color:var(--xt-fg);box-shadow:var(--xt-shadow);font:inherit}.xt-settings__header{display:grid;grid-template-columns:40px 1fr 40px;align-items:center;gap:.5rem;min-height:53px;padding:0 8px;border-bottom:1px solid var(--xt-border)}.xt-settings__heading{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;text-align:center}.xt-settings__heading h2{margin:0;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0}.xt-settings__ver{margin:.1rem 0 0;font-size:13px;font-weight:400;letter-spacing:0;text-transform:none;color:var(--xt-fg-muted)}.xt-settings__x{appearance:none;display:grid;place-items:center;width:34px;height:34px;margin:0;border:0;border-radius:999px;background:transparent;color:var(--xt-fg);cursor:pointer;transition:background .15s ease}.xt-settings__x:hover{background:var(--xt-hover)}.xt-settings__x svg{width:20px;height:20px;display:block}.xt-settings__header-spacer{width:34px;height:34px}.xt-settings__tabs{position:relative;display:flex;flex:0 0 auto;gap:0;padding:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-behavior:smooth;border-bottom:1px solid var(--xt-border);background:transparent;scrollbar-width:thin}.xt-settings__tab-ink{position:absolute;left:0;bottom:0;height:4px;width:0;border-radius:999px;background:var(--xt-accent);pointer-events:none;transition:transform .2s ease,width .2s ease}.xt-settings__tab{flex:1 0 auto;appearance:none;position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:.35rem;margin:0;min-height:53px;padding:12px 16px;border:0;background:transparent;color:var(--xt-fg-muted);cursor:pointer;font:inherit;font-size:15px;font-weight:700;letter-spacing:0;white-space:nowrap;line-height:20px;border-radius:0;transition:background-color .15s ease,color .15s ease}.xt-settings__tab-label{flex:0 0 auto}.xt-settings__badge{display:inline-flex;align-items:center;max-width:6.5rem;overflow:hidden;text-overflow:ellipsis;padding:.1rem .4rem;border-radius:999px;border:1px solid var(--xt-border);background:var(--xt-inset);color:var(--xt-fg-muted);font-size:11px;font-weight:500;letter-spacing:0;font-variant-numeric:tabular-nums;line-height:1.2}.xt-settings__tab.is-active .xt-settings__badge,.xt-settings__badge--cache[data-level=ok],.xt-settings__badge--cache[data-level=warn],.xt-settings__badge--cache[data-level=high],.xt-settings__badge--cache[data-level=off]{border-color:var(--xt-border);background:var(--xt-inset);color:var(--xt-fg-muted)}.xt-settings__tab:hover{color:var(--xt-fg);background:var(--xt-hover)}.xt-settings__tab.is-active{color:var(--xt-fg);background:transparent}.xt-settings__tab:focus-visible{outline:2px solid var(--xt-accent);outline-offset:-2px}.xt-settings__form{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.xt-settings__body{flex:1 1 auto;min-height:0;overflow:auto;padding:0}.xt-settings__panel{display:flex;flex-direction:column;gap:0;animation:xt-settings-panel-in .18s ease}.xt-settings__panel[hidden]{display:none}@keyframes xt-settings-panel-in{0%{opacity:0}to{opacity:1}}.xt-section{display:flex;flex-direction:column;gap:0;padding:0;border-radius:0;border:0;border-bottom:1px solid var(--xt-border);background:transparent}.xt-section:last-child{border-bottom:0}.xt-section__head{display:flex;flex-direction:column;gap:.15rem;padding:12px 16px 4px}.xt-section__title{margin:0;font-size:13px;font-weight:700;letter-spacing:0;text-transform:none;color:var(--xt-fg-muted)}.xt-section__desc{margin:0;font-size:13px;line-height:16px;color:var(--xt-fg-muted)}.xt-section__body{display:flex;flex-direction:column;gap:0;padding:4px 16px 16px}.xt-section__actions{display:flex;align-items:flex-end}.xt-grid{display:grid;gap:12px}.xt-field{display:flex;flex-direction:column;gap:.35rem;font-size:15px;min-width:0;padding:8px 0}.xt-field__label{font-size:13px;font-weight:700;color:var(--xt-fg)}.xt-field__hint{font-size:13px;line-height:16px;color:var(--xt-fg-muted)}.xt-field select,.xt-field input[type=number],.xt-field input[type=text],.xt-field input[type=password],.xt-field input[type=url],.xt-allowlist-add input,.xt-allowlist-add select{appearance:none;width:100%;box-sizing:border-box;border-radius:4px;border:1px solid var(--xt-input-border);background:var(--xt-input-bg);color:var(--xt-fg);font:inherit;font-size:15px;line-height:20px;padding:8px 12px;outline:none;transition:border-color .15s ease,box-shadow .15s ease}.xt-field input::placeholder,.xt-allowlist-add input::placeholder{color:var(--xt-fg-muted)}.xt-field select:hover,.xt-field input:hover,.xt-allowlist-add input:hover,.xt-allowlist-add select:hover{border-color:var(--xt-fg-muted)}.xt-field select:focus,.xt-field input:focus,.xt-allowlist-add input:focus,.xt-allowlist-add select:focus{border-color:var(--xt-accent);box-shadow:0 0 0 1px var(--xt-accent)}.xt-replace-options[hidden],.xt-auto-options[hidden],.xt-allowlist-panel[hidden]{display:none!important}.xt-auto-options,.xt-replace-options{display:flex;flex-direction:column;gap:0;min-width:0}.xt-auto-options{padding:4px 0 0;border-radius:0;border:0;border-top:1px solid var(--xt-border);background:transparent;margin-top:4px}.xt-list-editor{display:flex;flex-direction:column;gap:8px;min-width:0;padding:12px 0 4px;border-radius:0;border:0;border-top:1px solid var(--xt-border);background:transparent}.xt-list-editor__title{font-size:15px;font-weight:700;color:var(--xt-fg)}.xt-list-editor__hint{margin:.1rem 0 0;font-size:13px;line-height:16px;color:var(--xt-fg-muted)}.xt-list-editor__host{min-height:1.5rem}.xt-allowlist-panel{display:flex;flex-direction:column;gap:.55rem}.xt-allowlist-add{display:flex;gap:8px;align-items:stretch}.xt-allowlist-add input,.xt-allowlist-add select{flex:1 1 auto;min-width:0}.xt-allowlist{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px}.xt-allowlist__item{display:inline-flex;align-items:center;gap:.25rem;max-width:100%;padding:4px 4px 4px 10px;border-radius:999px;border:1px solid var(--xt-border);background:var(--xt-inset)}.xt-allowlist__handle{font-size:13px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--xt-fg)}.xt-allowlist__remove{appearance:none;flex:0 0 auto;width:22px;height:22px;border:0;border-radius:999px;background:transparent;color:var(--xt-fg-muted);cursor:pointer;font:inherit;font-size:15px;line-height:1}.xt-allowlist__remove:hover{background:var(--xt-danger-bg);color:var(--xt-danger)}.xt-empty{margin:0;font-size:13px;color:var(--xt-fg-muted)}.xt-field select option{background-color:var(--xt-option-bg);color:var(--xt-fg)}.xt-check{position:relative;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;font-size:15px;cursor:pointer;padding:12px 0}.xt-check--card{margin:0;padding:12px 0;border-radius:0;border:0;border-top:1px solid var(--xt-border);background:transparent}.xt-check__text{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1 1 auto}.xt-check input{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}.xt-check__track{position:relative;flex:0 0 auto;width:40px;height:24px;margin-top:0;border-radius:999px;background:var(--xt-toggle-off);transition:background .15s ease}.xt-check__track:after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 0 2px #0003;transition:transform .15s ease}.xt-check input:checked+.xt-check__track{background:var(--xt-accent)}.xt-check input:checked+.xt-check__track:after{transform:translate(16px)}.xt-check input:focus-visible+.xt-check__track{outline:2px solid var(--xt-accent);outline-offset:2px}.xt-check__title{display:block;font-weight:700;color:var(--xt-fg)}.xt-check__hint{display:block;margin-top:.15rem;font-size:13px;line-height:16px;font-weight:400;color:var(--xt-fg-muted)}.xt-hint{margin:0;padding:4px 0 8px;font-size:13px;line-height:16px;color:var(--xt-fg-muted)}.xt-settings__actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:12px 16px;border-top:1px solid var(--xt-border);background:var(--xt-surface)}.xt-settings__primary,.xt-settings__ghost{appearance:none;border-radius:9999px;font:inherit;font-size:15px;font-weight:700;line-height:20px;padding:8px 16px;cursor:pointer;transition:background .15s ease,border-color .15s ease,opacity .15s ease}.xt-settings__primary{border:0;background:var(--xt-accent);color:#fff;min-height:36px}.xt-settings__primary:hover{background:var(--xt-accent-hover)}.xt-settings__ghost{border:1px solid var(--xt-border);background:transparent;color:var(--xt-fg);align-self:flex-start}.xt-settings__ghost--compact{flex:0 0 auto;padding:8px 16px;align-self:stretch}.xt-settings__ghost:hover{background:var(--xt-hover)}.xt-settings__ghost--danger{border-color:var(--xt-danger-border);color:var(--xt-danger)}.xt-settings__ghost--danger:hover{background:var(--xt-danger-bg);border-color:var(--xt-danger-border)}.xt-about{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:0;border:0;background:transparent}.xt-about__foot{margin:0;font-size:13px;color:var(--xt-fg-muted)}@media(max-width:720px){.xt-settings-backdrop{padding:0;align-items:end}.xt-settings{width:100%;max-height:92vh;border-radius:16px 16px 0 0;border-left:0;border-right:0;border-bottom:0}.xt-toast-host{top:12px;right:12px;width:min(356px,calc(100vw - 24px))}}.xt-provider-panels{display:flex;flex-direction:column;gap:0}.xt-provider-fields{display:none;flex-direction:column;gap:0;padding:4px 0 0;border-radius:0;border:0;border-top:1px solid var(--xt-border);background:transparent}.xt-provider-fields.is-active{display:flex}.xt-cache-meter{display:flex;flex-direction:column;gap:8px;padding:12px 0;border-radius:0;border:0;background:transparent}.xt-cache-meter__top{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem}.xt-cache-meter__title{font-size:13px;font-weight:700;letter-spacing:0;text-transform:none;color:var(--xt-fg-muted)}.xt-cache-meter__pct{font-size:20px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--xt-accent);line-height:1}.xt-cache-meter[data-level=warn] .xt-cache-meter__pct{color:var(--xt-warn)}.xt-cache-meter[data-level=high] .xt-cache-meter__pct{color:var(--xt-danger)}.xt-cache-meter[data-level=off] .xt-cache-meter__pct{color:var(--xt-fg-muted)}.xt-cache-meter__used{font-size:15px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--xt-fg)}.xt-cache-meter__bar{position:relative;height:4px;border-radius:999px;overflow:hidden;background:var(--xt-border);border:0}.xt-cache-meter__fill{display:block;height:100%;border-radius:inherit;background:var(--xt-accent);transition:width .28s cubic-bezier(.22,1,.36,1)}.xt-cache-meter[data-level=warn] .xt-cache-meter__fill{background:var(--xt-warn)}.xt-cache-meter[data-level=high] .xt-cache-meter__fill{background:var(--xt-danger)}.xt-cache-meter[data-level=off] .xt-cache-meter__fill{background:var(--xt-fg-muted)}.xt-cache-meter__meta{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .35rem;font-size:13px;color:var(--xt-fg-muted);font-variant-numeric:tabular-nums}.xt-cache-meter__dot{opacity:.5}.xt-cache-meter__hint{margin:.1rem 0 0;font-size:13px;line-height:16px;color:var(--xt-fg-muted)}.xt-about__desc{margin:0;font-size:15px;line-height:20px;color:var(--xt-fg)}.xt-about__repo{display:inline-flex;align-items:center;align-self:flex-start;gap:.35rem;color:var(--xt-link);font-size:15px;font-weight:400;text-decoration:none}.xt-about__repo:hover{text-decoration:underline}.xt-about__author{display:flex;align-items:center;gap:12px;margin-top:4px;padding:12px 0;border-radius:0;border:0;border-top:1px solid var(--xt-border);border-bottom:1px solid var(--xt-border);background:transparent}.xt-about__avatar{flex:0 0 auto;width:48px;height:48px;border-radius:50%;object-fit:cover;background:var(--xt-elevated)}.xt-about__meta{display:flex;flex-direction:column;gap:.1rem;min-width:0}.xt-about__name{color:var(--xt-fg);font-weight:700;font-size:15px;text-decoration:none}.xt-about__name:hover{color:var(--xt-link);text-decoration:underline}.xt-about__handle{font-size:15px;color:var(--xt-fg-muted)}.xt-about__email{color:var(--xt-link);font-size:13px;text-decoration:none;word-break:break-all}.xt-about__email:hover{text-decoration:underline} '); (function () { 'use strict'; var e=(()=>"undefined"!=typeof GM_getValue?GM_getValue:void 0)(),t=(()=>"undefined"!=typeof GM_registerMenuCommand?GM_registerMenuCommand:void 0)(),n=(()=>"undefined"!=typeof GM_setValue?GM_setValue:void 0)(),a=(()=>"undefined"!=typeof GM_xmlhttpRequest?GM_xmlhttpRequest:void 0)();const o=Object.freeze(["google","deepl","microsoft","openai","yandex","libretranslate"]),i=Object.freeze([{id:"google",name:"Google Translate",badge:"Google",hintKey:"providerHintGoogle",fields:[]},{id:"deepl",name:"DeepL",badge:"DeepL",hintKey:"providerHintDeepl",fields:[{key:"apiKey",type:"password",labelKey:"providerFieldApiKey",hintKey:"providerHintDeeplKey",placeholder:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:fx",required:true},{key:"plan",type:"select",labelKey:"providerFieldDeeplPlan",options:[{value:"free",labelKey:"providerDeeplPlanFree"},{value:"pro",labelKey:"providerDeeplPlanPro"}]}]},{id:"microsoft",name:"Microsoft Translator",badge:"Azure",hintKey:"providerHintMicrosoft",fields:[{key:"apiKey",type:"password",labelKey:"providerFieldApiKey",required:true},{key:"region",type:"text",labelKey:"providerFieldRegion",hintKey:"providerHintMicrosoftRegion",placeholder:"global",required:true}]},{id:"openai",name:"OpenAI",badge:"OpenAI",hintKey:"providerHintOpenai",fields:[{key:"apiKey",type:"password",labelKey:"providerFieldApiKey",required:true},{key:"model",type:"text",labelKey:"providerFieldModel",placeholder:"gpt-4o-mini"},{key:"baseUrl",type:"url",labelKey:"providerFieldBaseUrl",hintKey:"providerHintOpenaiBase",placeholder:"https://api.openai.com/v1"}]},{id:"yandex",name:"Yandex Translate",badge:"Yandex",hintKey:"providerHintYandex",fields:[{key:"apiKey",type:"password",labelKey:"providerFieldApiKey",required:true},{key:"folderId",type:"text",labelKey:"providerFieldFolderId",hintKey:"providerHintYandexFolder",required:true}]},{id:"libretranslate",name:"LibreTranslate",badge:"Libre",hintKey:"providerHintLibre",fields:[{key:"apiUrl",type:"url",labelKey:"providerFieldApiUrl",placeholder:"https://libretranslate.com",required:true},{key:"apiKey",type:"password",labelKey:"providerFieldApiKeyOptional"}]}]),r=Object.freeze({google:{},deepl:{apiKey:"",plan:"free"},microsoft:{apiKey:"",region:"global"},openai:{apiKey:"",model:"gpt-4o-mini",baseUrl:"https://api.openai.com/v1"},yandex:{apiKey:"",folderId:""},libretranslate:{apiUrl:"https://libretranslate.com",apiKey:""}});function l(e){return i.find(t=>t.id===e)||i[0]}function s(e){return o.includes(e)}function c(e){const t={};for(const n of o)t[n]={...r[n],...e&&"object"==typeof e[n]&&e[n]?e[n]:{}};return t}const d="nemoking1210@gmail.com",u="1.3.1",p="xt_settings",g="xt_cache_v1",v="data-xt-root",m="data-xt-post",h="data-xt-btn",f="data-xt-result",b="data-xt-toolbar",A="data-xt-nav",y="data-xt-menu",x=2097152,S=['[data-testid="tweetText"]'],L=Object.freeze([{code:"en",name:"English",flag:"🇺🇸"},{code:"ru",name:"Русский",flag:"🇷🇺"},{code:"uk",name:"Українська",flag:"🇺🇦"},{code:"be",name:"Беларуская",flag:"🇧🇾"},{code:"zh-CN",name:"中文(简体)",flag:"🇨🇳"},{code:"zh-TW",name:"中文(繁體)",flag:"🇹🇼"},{code:"ja",name:"日本語",flag:"🇯🇵"},{code:"ko",name:"한국어",flag:"🇰🇷"},{code:"es",name:"Español",flag:"🇪🇸"},{code:"pt",name:"Português",flag:"🇧🇷"},{code:"de",name:"Deutsch",flag:"🇩🇪"},{code:"fr",name:"Français",flag:"🇫🇷"},{code:"it",name:"Italiano",flag:"🇮🇹"},{code:"pl",name:"Polski",flag:"🇵🇱"},{code:"nl",name:"Nederlands",flag:"🇳🇱"},{code:"tr",name:"Türkçe",flag:"🇹🇷"},{code:"ar",name:"العربية",flag:"🇸🇦"},{code:"he",name:"עברית",flag:"🇮🇱"},{code:"hi",name:"हिन्दी",flag:"🇮🇳"},{code:"bn",name:"বাংলা",flag:"🇧🇩"},{code:"th",name:"ไทย",flag:"🇹🇭"},{code:"vi",name:"Tiếng Việt",flag:"🇻🇳"},{code:"id",name:"Bahasa Indonesia",flag:"🇮🇩"},{code:"ms",name:"Bahasa Melayu",flag:"🇲🇾"},{code:"sv",name:"Svenska",flag:"🇸🇪"},{code:"no",name:"Norsk",flag:"🇳🇴"},{code:"da",name:"Dansk",flag:"🇩🇰"},{code:"fi",name:"Suomi",flag:"🇫🇮"},{code:"cs",name:"Čeština",flag:"🇨🇿"},{code:"sk",name:"Slovenčina",flag:"🇸🇰"},{code:"ro",name:"Română",flag:"🇷🇴"},{code:"hu",name:"Magyar",flag:"🇭🇺"},{code:"el",name:"Ελληνικά",flag:"🇬🇷"},{code:"bg",name:"Български",flag:"🇧🇬"},{code:"sr",name:"Српски",flag:"🇷🇸"},{code:"hr",name:"Hrvatski",flag:"🇭🇷"},{code:"lt",name:"Lietuvių",flag:"🇱🇹"},{code:"lv",name:"Latviešu",flag:"🇱🇻"},{code:"et",name:"Eesti",flag:"🇪🇪"},{code:"fa",name:"فارسی",flag:"🇮🇷"}]),w={cacheHours:24,uiLocale:"auto",targetLang:"auto",translateMode:"button",displayMode:"panel",replaceReveal:"button",autoScope:"all",autoAllowlist:[],accountBlocklist:[],langAllowlist:[],langBlocklist:[],skipNativeAutoTranslate:true,provider:"google",providerConfig:c(null)},T={en:{menuSettings:"X Translator — Settings",navSettings:"Translator",btnTranslate:"Translate",btnHide:"Hide translation",btnRetry:"Retry",translating:"Translating…",translationLabel:"Translation",detectedLang:"Detected: {lang}",errEmpty:"Nothing to translate",errNetwork:"Translation failed. Try again.",settingsTitle:"X Translator",sectionGeneral:"General",sectionTranslation:"Translation",sectionCache:"Cache",sectionProviders:"Providers",settingsProvider:"Translation provider",settingsProviderHint:"Credentials are stored in userscript storage on this device only.",providerFieldApiKey:"API key",providerFieldApiKeyOptional:"API key (optional)",providerFieldDeeplPlan:"DeepL plan",providerDeeplPlanFree:"Free (api-free.deepl.com)",providerDeeplPlanPro:"Pro (api.deepl.com)",providerFieldRegion:"Region",providerFieldModel:"Model",providerFieldBaseUrl:"API base URL",providerFieldFolderId:"Folder ID",providerFieldApiUrl:"API URL",providerHintGoogle:"Uses Google’s public Translate endpoint. No API key required.",providerHintDeepl:"DeepL API Free or Pro. Create a key at deepl.com/pro-api.",providerHintDeeplKey:"Free keys usually end with :fx",providerHintMicrosoft:"Azure Translator resource key from the Azure portal.",providerHintMicrosoftRegion:"Use the resource region, or global for multi-service keys.",providerHintOpenai:"Chat Completions API. Compatible endpoints work if they speak OpenAI’s format.",providerHintOpenaiBase:"Default https://api.openai.com/v1 — change for proxies / compatible hosts.",providerHintYandex:"Yandex Cloud Translate API key + folder ID.",providerHintYandexFolder:"From the Yandex Cloud console (folder / catalog id).",providerHintLibre:"Self-hosted or public LibreTranslate instance.",errProviderConfig:"Provider is not configured. Open Translator settings → Providers.",sectionAbout:"About",aboutDescription:"Userscript that adds in-place post translation on X (x.com). Compatible with Tampermonkey, Violentmonkey, and similar managers.",aboutRepo:"Open repository on GitHub",aboutLicense:"MIT License",settingsGeneral:"General",settingsTargetLang:"Translate into",settingsUiLocale:"Interface language",settingsCacheHours:"Cache translations (hours)",settingsCacheHint:"0 disables the cache. Entries expire by TTL or when you clear the cache.",cacheMeterTitle:"Storage",cacheMeterUsed:"{used} / {limit}",cacheMeterEntries:"{count} entries",cacheMeterTtl:"TTL {hours}h",cacheMeterDisabled:"Cache off",cacheMeterFree:"{free} free",cacheMeterAria:"Cache {used} of {limit} ({pct}), {count} entries",cacheMeterHint:"Soft budget for GM storage. Oldest entries are evicted when full.",settingsDisplayMode:"Translation display",settingsDisplayModeHint:"Panel: show translation under the post. Replace: swap the post text and offer Show original.",displayModePanel:"Separate panel",displayModeReplace:"Replace original text",btnShowOriginal:"Show original",settingsTranslateMode:"Translation mode",settingsTranslateModeHint:"Automatic: translate as soon as a post is even slightly visible on screen. Button: only when you tap Translate.",translateModeButton:"On button click",translateModeAuto:"Automatic (on screen)",badgeModeAuto:"Auto",settingsAutoScope:"Auto-translate scope",settingsAutoScopeHint:"Choose whether every visible post is translated, or only accounts you pick.",autoScopeAll:"All accounts",autoScopeAllowlist:"Selected accounts only",settingsAllowlistHint:"You can also add or remove accounts from a post’s ⋮ menu.",allowlistPlaceholder:"@username",allowlistAdd:"Add",allowlistRemove:"Remove",allowlistEmpty:"No accounts yet. Add a nickname above.",allowlistInvalid:"Enter a valid X handle.",allowlistExists:"{handle} is already in the list",allowlistAdded:"Added {handle} to auto-translate",allowlistRemoved:"Removed {handle} from auto-translate",menuAddAutoAccount:"Auto-translate this account",menuRemoveAutoAccount:"Remove from auto-translate",settingsSave:"Save",settingsClose:"Close",settingsClearCache:"Clear cache",settingsSaved:"Settings saved",settingsCacheCleared:"Translation cache cleared",toastCacheClearedOnUpdate:"Cache cleared after update to {version}",toastCacheClearedOnUpdateTitle:"Updated",toastTitleSuccess:"Success",toastTitleInfo:"Info",toastTitleWarning:"Notice",toastTitleError:"Error",toastDismiss:"Dismiss",langAuto:"Auto (match UI / browser)",localeAuto:"Auto (browser)",badgeLangAuto:"Auto",originalLabel:"Original",settingsReplaceReveal:"Replace mode details",settingsReplaceRevealHint:"Button only, peek original on hover (hides the button after translate), or show original and translation together.",replaceRevealButton:"Button only",replaceRevealHover:"Show original on hover",replaceRevealSplit:"Split view (original + translation)",settingsAccountBlocklist:"Account blocklist",settingsAccountBlocklistHint:"Never show Translate and never auto-translate these accounts. Also available from a post's menu.",blocklistEmpty:"No blocked accounts.",blocklistAdded:"Blocked {handle} from translation",blocklistRemoved:"Unblocked {handle}",menuBlockAccount:"Never translate this account",menuUnblockAccount:"Allow translating this account",settingsLangAllowlist:"Source language allowlist",settingsLangAllowlistHint:"If not empty, only posts detected as these languages are translated. Leave empty for all.",settingsLangBlocklist:"Source language blocklist",settingsLangBlocklistHint:"Skip posts detected as these languages.",settingsSkipNative:"Skip posts X already auto-translated",settingsSkipNativeHint:"When X shows its translation bar (Show original), don’t add Translate or auto-translate.",langListEmpty:"No languages selected.",langListAdd:"Add",langListExists:"{lang} is already in the list",langSkippedBlocked:"Skipped: source language is blocked",langSkippedNotAllowed:"Skipped: source language is not in the allowlist",settingsSectionInterface:"Interface",settingsSectionTranslate:"Translation",settingsSectionAccounts:"Accounts",settingsSectionLanguages:"Languages",settingsSectionProvider:"Provider",settingsSectionCache:"Cache",badgeCacheOff:"Off"},ru:{menuSettings:"X Translator — Настройки",navSettings:"Переводчик",btnTranslate:"Перевести",btnHide:"Скрыть перевод",btnRetry:"Повторить",translating:"Перевод…",translationLabel:"Перевод",detectedLang:"Определён язык: {lang}",errEmpty:"Нечего переводить",errNetwork:"Не удалось перевести. Попробуйте ещё раз.",settingsTitle:"X Translator",sectionGeneral:"Общие",sectionTranslation:"Перевод",sectionCache:"Кэш",sectionProviders:"Провайдеры",settingsProvider:"Провайдер перевода",settingsProviderHint:"Ключи хранятся только в хранилище userscript на этом устройстве.",providerFieldApiKey:"API-ключ",providerFieldApiKeyOptional:"API-ключ (необязательно)",providerFieldDeeplPlan:"Тариф DeepL",providerDeeplPlanFree:"Free (api-free.deepl.com)",providerDeeplPlanPro:"Pro (api.deepl.com)",providerFieldRegion:"Регион",providerFieldModel:"Модель",providerFieldBaseUrl:"Базовый URL API",providerFieldFolderId:"Folder ID",providerFieldApiUrl:"URL API",providerHintGoogle:"Публичный endpoint Google Translate. API-ключ не нужен.",providerHintDeepl:"DeepL API Free или Pro. Ключ: deepl.com/pro-api.",providerHintDeeplKey:"У бесплатных ключей обычно суффикс :fx",providerHintMicrosoft:"Ключ ресурса Azure Translator из портала Azure.",providerHintMicrosoftRegion:"Регион ресурса или global для multi-service ключей.",providerHintOpenai:"Chat Completions API. Подойдут совместимые endpoint’ы.",providerHintOpenaiBase:"По умолчанию https://api.openai.com/v1 — смените для прокси.",providerHintYandex:"API-ключ Yandex Cloud Translate и folder ID.",providerHintYandexFolder:"Из консоли Yandex Cloud (id каталога).",providerHintLibre:"Свой или публичный экземпляр LibreTranslate.",errProviderConfig:"Провайдер не настроен. Откройте Translator → Провайдеры.",sectionAbout:"О скрипте",aboutDescription:"Userscript для перевода постов прямо на X (x.com). Совместим с Tampermonkey, Violentmonkey и похожими менеджерами.",aboutRepo:"Открыть репозиторий на GitHub",aboutLicense:"Лицензия MIT",settingsGeneral:"Общие",settingsTargetLang:"Переводить на",settingsUiLocale:"Язык интерфейса",settingsCacheHours:"Кэш переводов (часы)",settingsCacheHint:"0 отключает кэш. Записи истекают по TTL или при ручной очистке.",cacheMeterTitle:"Занято",cacheMeterUsed:"{used} / {limit}",cacheMeterEntries:"{count} записей",cacheMeterTtl:"TTL {hours} ч",cacheMeterDisabled:"Кэш выкл.",cacheMeterFree:"свободно {free}",cacheMeterAria:"Кэш {used} из {limit} ({pct}), записей: {count}",cacheMeterHint:"Мягкий лимит GM-хранилища. При переполнении удаляются самые старые записи.",settingsDisplayMode:"Отображение перевода",settingsDisplayModeHint:"Панель: перевод под постом. Замена: текст поста меняется на перевод, кнопка «Показать оригинал».",displayModePanel:"Отдельная панель",displayModeReplace:"Вместо оригинала",btnShowOriginal:"Показать оригинал",settingsTranslateMode:"Режим перевода",settingsTranslateModeHint:"Автоматический: перевод, как только пост хоть чуть-чуть виден на экране. По кнопке: только после нажатия «Перевести».",translateModeButton:"По кнопке",translateModeAuto:"Автоматический (на экране)",badgeModeAuto:"Авто",settingsAutoScope:"Область автоперевода",settingsAutoScopeHint:"Переводить все видимые посты или только выбранные аккаунты.",autoScopeAll:"Все аккаунты",autoScopeAllowlist:"Только избранные аккаунты",settingsAllowlistHint:"Аккаунт можно добавить или убрать и из меню ⋮ у поста.",allowlistPlaceholder:"@username",allowlistAdd:"Добавить",allowlistRemove:"Удалить",allowlistEmpty:"Список пуст. Введите nickname выше.",allowlistInvalid:"Введите корректный X handle.",allowlistExists:"{handle} уже в списке",allowlistAdded:"{handle} добавлен в автоперевод",allowlistRemoved:"{handle} убран из автоперевода",menuAddAutoAccount:"Автоперевод этого аккаунта",menuRemoveAutoAccount:"Убрать из автоперевода",settingsSave:"Сохранить",settingsClose:"Закрыть",settingsClearCache:"Очистить кэш",settingsSaved:"Настройки сохранены",settingsCacheCleared:"Кэш переводов очищен",toastCacheClearedOnUpdate:"Кэш очищен после обновления до {version}",toastCacheClearedOnUpdateTitle:"Обновлено",toastTitleSuccess:"Готово",toastTitleInfo:"Инфо",toastTitleWarning:"Внимание",toastTitleError:"Ошибка",toastDismiss:"Закрыть",langAuto:"Авто (как UI / браузер)",localeAuto:"Авто (браузер)",badgeLangAuto:"Авто",originalLabel:"Оригинал",settingsReplaceReveal:"Детали режима замены",settingsReplaceRevealHint:"Только кнопка, оригинал по наведению (кнопка скрывается после перевода) или оригинал и перевод рядом.",replaceRevealButton:"Только кнопка",replaceRevealHover:"Оригинал по наведению",replaceRevealSplit:"Разделённый вид (оригинал + перевод)",settingsAccountBlocklist:"Блоклист аккаунтов",settingsAccountBlocklistHint:"Не показывать «Перевести» и не автопереводить эти аккаунты. Также из меню поста.",blocklistEmpty:"Заблокированных аккаунтов нет.",blocklistAdded:"{handle} исключён из перевода",blocklistRemoved:"{handle} снова можно переводить",menuBlockAccount:"Не переводить этот аккаунт",menuUnblockAccount:"Разрешить перевод этого аккаунта",settingsLangAllowlist:"Разрешённые языки оригинала",settingsLangAllowlistHint:"Если список не пуст — переводятся только посты на этих языках. Пустой список = все языки.",settingsLangBlocklist:"Запрещённые языки оригинала",settingsLangBlocklistHint:"Пропускать посты на этих языках.",settingsSkipNative:"Пропускать посты с автопереводом X",settingsSkipNativeHint:"Если X уже показывает панель перевода («Показать оригинал»), не добавлять нашу кнопку и не автопереводить.",langListEmpty:"Языки не выбраны.",langListAdd:"Добавить",langListExists:"{lang} уже в списке",langSkippedBlocked:"Пропущено: язык в блоклисте",langSkippedNotAllowed:"Пропущено: языка нет в списке разрешённых",settingsSectionInterface:"Интерфейс",settingsSectionTranslate:"Перевод",settingsSectionAccounts:"Аккаунты",settingsSectionLanguages:"Языки",settingsSectionProvider:"Провайдер",settingsSectionCache:"Кэш",badgeCacheOff:"Выкл"},zh:{menuSettings:"X Translator — 设置",navSettings:"翻译",btnTranslate:"翻译",btnHide:"隐藏翻译",btnRetry:"重试",translating:"翻译中…",translationLabel:"译文",detectedLang:"检测到:{lang}",errEmpty:"没有可翻译的内容",errNetwork:"翻译失败,请重试。",settingsTitle:"X Translator",sectionGeneral:"常规",sectionTranslation:"翻译",sectionCache:"缓存",sectionProviders:"服务商",settingsProvider:"翻译服务商",settingsProviderHint:"密钥仅保存在本机的 userscript 存储中。",providerFieldApiKey:"API 密钥",providerFieldApiKeyOptional:"API 密钥(可选)",providerFieldDeeplPlan:"DeepL 套餐",providerDeeplPlanFree:"Free (api-free.deepl.com)",providerDeeplPlanPro:"Pro (api.deepl.com)",providerFieldRegion:"区域",providerFieldModel:"模型",providerFieldBaseUrl:"API 基址",providerFieldFolderId:"Folder ID",providerFieldApiUrl:"API URL",providerHintGoogle:"使用 Google 公开翻译接口,无需 API 密钥。",providerHintDeepl:"DeepL API Free 或 Pro。在 deepl.com/pro-api 创建密钥。",providerHintDeeplKey:"免费密钥通常以 :fx 结尾",providerHintMicrosoft:"Azure 门户中的 Translator 资源密钥。",providerHintMicrosoftRegion:"填写资源区域,或多服务密钥可用 global。",providerHintOpenai:"Chat Completions API。兼容 OpenAI 格式的接口也可。",providerHintOpenaiBase:"默认 https://api.openai.com/v1,代理可改。",providerHintYandex:"Yandex Cloud Translate 的 API 密钥与 folder ID。",providerHintYandexFolder:"来自 Yandex Cloud 控制台。",providerHintLibre:"自建或公共 LibreTranslate 实例。",errProviderConfig:"服务商未配置。请打开 Translator 设置 → 服务商。",sectionAbout:"关于",aboutDescription:"在 X(x.com)上就地翻译帖子的用户脚本。兼容 Tampermonkey、Violentmonkey 等管理器。",aboutRepo:"在 GitHub 打开仓库",aboutLicense:"MIT 许可证",settingsGeneral:"常规",settingsTargetLang:"翻译为",settingsUiLocale:"界面语言",settingsCacheHours:"翻译缓存(小时)",settingsCacheHint:"设为 0 可禁用缓存。条目按 TTL 过期,或可手动清空。",cacheMeterTitle:"占用",cacheMeterUsed:"{used} / {limit}",cacheMeterEntries:"{count} 条",cacheMeterTtl:"TTL {hours} 小时",cacheMeterDisabled:"缓存已关闭",cacheMeterFree:"剩余 {free}",cacheMeterAria:"缓存 {used} / {limit}({pct}),共 {count} 条",cacheMeterHint:"GM 存储的软性上限。满时会淘汰最旧条目。",settingsDisplayMode:"译文显示方式",settingsDisplayModeHint:"面板:在帖子下方显示译文。替换:用译文替换原文,并提供“显示原文”。",displayModePanel:"单独面板",displayModeReplace:"替换原文",btnShowOriginal:"显示原文",settingsTranslateMode:"翻译模式",settingsTranslateModeHint:"自动:帖子只要在屏幕上露出一点就开始翻译。按钮:仅在点击「翻译」时。",translateModeButton:"点击按钮",translateModeAuto:"自动(出现在屏幕上)",badgeModeAuto:"自动",settingsAutoScope:"自动翻译范围",settingsAutoScopeHint:"翻译所有可见帖子,或仅翻译你选择的账号。",autoScopeAll:"所有账号",autoScopeAllowlist:"仅选定账号",settingsAllowlistHint:"也可在帖子 ⋮ 菜单中添加或移除账号。",allowlistPlaceholder:"@username",allowlistAdd:"添加",allowlistRemove:"移除",allowlistEmpty:"暂无账号。请在上方输入昵称。",allowlistInvalid:"请输入有效的 X 用户名。",allowlistExists:"{handle} 已在列表中",allowlistAdded:"已将 {handle} 加入自动翻译",allowlistRemoved:"已将 {handle} 移出自动翻译",menuAddAutoAccount:"自动翻译此账号",menuRemoveAutoAccount:"移出自动翻译",settingsSave:"保存",settingsClose:"关闭",settingsClearCache:"清除缓存",settingsSaved:"设置已保存",settingsCacheCleared:"翻译缓存已清除",toastCacheClearedOnUpdate:"已更新至 {version},缓存已清除",toastCacheClearedOnUpdateTitle:"已更新",toastTitleSuccess:"成功",toastTitleInfo:"提示",toastTitleWarning:"注意",toastTitleError:"错误",toastDismiss:"关闭",langAuto:"自动(跟随界面 / 浏览器)",localeAuto:"自动(浏览器)",badgeLangAuto:"自动",originalLabel:"原文",settingsReplaceReveal:"替换模式详情",settingsReplaceRevealHint:"仅按钮、悬停显示原文,或原文与译文并排。",replaceRevealButton:"仅按钮",replaceRevealHover:"悬停显示原文",replaceRevealSplit:"分栏(原文 + 译文)",settingsAccountBlocklist:"账号黑名单",settingsAccountBlocklistHint:"不显示翻译按钮且不自动翻译这些账号。也可在帖子菜单中管理。",blocklistEmpty:"暂无屏蔽账号。",blocklistAdded:"已屏蔽 {handle}",blocklistRemoved:"已取消屏蔽 {handle}",menuBlockAccount:"永不翻译此账号",menuUnblockAccount:"允许翻译此账号",settingsLangAllowlist:"源语言白名单",settingsLangAllowlistHint:"非空时仅翻译检测到的这些语言。留空表示全部。",settingsLangBlocklist:"源语言黑名单",settingsLangBlocklistHint:"跳过这些源语言的帖子。",settingsSkipNative:"跳过已被 X 自动翻译的帖子",settingsSkipNativeHint:"当 X 已显示翻译栏(显示原文)时,不添加翻译按钮,也不自动翻译。",langListEmpty:"尚未选择语言。",langListAdd:"添加",langListExists:"{lang} 已在列表中",langSkippedBlocked:"已跳过:源语言在黑名单中",langSkippedNotAllowed:"已跳过:源语言不在白名单中",settingsSectionInterface:"界面",settingsSectionTranslate:"翻译",settingsSectionAccounts:"账号",settingsSectionLanguages:"语言",settingsSectionProvider:"服务商",settingsSectionCache:"缓存",badgeCacheOff:"关"},es:{menuSettings:"X Translator — Ajustes",navSettings:"Traductor",btnTranslate:"Traducir",btnHide:"Ocultar traducción",btnRetry:"Reintentar",translating:"Traduciendo…",translationLabel:"Traducción",detectedLang:"Detectado: {lang}",errEmpty:"No hay nada que traducir",errNetwork:"Error al traducir. Inténtalo de nuevo.",settingsTitle:"X Translator",sectionGeneral:"General",sectionTranslation:"Traducción",sectionCache:"Caché",sectionProviders:"Proveedores",settingsProvider:"Proveedor de traducción",settingsProviderHint:"Las credenciales se guardan solo en el almacenamiento del userscript de este dispositivo.",providerFieldApiKey:"Clave API",providerFieldApiKeyOptional:"Clave API (opcional)",providerFieldDeeplPlan:"Plan DeepL",providerDeeplPlanFree:"Free (api-free.deepl.com)",providerDeeplPlanPro:"Pro (api.deepl.com)",providerFieldRegion:"Región",providerFieldModel:"Modelo",providerFieldBaseUrl:"URL base de la API",providerFieldFolderId:"Folder ID",providerFieldApiUrl:"URL de la API",providerHintGoogle:"Endpoint público de Google Translate. No requiere clave.",providerHintDeepl:"DeepL API Free o Pro. Crea una clave en deepl.com/pro-api.",providerHintDeeplKey:"Las claves Free suelen terminar en :fx",providerHintMicrosoft:"Clave del recurso Azure Translator en el portal de Azure.",providerHintMicrosoftRegion:"Región del recurso, o global para claves multi-servicio.",providerHintOpenai:"API Chat Completions. Endpoints compatibles también sirven.",providerHintOpenaiBase:"Por defecto https://api.openai.com/v1 — cámbiala para proxies.",providerHintYandex:"Clave API de Yandex Cloud Translate + folder ID.",providerHintYandexFolder:"Desde la consola de Yandex Cloud.",providerHintLibre:"Instancia LibreTranslate propia o pública.",errProviderConfig:"Proveedor sin configurar. Abre Translator → Proveedores.",sectionAbout:"Acerca de",aboutDescription:"Userscript que traduce publicaciones de X in situ en x.com. Compatible con Tampermonkey, Violentmonkey y similares.",aboutRepo:"Abrir repositorio en GitHub",aboutLicense:"Licencia MIT",settingsGeneral:"General",settingsTargetLang:"Traducir a",settingsUiLocale:"Idioma de la interfaz",settingsCacheHours:"Caché de traducciones (horas)",settingsCacheHint:"0 desactiva la caché. Las entradas caducan por TTL o al vaciarla.",cacheMeterTitle:"Uso",cacheMeterUsed:"{used} / {limit}",cacheMeterEntries:"{count} entradas",cacheMeterTtl:"TTL {hours} h",cacheMeterDisabled:"Caché off",cacheMeterFree:"{free} libres",cacheMeterAria:"Caché {used} de {limit} ({pct}), {count} entradas",cacheMeterHint:"Límite blando del almacenamiento GM. Si se llena, se eliminan las entradas más antiguas.",settingsDisplayMode:"Visualización de la traducción",settingsDisplayModeHint:"Panel: mostrar la traducción bajo el post. Reemplazar: cambiar el texto y ofrecer Mostrar original.",displayModePanel:"Panel separado",displayModeReplace:"Reemplazar el original",btnShowOriginal:"Mostrar original",settingsTranslateMode:"Modo de traducción",settingsTranslateModeHint:"Automático: traduce en cuanto la publicación es visible aunque sea un poco. Botón: solo al pulsar Traducir.",translateModeButton:"Al pulsar el botón",translateModeAuto:"Automático (en pantalla)",badgeModeAuto:"Auto",settingsAutoScope:"Alcance del autotraducido",settingsAutoScopeHint:"Traducir todos los posts visibles o solo las cuentas que elijas.",autoScopeAll:"Todas las cuentas",autoScopeAllowlist:"Solo cuentas seleccionadas",settingsAllowlistHint:"También puedes añadir o quitar cuentas desde el menú ⋮ del post.",allowlistPlaceholder:"@username",allowlistAdd:"Añadir",allowlistRemove:"Quitar",allowlistEmpty:"Sin cuentas. Escribe un nickname arriba.",allowlistInvalid:"Introduce un handle de X válido.",allowlistExists:"{handle} ya está en la lista",allowlistAdded:"Se añadió {handle} al autotraducido",allowlistRemoved:"Se quitó {handle} del autotraducido",menuAddAutoAccount:"Autotraducir esta cuenta",menuRemoveAutoAccount:"Quitar del autotraducido",settingsSave:"Guardar",settingsClose:"Cerrar",settingsClearCache:"Vaciar caché",settingsSaved:"Ajustes guardados",settingsCacheCleared:"Caché de traducciones vaciada",toastCacheClearedOnUpdate:"Caché vaciada tras actualizar a {version}",toastCacheClearedOnUpdateTitle:"Actualizado",toastTitleSuccess:"Listo",toastTitleInfo:"Info",toastTitleWarning:"Aviso",toastTitleError:"Error",toastDismiss:"Cerrar",langAuto:"Auto (igual que UI / navegador)",localeAuto:"Auto (navegador)",badgeLangAuto:"Auto",originalLabel:"Original",settingsReplaceReveal:"Detalles del modo reemplazo",settingsReplaceRevealHint:"Solo botón, original al pasar el cursor, o ambos juntos.",replaceRevealButton:"Solo botón",replaceRevealHover:"Original al pasar el cursor",replaceRevealSplit:"Vista dividida (original + traducción)",settingsAccountBlocklist:"Lista de bloqueo de cuentas",settingsAccountBlocklistHint:"No mostrar Traducir ni autotraducir estas cuentas. También desde el menú del post.",blocklistEmpty:"No hay cuentas bloqueadas.",blocklistAdded:"Se bloqueó {handle}",blocklistRemoved:"Se desbloqueó {handle}",menuBlockAccount:"Nunca traducir esta cuenta",menuUnblockAccount:"Permitir traducir esta cuenta",settingsLangAllowlist:"Idiomas de origen permitidos",settingsLangAllowlistHint:"Si no está vacía, solo se traducen estos idiomas. Vacía = todos.",settingsLangBlocklist:"Idiomas de origen bloqueados",settingsLangBlocklistHint:"Omitir publicaciones en estos idiomas.",settingsSkipNative:"Omitir posts que X ya autotradujo",settingsSkipNativeHint:"Si X ya muestra su barra de traducción (Mostrar original), no añadir Traducir ni autotraducir.",langListEmpty:"Ningún idioma seleccionado.",langListAdd:"Añadir",langListExists:"{lang} ya está en la lista",langSkippedBlocked:"Omitido: idioma bloqueado",langSkippedNotAllowed:"Omitido: idioma no permitido",settingsSectionInterface:"Interfaz",settingsSectionTranslate:"Traducción",settingsSectionAccounts:"Cuentas",settingsSectionLanguages:"Idiomas",settingsSectionProvider:"Proveedor",settingsSectionCache:"Caché",badgeCacheOff:"Off"},pt:{menuSettings:"X Translator — Configurações",navSettings:"Tradutor",btnTranslate:"Traduzir",btnHide:"Ocultar tradução",btnRetry:"Tentar de novo",translating:"Traduzindo…",translationLabel:"Tradução",detectedLang:"Detectado: {lang}",errEmpty:"Nada para traduzir",errNetwork:"Falha na tradução. Tente novamente.",settingsTitle:"X Translator",sectionGeneral:"Geral",sectionTranslation:"Tradução",sectionCache:"Cache",sectionProviders:"Provedores",settingsProvider:"Provedor de tradução",settingsProviderHint:"As credenciais ficam só no armazenamento do userscript neste dispositivo.",providerFieldApiKey:"Chave de API",providerFieldApiKeyOptional:"Chave de API (opcional)",providerFieldDeeplPlan:"Plano DeepL",providerDeeplPlanFree:"Free (api-free.deepl.com)",providerDeeplPlanPro:"Pro (api.deepl.com)",providerFieldRegion:"Região",providerFieldModel:"Modelo",providerFieldBaseUrl:"URL base da API",providerFieldFolderId:"Folder ID",providerFieldApiUrl:"URL da API",providerHintGoogle:"Endpoint público do Google Translate. Sem chave de API.",providerHintDeepl:"DeepL API Free ou Pro. Crie uma chave em deepl.com/pro-api.",providerHintDeeplKey:"Chaves Free costumam terminar com :fx",providerHintMicrosoft:"Chave do recurso Azure Translator no portal Azure.",providerHintMicrosoftRegion:"Região do recurso, ou global para chaves multi-serviço.",providerHintOpenai:"API Chat Completions. Endpoints compatíveis também funcionam.",providerHintOpenaiBase:"Padrão https://api.openai.com/v1 — altere para proxies.",providerHintYandex:"Chave API do Yandex Cloud Translate + folder ID.",providerHintYandexFolder:"No console do Yandex Cloud.",providerHintLibre:"Instância LibreTranslate própria ou pública.",errProviderConfig:"Provedor não configurado. Abra Translator → Provedores.",sectionAbout:"Sobre",aboutDescription:"Userscript que traduz posts do X no próprio x.com. Compatível com Tampermonkey, Violentmonkey e similares.",aboutRepo:"Abrir repositório no GitHub",aboutLicense:"Licença MIT",settingsGeneral:"Geral",settingsTargetLang:"Traduzir para",settingsUiLocale:"Idioma da interface",settingsCacheHours:"Cache de traduções (horas)",settingsCacheHint:"0 desativa o cache. As entradas expiram pelo TTL ou ao limpar.",cacheMeterTitle:"Uso",cacheMeterUsed:"{used} / {limit}",cacheMeterEntries:"{count} itens",cacheMeterTtl:"TTL {hours} h",cacheMeterDisabled:"Cache off",cacheMeterFree:"{free} livres",cacheMeterAria:"Cache {used} de {limit} ({pct}), {count} itens",cacheMeterHint:"Limite suave do armazenamento GM. Quando cheio, remove as entradas mais antigas.",settingsDisplayMode:"Exibição da tradução",settingsDisplayModeHint:"Painel: mostrar a tradução abaixo do post. Substituir: trocar o texto e oferecer Mostrar original.",displayModePanel:"Painel separado",displayModeReplace:"Substituir o original",btnShowOriginal:"Mostrar original",settingsTranslateMode:"Modo de tradução",settingsTranslateModeHint:"Automático: traduz assim que o post fica um pouco visível. Botão: só ao tocar em Traduzir.",translateModeButton:"Ao clicar no botão",translateModeAuto:"Automático (na tela)",badgeModeAuto:"Auto",settingsAutoScope:"Escopo da tradução automática",settingsAutoScopeHint:"Traduzir todos os posts visíveis ou só as contas escolhidas.",autoScopeAll:"Todas as contas",autoScopeAllowlist:"Apenas contas selecionadas",settingsAllowlistHint:"Também pode adicionar ou remover contas no menu ⋮ do post.",allowlistPlaceholder:"@username",allowlistAdd:"Adicionar",allowlistRemove:"Remover",allowlistEmpty:"Nenhuma conta. Digite um nickname acima.",allowlistInvalid:"Digite um handle válido do X.",allowlistExists:"{handle} já está na lista",allowlistAdded:"{handle} adicionado à tradução automática",allowlistRemoved:"{handle} removido da tradução automática",menuAddAutoAccount:"Traduzir automaticamente esta conta",menuRemoveAutoAccount:"Remover da tradução automática",settingsSave:"Salvar",settingsClose:"Fechar",settingsClearCache:"Limpar cache",settingsSaved:"Configurações salvas",settingsCacheCleared:"Cache de traduções limpo",toastCacheClearedOnUpdate:"Cache limpo após atualizar para {version}",toastCacheClearedOnUpdateTitle:"Atualizado",toastTitleSuccess:"Sucesso",toastTitleInfo:"Info",toastTitleWarning:"Aviso",toastTitleError:"Erro",toastDismiss:"Fechar",langAuto:"Auto (igual à UI / navegador)",localeAuto:"Auto (navegador)",badgeLangAuto:"Auto",originalLabel:"Original",settingsReplaceReveal:"Detalhes do modo substituir",settingsReplaceRevealHint:"Só botão, original ao passar o mouse, ou ambos juntos.",replaceRevealButton:"Só botão",replaceRevealHover:"Original ao passar o mouse",replaceRevealSplit:"Visão dividida (original + tradução)",settingsAccountBlocklist:"Lista de bloqueio de contas",settingsAccountBlocklistHint:"Não mostrar Traduzir nem traduzir automaticamente essas contas. Também no menu do post.",blocklistEmpty:"Nenhuma conta bloqueada.",blocklistAdded:"{handle} bloqueado",blocklistRemoved:"{handle} desbloqueado",menuBlockAccount:"Nunca traduzir esta conta",menuUnblockAccount:"Permitir traduzir esta conta",settingsLangAllowlist:"Idiomas de origem permitidos",settingsLangAllowlistHint:"Se não estiver vazia, só traduz esses idiomas. Vazia = todos.",settingsLangBlocklist:"Idiomas de origem bloqueados",settingsLangBlocklistHint:"Ignorar posts nesses idiomas.",settingsSkipNative:"Ignorar posts que o X já traduziu automaticamente",settingsSkipNativeHint:"Quando o X já mostra a barra de tradução (Mostrar original), não adicionar Traduzir nem traduzir automaticamente.",langListEmpty:"Nenhum idioma selecionado.",langListAdd:"Adicionar",langListExists:"{lang} já está na lista",langSkippedBlocked:"Ignorado: idioma bloqueado",langSkippedNotAllowed:"Ignorado: idioma não permitido",settingsSectionInterface:"Interface",settingsSectionTranslate:"Tradução",settingsSectionAccounts:"Contas",settingsSectionLanguages:"Idiomas",settingsSectionProvider:"Provedor",settingsSectionCache:"Cache",badgeCacheOff:"Off"},de:{menuSettings:"X Translator — Einstellungen",navSettings:"Übersetzer",btnTranslate:"Übersetzen",btnHide:"Übersetzung ausblenden",btnRetry:"Erneut versuchen",translating:"Übersetze…",translationLabel:"Übersetzung",detectedLang:"Erkannt: {lang}",errEmpty:"Nichts zu übersetzen",errNetwork:"Übersetzung fehlgeschlagen. Bitte erneut versuchen.",settingsTitle:"X Translator",sectionGeneral:"Allgemein",sectionTranslation:"Übersetzung",sectionCache:"Cache",sectionProviders:"Anbieter",settingsProvider:"Übersetzungsanbieter",settingsProviderHint:"Zugangsdaten werden nur im Userscript-Speicher dieses Geräts gespeichert.",providerFieldApiKey:"API-Schlüssel",providerFieldApiKeyOptional:"API-Schlüssel (optional)",providerFieldDeeplPlan:"DeepL-Tarif",providerDeeplPlanFree:"Free (api-free.deepl.com)",providerDeeplPlanPro:"Pro (api.deepl.com)",providerFieldRegion:"Region",providerFieldModel:"Modell",providerFieldBaseUrl:"API-Basis-URL",providerFieldFolderId:"Folder ID",providerFieldApiUrl:"API-URL",providerHintGoogle:"Öffentlicher Google-Translate-Endpunkt. Kein API-Schlüssel nötig.",providerHintDeepl:"DeepL API Free oder Pro. Schlüssel unter deepl.com/pro-api.",providerHintDeeplKey:"Free-Schlüssel enden meist mit :fx",providerHintMicrosoft:"Azure-Translator-Ressourcenschlüssel im Azure-Portal.",providerHintMicrosoftRegion:"Ressourcenregion oder global für Multi-Service-Schlüssel.",providerHintOpenai:"Chat-Completions-API. Kompatible Endpunkte funktionieren ebenfalls.",providerHintOpenaiBase:"Standard https://api.openai.com/v1 — für Proxys ändern.",providerHintYandex:"Yandex Cloud Translate API-Schlüssel + Folder ID.",providerHintYandexFolder:"Aus der Yandex-Cloud-Konsole.",providerHintLibre:"Eigene oder öffentliche LibreTranslate-Instanz.",errProviderConfig:"Anbieter nicht konfiguriert. Öffne Translator → Anbieter.",sectionAbout:"Über",aboutDescription:"Userscript, das X-Posts direkt auf x.com übersetzt. Kompatibel mit Tampermonkey, Violentmonkey und ähnlichen Managern.",aboutRepo:"Repository auf GitHub öffnen",aboutLicense:"MIT-Lizenz",settingsGeneral:"Allgemein",settingsTargetLang:"Übersetzen nach",settingsUiLocale:"Oberflächensprache",settingsCacheHours:"Übersetzungscache (Stunden)",settingsCacheHint:"0 deaktiviert den Cache. Einträge laufen per TTL ab oder bei manueller Löschung.",cacheMeterTitle:"Belegt",cacheMeterUsed:"{used} / {limit}",cacheMeterEntries:"{count} Einträge",cacheMeterTtl:"TTL {hours} Std.",cacheMeterDisabled:"Cache aus",cacheMeterFree:"{free} frei",cacheMeterAria:"Cache {used} von {limit} ({pct}), {count} Einträge",cacheMeterHint:"Weiches Limit für GM-Speicher. Bei Überlauf werden die ältesten Einträge entfernt.",settingsDisplayMode:"Anzeige der Übersetzung",settingsDisplayModeHint:"Panel: Übersetzung unter dem Post. Ersetzen: Posttext tauschen und Original anzeigen anbieten.",displayModePanel:"Separates Panel",displayModeReplace:"Original ersetzen",btnShowOriginal:"Original anzeigen",settingsTranslateMode:"Übersetzungsmodus",settingsTranslateModeHint:"Automatisch: übersetzen, sobald ein Post auch nur leicht sichtbar ist. Taste: nur nach Tippen auf Übersetzen.",translateModeButton:"Per Schaltfläche",translateModeAuto:"Automatisch (am Bildschirm)",badgeModeAuto:"Auto",settingsAutoScope:"Bereich der Auto-Übersetzung",settingsAutoScopeHint:"Alle sichtbaren Posts übersetzen oder nur ausgewählte Konten.",autoScopeAll:"Alle Konten",autoScopeAllowlist:"Nur ausgewählte Konten",settingsAllowlistHint:"Konten kannst du auch im ⋮-Menü eines Posts hinzufügen oder entfernen.",allowlistPlaceholder:"@username",allowlistAdd:"Hinzufügen",allowlistRemove:"Entfernen",allowlistEmpty:"Noch keine Konten. Nickname oben eingeben.",allowlistInvalid:"Gib einen gültigen X-Handle ein.",allowlistExists:"{handle} ist bereits in der Liste",allowlistAdded:"{handle} zur Auto-Übersetzung hinzugefügt",allowlistRemoved:"{handle} aus der Auto-Übersetzung entfernt",menuAddAutoAccount:"Dieses Konto automatisch übersetzen",menuRemoveAutoAccount:"Aus Auto-Übersetzung entfernen",settingsSave:"Speichern",settingsClose:"Schließen",settingsClearCache:"Cache leeren",settingsSaved:"Einstellungen gespeichert",settingsCacheCleared:"Übersetzungscache geleert",toastCacheClearedOnUpdate:"Cache nach Update auf {version} geleert",toastCacheClearedOnUpdateTitle:"Aktualisiert",toastTitleSuccess:"Erfolg",toastTitleInfo:"Info",toastTitleWarning:"Hinweis",toastTitleError:"Fehler",toastDismiss:"Schließen",langAuto:"Auto (wie UI / Browser)",localeAuto:"Auto (Browser)",badgeLangAuto:"Auto",originalLabel:"Original",settingsReplaceReveal:"Details zum Ersetzen-Modus",settingsReplaceRevealHint:"Nur Schaltfläche, Original beim Hover oder beides zusammen.",replaceRevealButton:"Nur Schaltfläche",replaceRevealHover:"Original beim Hover",replaceRevealSplit:"Geteilte Ansicht (Original + Übersetzung)",settingsAccountBlocklist:"Konto-Sperrliste",settingsAccountBlocklistHint:"Keine Übersetzen-Schaltfläche und kein Auto-Übersetzen für diese Konten. Auch im Post-Menü.",blocklistEmpty:"Keine gesperrten Konten.",blocklistAdded:"{handle} gesperrt",blocklistRemoved:"{handle} entsperrt",menuBlockAccount:"Dieses Konto nie übersetzen",menuUnblockAccount:"Übersetzung für dieses Konto erlauben",settingsLangAllowlist:"Erlaubte Ausgangssprachen",settingsLangAllowlistHint:"Wenn nicht leer, nur diese Sprachen übersetzen. Leer = alle.",settingsLangBlocklist:"Gesperrte Ausgangssprachen",settingsLangBlocklistHint:"Beiträge in diesen Sprachen überspringen.",settingsSkipNative:"Von X bereits automatisch übersetzte Beiträge überspringen",settingsSkipNativeHint:"Wenn X bereits seine Übersetzungsleiste zeigt (Original anzeigen), keine Übersetzen-Schaltfläche und keine Auto-Übersetzung.",langListEmpty:"Keine Sprachen ausgewählt.",langListAdd:"Hinzufügen",langListExists:"{lang} ist bereits in der Liste",langSkippedBlocked:"Übersprungen: Sprache gesperrt",langSkippedNotAllowed:"Übersprungen: Sprache nicht erlaubt",settingsSectionInterface:"Oberfläche",settingsSectionTranslate:"Übersetzung",settingsSectionAccounts:"Konten",settingsSectionLanguages:"Sprachen",settingsSectionProvider:"Anbieter",settingsSectionCache:"Cache",badgeCacheOff:"Aus"},fr:{menuSettings:"X Translator — Paramètres",navSettings:"Traducteur",btnTranslate:"Traduire",btnHide:"Masquer la traduction",btnRetry:"Réessayer",translating:"Traduction…",translationLabel:"Traduction",detectedLang:"Détecté : {lang}",errEmpty:"Rien à traduire",errNetwork:"Échec de la traduction. Réessayez.",settingsTitle:"X Translator",sectionGeneral:"Général",sectionTranslation:"Traduction",sectionCache:"Cache",sectionProviders:"Fournisseurs",settingsProvider:"Fournisseur de traduction",settingsProviderHint:"Les identifiants sont stockés uniquement dans le stockage userscript de cet appareil.",providerFieldApiKey:"Clé API",providerFieldApiKeyOptional:"Clé API (facultatif)",providerFieldDeeplPlan:"Offre DeepL",providerDeeplPlanFree:"Free (api-free.deepl.com)",providerDeeplPlanPro:"Pro (api.deepl.com)",providerFieldRegion:"Région",providerFieldModel:"Modèle",providerFieldBaseUrl:"URL de base de l’API",providerFieldFolderId:"Folder ID",providerFieldApiUrl:"URL de l’API",providerHintGoogle:"Endpoint public Google Translate. Aucune clé requise.",providerHintDeepl:"DeepL API Free ou Pro. Créez une clé sur deepl.com/pro-api.",providerHintDeeplKey:"Les clés Free se terminent souvent par :fx",providerHintMicrosoft:"Clé de ressource Azure Translator dans le portail Azure.",providerHintMicrosoftRegion:"Région de la ressource, ou global pour les clés multi-service.",providerHintOpenai:"API Chat Completions. Les endpoints compatibles fonctionnent aussi.",providerHintOpenaiBase:"Par défaut https://api.openai.com/v1 — changez pour un proxy.",providerHintYandex:"Clé API Yandex Cloud Translate + folder ID.",providerHintYandexFolder:"Depuis la console Yandex Cloud.",providerHintLibre:"Instance LibreTranslate auto-hébergée ou publique.",errProviderConfig:"Fournisseur non configuré. Ouvrez Translator → Fournisseurs.",sectionAbout:"À propos",aboutDescription:"Userscript qui traduit les posts X directement sur x.com. Compatible avec Tampermonkey, Violentmonkey et similaires.",aboutRepo:"Ouvrir le dépôt sur GitHub",aboutLicense:"Licence MIT",settingsGeneral:"Général",settingsTargetLang:"Traduire en",settingsUiLocale:"Langue de l’interface",settingsCacheHours:"Cache des traductions (heures)",settingsCacheHint:"0 désactive le cache. Les entrées expirent selon le TTL ou lors d’un vidage manuel.",cacheMeterTitle:"Occupation",cacheMeterUsed:"{used} / {limit}",cacheMeterEntries:"{count} entrées",cacheMeterTtl:"TTL {hours} h",cacheMeterDisabled:"Cache off",cacheMeterFree:"{free} libres",cacheMeterAria:"Cache {used} sur {limit} ({pct}), {count} entrées",cacheMeterHint:"Limite souple du stockage GM. En cas de dépassement, les entrées les plus anciennes sont évincées.",settingsDisplayMode:"Affichage de la traduction",settingsDisplayModeHint:"Panneau : traduction sous le post. Remplacer : échanger le texte et proposer Afficher l’original.",displayModePanel:"Panneau séparé",displayModeReplace:"Remplacer l’original",btnShowOriginal:"Afficher l’original",settingsTranslateMode:"Mode de traduction",settingsTranslateModeHint:"Automatique : traduit dès qu’un post est un peu visible à l’écran. Bouton : seulement après Traduire.",translateModeButton:"Au clic sur le bouton",translateModeAuto:"Automatique (à l’écran)",badgeModeAuto:"Auto",settingsAutoScope:"Portée de la traduction auto",settingsAutoScopeHint:"Traduire tous les posts visibles, ou seulement les comptes choisis.",autoScopeAll:"Tous les comptes",autoScopeAllowlist:"Comptes sélectionnés uniquement",settingsAllowlistHint:"Vous pouvez aussi ajouter ou retirer un compte via le menu ⋮ du post.",allowlistPlaceholder:"@username",allowlistAdd:"Ajouter",allowlistRemove:"Retirer",allowlistEmpty:"Aucun compte. Saisissez un nickname ci-dessus.",allowlistInvalid:"Saisissez un handle X valide.",allowlistExists:"{handle} est déjà dans la liste",allowlistAdded:"{handle} ajouté à la traduction auto",allowlistRemoved:"{handle} retiré de la traduction auto",menuAddAutoAccount:"Traduire auto ce compte",menuRemoveAutoAccount:"Retirer de la traduction auto",settingsSave:"Enregistrer",settingsClose:"Fermer",settingsClearCache:"Vider le cache",settingsSaved:"Paramètres enregistrés",settingsCacheCleared:"Cache des traductions vidé",toastCacheClearedOnUpdate:"Cache vidé après mise à jour vers {version}",toastCacheClearedOnUpdateTitle:"Mis à jour",toastTitleSuccess:"Succès",toastTitleInfo:"Info",toastTitleWarning:"Attention",toastTitleError:"Erreur",toastDismiss:"Fermer",langAuto:"Auto (comme l’UI / le navigateur)",localeAuto:"Auto (navigateur)",badgeLangAuto:"Auto",originalLabel:"Original",settingsReplaceReveal:"Détails du mode remplacement",settingsReplaceRevealHint:"Bouton seul, original au survol, ou les deux ensemble.",replaceRevealButton:"Bouton seul",replaceRevealHover:"Original au survol",replaceRevealSplit:"Vue partagée (original + traduction)",settingsAccountBlocklist:"Liste de blocage des comptes",settingsAccountBlocklistHint:"Ne pas afficher Traduire ni auto-traduire ces comptes. Aussi via le menu du post.",blocklistEmpty:"Aucun compte bloqué.",blocklistAdded:"{handle} bloqué",blocklistRemoved:"{handle} débloqué",menuBlockAccount:"Ne jamais traduire ce compte",menuUnblockAccount:"Autoriser la traduction de ce compte",settingsLangAllowlist:"Langues source autorisées",settingsLangAllowlistHint:"Si non vide, seules ces langues sont traduites. Vide = toutes.",settingsLangBlocklist:"Langues source bloquées",settingsLangBlocklistHint:"Ignorer les posts dans ces langues.",settingsSkipNative:"Ignorer les posts déjà auto-traduits par X",settingsSkipNativeHint:"Si X affiche déjà sa barre de traduction (Afficher l’original), ne pas ajouter Traduire ni auto-traduire.",langListEmpty:"Aucune langue sélectionnée.",langListAdd:"Ajouter",langListExists:"{lang} est déjà dans la liste",langSkippedBlocked:"Ignoré : langue bloquée",langSkippedNotAllowed:"Ignoré : langue non autorisée",settingsSectionInterface:"Interface",settingsSectionTranslate:"Traduction",settingsSectionAccounts:"Comptes",settingsSectionLanguages:"Langues",settingsSectionProvider:"Fournisseur",settingsSectionCache:"Cache",badgeCacheOff:"Off"},ja:{menuSettings:"X Translator — 設定",navSettings:"翻訳",btnTranslate:"翻訳",btnHide:"翻訳を隠す",btnRetry:"再試行",translating:"翻訳中…",translationLabel:"翻訳",detectedLang:"検出: {lang}",errEmpty:"翻訳するテキストがありません",errNetwork:"翻訳に失敗しました。もう一度お試しください。",settingsTitle:"X Translator",sectionGeneral:"一般",sectionTranslation:"翻訳",sectionCache:"キャッシュ",sectionProviders:"プロバイダー",settingsProvider:"翻訳プロバイダー",settingsProviderHint:"認証情報はこの端末の userscript ストレージにのみ保存されます。",providerFieldApiKey:"API キー",providerFieldApiKeyOptional:"API キー(任意)",providerFieldDeeplPlan:"DeepL プラン",providerDeeplPlanFree:"Free (api-free.deepl.com)",providerDeeplPlanPro:"Pro (api.deepl.com)",providerFieldRegion:"リージョン",providerFieldModel:"モデル",providerFieldBaseUrl:"API ベース URL",providerFieldFolderId:"Folder ID",providerFieldApiUrl:"API URL",providerHintGoogle:"Google の公開 Translate エンドポイント。API キー不要。",providerHintDeepl:"DeepL API Free / Pro。deepl.com/pro-api でキーを作成。",providerHintDeeplKey:"Free キーは通常 :fx で終わります",providerHintMicrosoft:"Azure ポータルの Translator リソースキー。",providerHintMicrosoftRegion:"リソースのリージョン。マルチサービスキーは global。",providerHintOpenai:"Chat Completions API。互換エンドポイントも利用可。",providerHintOpenaiBase:"既定は https://api.openai.com/v1。プロキシ用に変更可。",providerHintYandex:"Yandex Cloud Translate の API キーと folder ID。",providerHintYandexFolder:"Yandex Cloud コンソールから。",providerHintLibre:"自前または公開の LibreTranslate。",errProviderConfig:"プロバイダーが未設定です。Translator → プロバイダーを開いてください。",sectionAbout:"情報",aboutDescription:"X(x.com)上で投稿をその場で翻訳するユーザースクリプト。Tampermonkey、Violentmonkey などに対応。",aboutRepo:"GitHub でリポジトリを開く",aboutLicense:"MIT ライセンス",settingsGeneral:"一般",settingsTargetLang:"翻訳先",settingsUiLocale:"インターフェース言語",settingsCacheHours:"翻訳キャッシュ(時間)",settingsCacheHint:"0 でキャッシュ無効。TTL で期限切れ、または手動でクリア。",cacheMeterTitle:"使用量",cacheMeterUsed:"{used} / {limit}",cacheMeterEntries:"{count} 件",cacheMeterTtl:"TTL {hours} 時間",cacheMeterDisabled:"キャッシュオフ",cacheMeterFree:"空き {free}",cacheMeterAria:"キャッシュ {used} / {limit}({pct})、{count} 件",cacheMeterHint:"GM ストレージのソフト上限です。満杯になると古いエントリから削除されます。",settingsDisplayMode:"翻訳の表示",settingsDisplayModeHint:"パネル:投稿の下に表示。置換:本文を翻訳に差し替え、「原文を表示」を出す。",displayModePanel:"別パネル",displayModeReplace:"原文を置き換え",btnShowOriginal:"原文を表示",settingsTranslateMode:"翻訳モード",settingsTranslateModeHint:"自動:投稿が画面に少しでも見えたら翻訳。ボタン:「翻訳」を押したときだけ。",translateModeButton:"ボタンで翻訳",translateModeAuto:"自動(画面に表示時)",badgeModeAuto:"自動",settingsAutoScope:"自動翻訳の対象",settingsAutoScopeHint:"表示中のすべての投稿か、選んだアカウントのみを翻訳します。",autoScopeAll:"すべてのアカウント",autoScopeAllowlist:"選択したアカウントのみ",settingsAllowlistHint:"投稿の ⋮ メニューからもアカウントを追加・削除できます。",allowlistPlaceholder:"@username",allowlistAdd:"追加",allowlistRemove:"削除",allowlistEmpty:"まだありません。上にニックネームを入力してください。",allowlistInvalid:"有効な X ハンドルを入力してください。",allowlistExists:"{handle} はすでにリストにあります",allowlistAdded:"{handle} を自動翻訳に追加しました",allowlistRemoved:"{handle} を自動翻訳から削除しました",menuAddAutoAccount:"このアカウントを自動翻訳",menuRemoveAutoAccount:"自動翻訳から外す",settingsSave:"保存",settingsClose:"閉じる",settingsClearCache:"キャッシュをクリア",settingsSaved:"設定を保存しました",settingsCacheCleared:"翻訳キャッシュをクリアしました",toastCacheClearedOnUpdate:"{version} への更新後、キャッシュをクリアしました",toastCacheClearedOnUpdateTitle:"更新済み",toastTitleSuccess:"成功",toastTitleInfo:"情報",toastTitleWarning:"注意",toastTitleError:"エラー",toastDismiss:"閉じる",langAuto:"自動(UI / ブラウザに合わせる)",localeAuto:"自動(ブラウザ)",badgeLangAuto:"自動",originalLabel:"原文",settingsReplaceReveal:"置換モードの詳細",settingsReplaceRevealHint:"ボタンのみ、ホバーで原文、または原文と訳文を並べて表示。",replaceRevealButton:"ボタンのみ",replaceRevealHover:"ホバーで原文",replaceRevealSplit:"分割表示(原文 + 訳文)",settingsAccountBlocklist:"アカウントブロックリスト",settingsAccountBlocklistHint:"これらのアカウントには翻訳ボタンを出さず自動翻訳もしません。投稿メニューからも変更できます。",blocklistEmpty:"ブロック中のアカウントはありません。",blocklistAdded:"{handle} をブロックしました",blocklistRemoved:"{handle} のブロックを解除しました",menuBlockAccount:"このアカウントを翻訳しない",menuUnblockAccount:"このアカウントの翻訳を許可",settingsLangAllowlist:"原文言語の許可リスト",settingsLangAllowlistHint:"空でなければ、検出されたこれらの言語だけ翻訳します。空 = すべて。",settingsLangBlocklist:"原文言語のブロックリスト",settingsLangBlocklistHint:"これらの言語の投稿をスキップします。",settingsSkipNative:"X が既に自動翻訳した投稿をスキップ",settingsSkipNativeHint:"X の翻訳バー(オリジナルを表示)が出ている投稿には、翻訳ボタンを付けず自動翻訳もしません。",langListEmpty:"言語が未選択です。",langListAdd:"追加",langListExists:"{lang} はすでにリストにあります",langSkippedBlocked:"スキップ:言語がブロックされています",langSkippedNotAllowed:"スキップ:許可リストにない言語です",settingsSectionInterface:"インターフェース",settingsSectionTranslate:"翻訳",settingsSectionAccounts:"アカウント",settingsSectionLanguages:"言語",settingsSectionProvider:"プロバイダー",settingsSectionCache:"キャッシュ",badgeCacheOff:"オフ"}},k=["en","ru","zh","es","pt","de","fr","ja"],M={en:"English",ru:"Русский",zh:"中文",es:"Español",pt:"Português",de:"Deutsch",fr:"Français",ja:"日本語"},C={en:"🇺🇸",ru:"🇷🇺",zh:"🇨🇳",es:"🇪🇸",pt:"🇧🇷",de:"🇩🇪",fr:"🇫🇷",ja:"🇯🇵"},H="🌐";function E(){const e=String(navigator.language||"en").toLowerCase().slice(0,2);return k.includes(e)?e:"en"}function $(e){const t=e||"auto";return "auto"!==t&&k.includes(t)?t:E()}function P(e,t){return String(e).replace(/\{(\w+)\}/g,(e,n)=>null==t[n]?"":String(t[n]))}const _=new Set(["home","explore","search","notifications","messages","settings","i","compose","login","logout","signup","tos","privacy","hashtag","intent","share","following","followers","lists","bookmarks","communities","premium","jobs","articles","topics","about","download","help","display","account"]);function R(e){let t=String(e||"").replace(/\u00a0/g," ").trim();return t?(t=t.replace(/^@+/,""),t=t.replace(/^https?:\/\/(www\.)?(x|twitter)\.com\//i,""),t=t.replace(/^\//,""),t=t.split(/[/?#\s]/)[0]||"",t=t.replace(/^@+/,"").replace(/\/+$/,""),t=t.toLowerCase(),!t||_.has(t)?"":/^[a-z0-9_]{1,15}$/i.test(t)?t:""):""}function I(e){if(!e)return "";let t=String(e).trim();try{/^https?:\/\//i.test(t)&&(t=new URL(t).pathname);}catch(n){}return t=t.replace(/^\//,""),R(t.split(/[/?#]/)[0]||"")}function q(e){const t=R(e);return t?`@${t}`:""}function B(e){return String(e||"").trim().toLowerCase().replace(/_/g,"-")}function z(e){return Array.isArray(e)?[...new Set(e.map(B).filter(Boolean))].sort():[]}function F(e){return Array.isArray(e)?[...new Set(e.map(R).filter(Boolean))].sort():[]}const D=new Set(["button","hover","split"]);function N(e){const t=e&&"object"==typeof e?e:{},n={...w,...t};return n.provider=s(n.provider)?n.provider:"google",n.providerConfig=c(t.providerConfig),n.translateMode="auto"===n.translateMode?"auto":"button",n.displayMode="replace"===n.displayMode?"replace":"panel",n.replaceReveal=D.has(n.replaceReveal)?n.replaceReveal:"button",n.autoScope="allowlist"===n.autoScope?"allowlist":"all",n.autoAllowlist=F(n.autoAllowlist),n.accountBlocklist=F(n.accountBlocklist),n.langAllowlist=z(n.langAllowlist),n.langBlocklist=z(n.langBlocklist),n.skipNativeAutoTranslate=false!==n.skipNativeAutoTranslate,delete n.debugMode,delete n.autoDetectSkipSameLang,n}function O(){try{return N(e(p,null))}catch(t){return N(null)}}function U(e){const t=N(e);n(p,t);}let K=O(),j=$(K.uiLocale),G=T[j]||T.en,X=null,Y=0;const V=new Map;function W(){K=O(),j=$(K.uiLocale),G=T[j]||T.en;}function Z(e){X=e;}function J(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Q(e){return J(e)}function ee(){if(X)return X;try{const t=e(g,null);Z(t&&"object"==typeof t?t:{});}catch(t){Z({});}return X}function te(){var e;clearTimeout(Y),e=setTimeout(()=>{try{!function(){const e=ee(),t=ne();if(t<=0){for(const t of Object.keys(e))delete e[t];return}const n=Date.now();for(const[a,o]of Object.entries(e))o&&"object"==typeof o?n-(o.at||0)>t&&delete e[a]:delete e[a];}(),function(){const e=ee();let t=ae(e);if(t<=x)return;const n=Object.entries(e).sort((e,t)=>{var n,a;return ((null==(n=e[1])?void 0:n.at)||0)-((null==(a=t[1])?void 0:a.at)||0)});for(const[a]of n)if(delete e[a],t=ae(e),t<=1782579.2)break}(),n(g,ee());}catch(e){}},400),Y=e;}function ne(){const e=Number(K.cacheHours);return !Number.isFinite(e)||e<=0?0:3600*Math.min(e,168)*1e3}function ae(e){try{return 2*JSON.stringify(e).length}catch(t){return 0}}function oe(e,t){try{return 2*(JSON.stringify(e).length+JSON.stringify(t).length)}catch(n){return 0}}function ie(e){const t=Math.max(0,Number(e)||0);return t<1024?`${Math.round(t)} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(2)} MB`}function re(){const e=ee();let t=0,n=0;for(const s of Object.keys(e))t+=oe(s,e[s]),n+=1;const a=x,o=Math.max(0,a-t),i=Math.min(100,t/a*100),r=Number(K.cacheHours),l=Number.isFinite(r)&&r>0;return {usedBytes:t,freeBytes:o,limitBytes:a,entryCount:n,pct:i,ttlHours:l?Math.min(r,168):0,enabled:l}}function le(e){const t=e||re();return t.enabled?t.pct>=85?"high":t.pct>=60?"warn":"ok":"off"}function se(e){const t=e||re(),n=le(t),a=`${t.pct<10&&t.pct>0?t.pct.toFixed(1):Math.round(t.pct)}%`,o=P(G.cacheMeterUsed,{used:ie(t.usedBytes),limit:ie(t.limitBytes)}),i=P(G.cacheMeterEntries,{count:t.entryCount}),r=t.enabled?P(G.cacheMeterTtl,{hours:t.ttlHours}):G.cacheMeterDisabled,l=P(G.cacheMeterFree,{free:ie(t.freeBytes)}),s=P(G.cacheMeterAria,{used:ie(t.usedBytes),limit:ie(t.limitBytes),pct:a,count:t.entryCount});return `\n
${J(G.cacheMeterHint)}
\n${J(n)}
`:"";return `\n${J(t)}
`:""}\n${J(G[t]||G.allowlistEmpty)}
`}function sn(e,t){const n=Array.isArray(e)?e:[];return n.length?`\n${J(G[t]||G.langListEmpty)}
`}function cn(e,t){return [...e.querySelectorAll(`${t} [data-xt-handle-item]`)].map(e=>R(e.getAttribute("data-handle"))).filter(Boolean)}function dn(e,t){return [...e.querySelectorAll(`${t} [data-xt-lang-item]`)].map(e=>B(e.getAttribute("data-code"))).filter(Boolean)}function un(e,t,n,a){const o=e.querySelector(t);o&&(o.innerHTML=ln(n,a));}function pn(e,t,n,a){const o=e.querySelector(t);o&&(o.innerHTML=sn(n,a));}function gn(e=[]){const t=new Set(e.map(B));return L.map(e=>{const n=B(e.code);return t.has(n)?"":``}).join("")}function vn(e){var t,n,a;const o=null==e?void 0:e.querySelector("form");if(!o)return;const i="auto"===(null==(t=o.translateMode)?void 0:t.value)?"auto":"button",r="allowlist"===(null==(n=o.autoScope)?void 0:n.value)?"allowlist":"all",l="replace"===(null==(a=o.displayMode)?void 0:a.value)?"replace":"panel",s=o.querySelector("[data-xt-auto-options]"),c=o.querySelector("[data-xt-allowlist-panel]"),d=o.querySelector("[data-xt-replace-options]");s&&(s.hidden="auto"!==i),c&&(c.hidden=!("auto"===i&&"allowlist"===r)),d&&(d.hidden="replace"!==l);}function mn(){var e;null==(e=document.getElementById(Bt))||e.remove(),function(){const e=document.documentElement,t=document.body;if(!t||!e.classList.contains("xt-scroll-lock"))return;const n=Number(t.dataset.xtScrollY||0);e.classList.remove("xt-scroll-lock"),t.classList.remove("xt-scroll-lock"),t.style.top="",delete t.dataset.xtScrollY,window.scrollTo(0,n);}();}function hn(){var e,t,a,o,r,l,s,c,p,v,m,h,f,b;mn(),W();const A="general",y=document.createElement("div");var x,S;y.id=Bt,y.className="xt-settings-backdrop",y.innerHTML=`\nv${J(u)}
\n