BIS 표 한글화

스탯과 장비.. 기타 등등을 한국어로 보여줌

// ==UserScript==
// @name         BIS 표 한글화
// @namespace    ㅇㅇ
// @version      7.20
// @description  스탯과 장비.. 기타 등등을 한국어로 보여줌
// @match        https://etro.gg/*
// @match        https://xivgear.app/*
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    function translateAllTextNodes() {
        const treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, false);
        let node;
        while (node = treeWalker.nextNode()) {
            translateNodeText(node);
        }
    }

    function translateNodeText(node) {
        if (node.parentNode.closest('materia-count-display, single-materia-view-only')) {
            return;
        }

        let text = node.nodeValue;
        for (const wordset of wordsets) {
            for (const [key, value] of Object.entries(wordset)) {
                text = text.replaceAll(key, value);
            }
        }
        node.nodeValue = text;
    }

    const observer = new MutationObserver(() => {
        translateAllTextNodes();
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true,
    });

    window.addEventListener('load', () => {
        translateAllTextNodes();
    });

GM_addStyle(`
    materia-totals-display {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        margin-bottom: 1em;
        padding: 0;
    }

    materia-count-display {
        display: block !important;
        margin-top: 4px;
        text-align: center;
    }

    .materia-line-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-bottom: 4px;
        white-space: nowrap;
    }

    .materia-stat-block-left {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 1;
    }

    .materia-name-quantity-right {
        font-weight: bold;
        text-align: right;
        min-width: 120px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .materia-name-quantity {
        white-space: nowrap;
    }

    .materia-stat-block {
        display: flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
    }

    single-materia-view-only {
        display: inline-block !important;
        white-space: nowrap;
    }
    slot-materia-manager {
        display: inline-flex !important;
        align-items: center !important;
        margin-right: 20px !important;
        gap: 1px;
    }

    slot-materia-manager > .materia-image-holder {
        flex-shrink: 0;
    }

    slot-materia-manager > span {
        white-space: nowrap !important;
    }
    slot-materia-manager:last-child {
      margin-right: 12 !important;
    }
    .gear-items-view-table th div {
        white-space: nowrap;
        overflow: visible;
    }
`);




    const wordReplacements = {
      //기타2
      "Math": "계산기",
      "Solve for the highest-dps set of melds for this gearset.": "이 장비세트를 위한 최대 DPS 금단을 계산합니다. ",
      "Computation will be much slower without a target GCD.": "글쿨 목표치를 설정하지 않으면 계산이 많이 느릴 것입니다.",
      "Target GCD": "글쿨 목표치",
      "New Gear Set": "새 장비세트",
      "Add Simulation": "시뮬레이션 추가",
      "Default Set": "기본 장비세트",

      //스탯
      "STR": "힘","Strength": "힘",
      "DEX": "민첩","Dexterity": "민첩",
      "VIT": "활력","Vitality": "활력",
      "INT": "지능","Intelligence": "지능",
      "MND": "정신력","Mind": "정신력",

      "CRT": "극대화","Crit": "극대화",
      "DET": "의지력","Determination": "의지력",
      "DHT": "직격","DH": "직격","Direct Hit": "직격",
      "MDEF": "마법 방어",
      "DEF": "물리 방어",

      "SkS": "기시속","SKS": "기시속","Skill Speed": "기시속",
      "SpS": "마시속","SPS": "마시속","Spell Speed": "마시속",
      "TNC": "불굴","Tenacity": "불굴",
      "PIE": "신앙","Piety": "신앙",

      "Main Stat": "주 능력치",
      "WD": "공격력","Weapon Damage": "공격력",
      "GCD": "글쿨",
      "Levels": "레벨",
      "Jobs": "직업","Job": "직업",
      "Stat": "능력치",
      "Multiplier": "계수",
      "Dmg": "데미지",
      "Def": "방어",

      "PoM": "쾌속마",
      "DoT": "도트",

      //장비 슬롯
      "Weapon:": "무기:",
      "Head:": "머리:",
      "Body:": "몸통:",
      "Hand:": "손:",
      "Legs:": "다리:",
      "Feet:": "발:",
      "Ears:": "귀:",
      "Neck:": "목:",
      "Wrist:": "손목:",
      "Left Ring:": "왼쪽 손가락:",
      "Right Ring:": "오른쪽 손가락:",

      "Tome": "석판 장비",
      " Raid": " 레이드 장비",

      //예외 장비
      "Archeo Kingdom Hood of Casting": "구왕국 마술사 두건",

      //방어구, 장신구 형용사 및 종류
      "Augmented": "보강된","Aug.": "보강된",
      "Ornate": "화려한",
      "Skyruin": "발리가르만다",
      "Resilient": "기적의 아이",
      "Archeo Kingdom": "구왕국",
      "Light-heavy": "라이트헤비급",
      "Quetzalli": "케츠할리",
      "Dark Horse Champion's": "다크호스 챔피언",
      "Ark Angel's": "아크 엔젤",
      "Ultimate Edenmorn": "절 에덴의 아침",
      "Clouddark": "어둠의 구름",
      "Eternal": "이터널 퀸",
      "Ceremonial": "의전",
      "Historia": "왕국설화",
      "Babyface Champion's": "베이비페이스 챔피언",

      //방어구
      "Helm of Fending": "수호자 투구","Bandana of Fending": "수호자 두건","Circlet of Fending": "수호자 머리장식","Longcap of Fending": "수호자 자락모자","Headset of Fending": "수호자 헤드셋",
      "Mail of Fending": "수호자 갑옷","Coat of Fending": "수호자 외투","Armor of Fending": "수호자 갑옷","Tunic of Fending": "수호자 튜닉","Cuirass of Fending": "수호자 전투흉갑","Corselet of Fending": "수호자 흉갑","Jacket of Fending": "수호자 재킷",
      "Gauntlets of Fending": "수호자 건틀릿","Halfgloves of Fending": "수호자 손등장갑","Armguards of Fending": "수호자 팔보호구","Vambraces of Fending": "수호자 완갑","Gloves of Fending": "수호자 장갑",
      "Brais of Fending": "수호자 바지","Breeches of Fending": "수호자 바지","Cuisses of Fending": "수호자 허벅지보호대","Poleyns of Fending": "수호자 무릎받이","Hose of Fending": "수호자 기마바지","Trousers of Fending": "수호자 긴바지",
      "Sollerets of Fending": "수호자 쇠구두","Greaves of Fending": "수호자 갑주장화","Thighboots of Fending": "수호자 허벅지장화","Sabatons of Fending": "수호자 판금장화","Boots of Fending": "수호자 장화",

      "Helm of Maiming": "학살자 투구","Bandana of Maiming": "학살자 두건","Face Guard of Maiming": "학살자 머리보호대","Longcap of Maiming": "학살자 자락모자","Headset of Maiming": "학살자 헤드셋",
      "Mail of Maiming": "학살자 갑옷","Coat of Maiming": "학살자 외투","Armor of Maiming": "학살자 갑옷","Cuirass of Maiming": "학살자 전투흉갑","Corselet of Maiming": "학살자 흉갑","Jacket of Maiming": "학살자 재킷","Cuirass of Maiming": "학살자 전투흉갑",
      "Gauntlets of Maiming": "학살자 건틀릿","Halfgloves of Maiming": "학살자 손등장갑","Vambraces of Maiming": "학살자 완갑","Gloves of Maiming": "학살자 장갑",
      "Brais of Maiming": "학살자 바지","Breeches of Maiming": "학살자 바지","Cuisses of Maiming": "학살자 허벅지보호대","Poleyns of Maiming": "학살자 무릎받이","Hose of Maiming": "학살자 기마바지","Trousers of Maiming": "학살자 긴바지",
      "Sollerets of Maiming": "학살자 쇠구두","Greaves of Maiming": "학살자 갑주장화","Thighboots of Maiming": "학살자 허벅지장화","Sabatons of Maiming": "학살자 판금장화","Boots of Maiming": "학살자 장화",

      "Visor of Striking": "타격대 얼굴가리개","Hood of Striking": "타격대 후드","Headplume of Striking": "타격대 머리","Hood of Striking": "타격대 두건","Longcap of Striking": "타격대 자락모자","Face Guard of Striking": "타격대 얼굴보호구","Bandana of Striking": "타격대 두건",
      "Jacket of Striking": "타격대 재킷","Coat of Striking": "타격대 외투","Chiton of Striking": "타격대 키톤","Cuirass of Striking": "타격대 전투흉갑","Vest of Striking": "타격대 조끼","Gilet of Striking": "타격대 장식조끼",
      "Vambraces of Striking": "타격대 완갑","Gloves of Striking": "타격대 장갑","Clawtips of Striking": "타격대 칼날손톱","Gauntlets of Striking": "타격대 건틀릿","Armguards of Striking": "타격대 팔보호구","Halfgloves of Striking": "타격대 손등장갑",
      "Breeches of Striking": "타격대 바지","Brais of Striking": "타격대 바지","Tights of Striking": "타격대 쫄바지","Poleyns of Striking": "타격대 무릎받이","Culottes of Striking": "타격대 통바지","Gaskins of Striking": "타격대 무릎바지",
      "Leggings of Striking": "타격대 다리보호대","Boots of Striking": "타격대 장화","Sollerets of Striking": "타격대 쇠구두","Thighboots of Striking": "타격대 허벅지장화","Shoes of Striking": "타격대 신발","Crakows of Striking": "타격대 뾰족신",

      "Visor of Aiming": "유격대 얼굴가리개","Mask of Aiming": "유격대 가면","Headplume of Aiming": "유격대 머리","Circlet of Aiming": "유격대 머리장식","Beret of Aiming": "유격대 베레모","Longcap of Aiming": "유격대 자락모자","Goggles of Aiming": "유격대 고글","Tricorne of Aiming": "유격대 삼각모자",
      "Jacket of Aiming": "유격대 재킷","Cloak of Aiming": "유격대 외투","Corselet of Aiming": "유격대 흉갑","Vest of Aiming": "유격대 조끼","Jerkin of Aiming": "유격대 웃옷","Bliaud of Aiming": "유격대 블리오",
      "Vambraces of Aiming": "유격대 완갑","Gloves of Aiming": "유격대 장갑","Clawtips of Aiming": "유격대 칼날손톱","Armguards of Aiming": "유격대 팔보호구",
      "Breeches of Aiming": "유격대 바지","Brais of Aiming": "유격대 바지","Tights of Aiming": "유격대 쫄바지","Poleyns of Aiming": "유격대 무릎받이","Culottes of Aiming": "유격대 통바지","Trousers of Aiming": "유격대 긴바지",
      "Leggings of Aiming": "유격대 다리보호대","Boots of Aiming": "유격대 장화","Sollerets of Aiming": "유격대 쇠구두","Sabatons of Aiming": "유격대 판금장화","Crakows of Aiming": "유격대 뾰족신","Thighboots of Aiming": "유격대 허벅지장화",

      "Visor of Scouting": "정찰대 얼굴가리개","Hood of Scouting": "정찰대 후드","Headplume of Scouting": "정찰대 머리","Face Guard of Scouting": "정찰대 머리보호대","Hood of Scouting": "정찰대 두건","Longcap of Scouting": "정찰대 자락모자","Bandana of Scouting": "정찰대 두건",
      "Jacket of Scouting": "정찰대 재킷","Coat of Scouting": "정찰대 외투","Chiton of Scouting": "정찰대 키톤","Corselet of Scouting": "정찰대 흉갑","Vest of Scouting": "정찰대 조끼","Gilet of Scouting": "정찰대 장식조끼",
      "Vambraces of Scouting": "정찰대 완갑","Gloves of Scouting": "정찰대 장갑","Clawtips of Scouting": "정찰대 칼날손톱","Armguards of Scouting": "정찰대 팔보호구","Halfgloves of Scouting": "정찰대 손등장갑",
      "Breeches of Scouting": "정찰대 바지","Brais of Scouting": "정찰대 바지","Tights of Scouting": "정찰대 쫄바지","Poleyns of Scouting": "정찰대 무릎받이","Culottes of Scouting": "정찰대 통바지","Gaskins of Scouting": "정찰대 무릎바지",
      "Leggings of Scouting": "정찰대 다리보호대","Boots of Scouting": "정찰대 장화","Sollerets of Scouting": "정찰대 쇠구두","Greaves of Scouting": "정찰대 갑주장화","Sabatons of Scouting": "정찰대 판금장화","Crakows of Scouting": "정찰대 뾰족신","Shoes of Scouting": "정찰대 신발",

      "Hood of Healing": "치유사 후드","Hat of Healing": "치유사 모자","Horns of Healing": "치유사 뿔장식","Circlet of Healing": "치유사 머리장식","Beret of Healing": "치유사 베레모","Hood of Healing": "치유사 두건","Headgear of Healing": "치유사 머리보호구","Cap of Healing": "치유사 모자",
      "Robe of Healing": "치유사 로브","Coat of Healing": "치유사 외투","Top of Healing": "치유사 상의","Tunic of Healing": "치유사 튜닉",
      "Gloves of Healing": "치유사 장갑","Halfgloves of Healing": "치유사 손등장갑","Gauntlets of Healing": "치유사 건틀릿","Armguards of Healing": "치유사 팔보호구",
      "Hose of Healing": "치유사 기마바지","Brais of Healing": "치유사 바지","Breeches of Healing": "치유사 바지","Poleyns of Healing": "치유사 무릎받이","Hose of Healing": "치유사 기마바지","Sarouel of Healing": "치유사 헐렁바지",
      "Shoes of Healing": "치유사 신발","Clawboots of Healing": "치유사 발톱장화","Thighboots of Healing": "치유사 허벅지장화","Boots of Healing": "치유사 장화",

      "Hood of Casting": "마술사 후드","Hat of Casting": "마술사 모자","Horns of Casting": "마술사 뿔장식","Petasos of Casting": "마술사 뾰족모자","Hood of Casting": "마술사 두건","Headgear of Casting": "마술사 머리보호구","Cap of Casting": "마술사 모자",
      "Robe of Casting": "마술사 로브","Coat of Casting": "마술사 외투","Top of Casting": "마술사 상의","Coat of Casting": "마술사 외투","Tunic of Casting": "마술사 튜닉",
      "Gloves of Casting": "마술사 장갑","Halfgloves of Casting": "마술사 손등장갑","Gauntlets of Casting": "마술사 건틀릿","Armguards of Casting": "마술사 팔보호구",
      "Hose of Casting": "마술사 기마바지","Brais of Casting": "마술사 바지","Slops of Casting": "마술사 일자바지","Poleyns of Casting": "마술사 무릎받이","Sarouel of Casting": "마술사 헐렁바지",
      "Shoes of Casting": "마술사 신발","Clawboots of Casting": "마술사 발톱장화","Boots of Casting": "마술사 장화","Thighboots of Casting": "마술사 허벅지장화",

      //장신구
      "Ear Cuffs of Fending": "수호자 귀찌","Earring of Fending": "수호자 귀걸이","Earrings of Fending": "수호자 귀걸이",
      "Ear Cuffs of Slaying": "공격대 귀찌","Earring of Slaying": "공격대 귀걸이","Earrings of Slaying": "공격대 귀걸이",
      "Ear Cuffs of Aiming": "유격대 귀찌","Earring of Aiming": "유격대 귀걸이","Earrings of Aiming": "유격대 귀걸이",
      "Ear Cuffs of Healing": "치유사 귀찌","Earring of Healing": "치유사 귀걸이","Earrings of Healing": "치유사 귀걸이",
      "Ear Cuffs of Casting": "마술사 귀찌","Earring of Casting": "마술사 귀걸이","Earrings of Casting": "마술사 귀걸이",

      "Necklace of Fending": "수호자 목걸이","Choker of Fending": "수호자 목장식","Gorget of Fending": "수호자 목가리개",
      "Necklace of Slaying": "공격대 목걸이","Choker of Slaying": "공격대 목장식","Gorget of Slaying": "공격대 목가리개",
      "Necklace of Aiming": "유격대 목걸이","Choker of Aiming": "유격대 목장식","Gorget of Aiming": "유격대 목가리개",
      "Necklace of Healing": "치유사 목걸이","Choker of Healing": "치유사 목장식","Gorget of Healing": "치유사 목가리개",
      "Necklace of Casting": "마술사 목걸이","Choker of Casting": "마술사 목장식","Gorget of Casting": "마술사 목가리개",

      "Bracelet of Fending": "수호자 팔찌","Bracelets of Fending": "수호자 팔찌","Bangle of Fending": "수호자 장식고리","Wristband of Fending": "수호자 손목띠",
      "Bracelet of Slaying": "공격대 팔찌","Bracelets of Slaying": "공격대 팔찌","Bangle of Slaying": "공격대 장식고리","Wristband of Slaying": "공격대 손목띠",
      "Bracelet of Aiming": "유격대 팔찌","Bracelets of Aiming": "유격대 팔찌","Bangle of Aiming": "유격대 장식고리","Wristband of Aiming": "유격대 손목띠",
      "Bracelet of Healing": "치유사 팔찌","Bracelets of Healing": "치유사 팔찌","Bangle of Healing": "치유사 장식고리","Wristband of Healing": "치유사 손목띠",
      "Bracelet of Casting": "마술사 팔찌","Bracelets of Casting": "마술사 팔찌","Bangle of Casting": "마술사 장식고리","Wristband of Casting": "마술사 손목띠",

      "Ring of Fending": "수호자 반지",
      "Ring of Slaying": "공격대 반지",
      "Ring of Aiming": "유격대 반지",
      "Ring of Healing": "치유사 반지",
      "Ring of Casting": "마술사 반지",

      //무기
      "Longsword": "롱소드","Sword": "한손검","Bastard Sword": "바스타드소드","Broadsword": "브로드소드","Shamshir": "샴시르",
      "Kite Shield": "연모양 방패","Scutum": "사각방패","Pelta": "타원방패","Shield": "방패",
      "Patas": "파타","Jamadhars": "자마다르","Sainti": "사인티","Knuckles": "너클",
      "Bardiche": "긴날도끼","Labrys": "양날도끼","Battleaxe": "전투도끼","War Axe": "전쟁도끼",
      "Spear": "창","Halberd": "미늘창","Partisan": "유격창","Couse": "굽은창",
      "Longbow": "장궁","Cavalry Bow": "기수궁","Bow": "활","Shortbow": "단궁","Compound Bow": "합성궁",
      "Cane": "환술봉","Candelarod": "촛대지팡이","Wand": "마법봉",
      "Rod": "주술봉","Scepter": "홀","Longpole": "장봉",
      "Chronicle": "연대기","Index": "금서","Grimoire": "마법서",
      "Counsel": "상담록","Codex": "치유서",
      "Knives": "단검","Main Gauches": "맹고쉬","Daggers": "단검","Cleavers": "살육도",
      "Greatsword": "그레이트소드","Zweihander": "츠바이헨더","Claymore": "클레이모어",
      "Handgonne": "권총","Musketoon": "단총","Pistol": "권총","Culverin": "포총","대체": "대체",
      "Star Globe": "천구의","Astrometer": "천체광도계","Torquetum": "좌표기","Planisphere": "천궁도",
      "Samurai Blade": "외날검","Blade": "외날검","Tulwar": "곡도",
      "Rapier": "레이피어","Foil": "플뢰레","Tuck": "터크","Smallsword": "스몰소드",
      "Bayonet": "총검","Gunblade": "건블레이드",
      "Chakrams": "차크람","Tathlums": "타흘룸","Glaives": "글레이브",
      "War Scythe": "전투낫","Sickle": "대낫","Scythe": "전투낫","Zaghnal": "자그날",
      "Wings": "날개","Milpreves": "밀프레베","Pendulums": "진자",
      "Twinfangs": "쌍송곳니","Saberfangs": "쌍검치",
      "Round Brush": "둥근붓","Flat Brush": "납작붓",

      //음식
      "Food": "음식",
      "Moqueca": "무케카",
      "Roast Chicken": "로스트 치킨",
      "Churrasco": "슈하스코",
      "Chicken Pasta": "치킨 파스타",
      "Pineapple Orange Jelly": "파인애플 오렌지 젤리",
      "Navel Orange Cookies": "배꼽 오렌지 쿠키",
      "Sweet Maple Mate": "달콤 마테차",
      "Mate Cookie": "고급 마테차 쿠키",

      //마테리아
      "Quicktongue Mate": "시전의",
      "Quickarm Mate": "신속의",

      "Craftsman's Command Mate": "거장의",
      "Craftsman's Cunning Mate": "명인의",
      "Craftsman's Competence Mate": "장인의",

      "Gatherer's Grasp Mate": "기량의",
      "Gatherer's Guile Mate": "박식의",
      "Gatherer's Guerdon Mate": "달견의",

      "Battledance Mate": "강유의",
      "Savage Might Mate": "야망의",
      "Savage Aim Mate": "무략의",
      "Heavens' Eye Mate": "심안의",

      "Piety Mate": "신앙의",
      "Mind Mate": "정신력의",
      "Intelligence Mate": "지능의",
      "Dexterity Mate": "민첩성의",
      "Vitality Mate": "활력의",
      "Strength Mate": "힘의",

      "ria XII": " 하이알테마마테리쟈",
      "ria XI": " 하이오메가마테리쟈",
      "ria X": " 알테마마테리쟈",
      "ria IX": " 오메가마테리쟈",
      "ria VIII": " 엑스마테리쟈",
      "ria VII": " 메가마테리쟈",
      "ria VI": " 하이마테리쟈",
      "ria V": " 마테리쟈",
      "ria IV": " 마테리가",
      "ria III": " 마테리다",
      "ria II": " 마테리라",
      "ria I": " 마테리아",

      "Materia": "마테리아",
      "Fill/Lock": "채우기/잠금",
      "Mat": "마테",
      "Solve Melds": "금단 계산",
      "Meld": "금단",
      "Solver": "계산기",

      //기타
      "Totals:": "",
      "No materia slots on this item": "마테리아 슬롯 없음",
      "Alternative Items": "대체 가능 장비",
      "Average Item Level": "평균 아이템 레벨",
      "Set Name": "장비세트 이름",
      "max": "최대",
      "alt items": " 대체 가능 장비",
      "The item ": "아이템 \"",
      " can be replaced by all of the following items, which have equivalent or better effective stats:": "\"은(는) 아래의 장비로 대체 가능 합니다.",
      "iLvl": "레벨",
      "iLv": "레벨",

      "To edit this sheet, click the \"Save As\" button below the table.": "이 시트를 수정하려면, 테이블 아래의 \"다른 이름으로 저장\" 버튼을 누르세요. ",
      "Save As": "다른 이름으로 저장",
      "Sheet Name": "시트 이름",
      "Job:": "직업:",
      "Level:": "레벨:",
      "Sync Item Level": "아이템 레벨 조율",
      "You don't have any sheets. Click 'New Sheet' to get started.": "시트가 없습니다. '새 시트'를 클릭해 시작합니다.",
      "New Sheet": "새 시트",
      "New Gear Planning Sheet": "새로운 장비 계획 시트",
      "My Sheets": "내 시트",
      "This is for importing gear set\\(s\\) into this sheet. ": "이 시트에 장비세트를 불러올 수 있습니다. ",
      "If you would like to import a full sheet export \\(including sim settings\\) to a new sheet,": "시뮬레이터 설정을 포함해 내보냈었던 전체 시트를 불러오고 싶다면,",
      "use the \"Import Sheet\" at the top of the page. You can import a gear planner URL or JSON, or an Etro URL.": "페이지 상단의 \"시트 불러오기\"를 사용하세요. 링크나 JSON, Etro 에서도 불러올 수 있습니다.",

      "Import Sheet": "시트 불러오기",
      "This will import into a new sheet. You can paste a gear planner link, gear planner JSON, or an Etro link.": "새 시트로 불러옵니다.",
      "Import Sets": "장비세트 불러오기",
      "Import Gear Set\\(s\\)": "장비세트 불러오기",
      "Import": "불러오기",

      "Export Full Sheet": "전체 시트 내보내기",
      "Link to Whole Sheet": "전체 시트 링크",
      "One Link for Each Set": "개별 장비세트 링크",
      "Embed URL for Each Set": "개별 장비세트 임베드 URL",
      "JSON for Whole Sheet": "전체 시트 JSON",

      "Export Individual Set": "개별 장비세트 내보내기",
      "Link to This Set": "선택한 세트 링크",
      "JSON for This Set": "선택한 장비세트 JSON",
      "Embed URL for This Set": "선택한 장비세트 임베드 URL",
      "Export to Teamcraft": "전체 시트의 JSON",

      "Choose Sims to Export": "내보낼 시뮬레이터 선택",

      "Generate": "내보내기",
      "Preview": "미리보기",
      "Close": "닫기",

      "Gear": "장비",
      "Filters": "필터",
      "Show NQ Items": "NQ 아이템 표시",

      " Sim": " 시뮬",
      "Sim:": "시뮬레이터:",

      //"Export...": "내보내기...",
      "Export Whole Sheet": "전체 시트 내보내기",
      "Whole Sheet": "전체 시트",
      "Selected Set": "선택한 세트",

      "Toggle Header": "제목",
      "Toggle Details": "자세히",

      "Name": "이름",

      "Source": "얻는 곳",
      "Raid": "레이드",
      "Ultimate": "절 레이드",
      "Crafted": "제작",
      "Unknown": "알 수 없음",

      "Settings": "설정",
      "Dark": "다크",
      "Light": "라이트",
      "Classic": "클래식",
      "Modern": "모던",
      "Game Items Language:": "게임 아이템 언어:",
      "Meld Solver Workers:": "금단 계산기:",

      //직업
      "PLD": "나이트",
      "WAR": "전사",
      "DRK": "암흑기사",
      "GNB": "건블레이드",

      "WHM": "백마도사",
      "SCH": "학자",
      "AST": "점성술사",
      "SGE": "현자",

      "MNK": "몽크",
      "DRG": "용기사",
      "NIN": "닌자",
      "SAM": "사무라이",
      "RPR": "리퍼",
      "VPR": "바이퍼",

      "BRD": "음유시인",
      "MCH": "기공사",
      "DNC": "무도가",

      "BLM": "흑마도사",
      "SMN": "소환사",
      "RDM": "적마도사",
      "PCT": "픽토맨서",

      "BLU": "청마도사",

      //종족
      "Select a Race/Clan": "종족/부족 선택",
      "Duskwight": "황혼 부족",
      "Wildwood": "숲 부족",
      "Seekers of the Sun": "태양의 추종자",
      "Keepers of the Moon": "달의 수호자",
      "Sea Wolf": "바다늑대",
      "Hellsguard": "불꽃지킴이",
      "The Lost": "떠도는 별",
      "Helion": "맴도는 별",
      "Highlander": "고원 부족",
      "Midlander": "중원 부족",
      "Plainsfolk": "평원 부족",
      "Dunesfolk": "사막 부족",
      "Rava": "라바 비에라",
      "Veena": "비나 비에라",
      "Xaela": "아우라 젤라",
      "Raen": "아우라 렌",

      //파티 보너스
      "No Party Bonus": "파티 보너스 없음",
      "1 Unique Roles": "1종류 직업군",
      "2 Unique Roles": "2종류 직업군",
      "3 Unique Roles": "3종류 직업군",
      "4 Unique Roles": "4종류 직업군",
      "5 Unique Roles": "5종류 직업군",
    };

    function replaceText() {
        const walk = document.createTreeWalker(
            document.body,
            NodeFilter.SHOW_TEXT,
            null,
            false
        );

        let node;
        while ((node = walk.nextNode())) {
            let newText = node.nodeValue;

            newText = newText.replace(/\+(\d+)\s+([가-힣]+)/g, (_, num, stat) => `${stat} +${num}`);

            for (const [original, replacement] of Object.entries(wordReplacements)) {
                newText = newText.replace(new RegExp(original, 'g'), replacement);
            }

            const keywords = ["이터널 퀸", "-placeholder-"];

            keywords.forEach(keyword => {
              if (newText.includes(keyword)) {
                newText = newText.replace(keyword, "").trim();
                newText = keyword + " " + newText;
              }
            });

            if (newText !== node.nodeValue) {
                node.nodeValue = newText;
            }
        }
    }

    function updateMateriaLabels() {
        const materiaDisplays = document.querySelectorAll('materia-count-display');

        materiaDisplays.forEach(display => {
            if (display.getAttribute('data-updated') === 'true') return;

            const title = display.getAttribute('title');
            if (!title) return;

            const nameMatch = title.match(/^(.+?)\s*:/);
            const statMatch = title.match(/:\s*\+(\d+)\s+(.+)$/);
            if (!nameMatch || !statMatch) return;

            const materiaName = nameMatch[1];
            const statValue = statMatch[1];
            const statNameOriginal = statMatch[2];

            const quantityElem = display.querySelector('.materia-count-quantity');
            const materiaView = display.querySelector('single-materia-view-only');
            if (!quantityElem || !materiaView) return;

            const quantityText = quantityElem.textContent.match(/\d+/)?.[0];
            if (!quantityText) return;

            const imageHolder = materiaView.querySelector('.materia-image-holder');
            const statSpanInView = materiaView.querySelector('span');
            const statText = statSpanInView?.textContent || `${statNameOriginal} +${statValue}`;

            display.innerHTML = '';

            const wrapper = document.createElement('div');
            wrapper.className = 'materia-line-wrapper';

            const statBlock = document.createElement('div');
            statBlock.className = 'materia-stat-block-left';

            if (materiaView && imageHolder) {
                const clonedView = materiaView.cloneNode(true);
                const holders = clonedView.querySelectorAll('.materia-image-holder');
                const spans = clonedView.querySelectorAll('span');

                holders.forEach((el, idx) => {
                    if (idx > 0) el.remove();
                });

                spans.forEach((el, idx) => {
                    if (idx > 0) el.remove();
                });

                statBlock.appendChild(clonedView);
            }

            const nameQuantitySpan = document.createElement('span');
            nameQuantitySpan.className = 'materia-name-quantity-right';
            nameQuantitySpan.textContent = `${materiaName} ${quantityText}개`;

            const exportOption = document.querySelector('option[label="Export..."]');
            if (exportOption) {
            exportOption.label = '내보내기...';
            }

            wrapper.appendChild(statBlock);
            wrapper.appendChild(nameQuantitySpan);
            display.appendChild(wrapper);
            display.setAttribute('data-updated', 'true');
        });
    }

    window.addEventListener('load', () => {
        replaceText();
        updateMateriaLabels();

        const observer = new MutationObserver(() => {
            replaceText();
            updateMateriaLabels();
        });

        observer.observe(document.body, {
            childList: true,
            subtree: true,
            characterData: true
        });
    });
})();

QingJ © 2025

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