orna codex lang switcher

orna codex lang switcher!

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         orna codex lang switcher
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  orna codex lang switcher!
// @author       Rplus
// @match        https://playorna.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=playorna.com
// @grant        none
// @run-at       document-end
// @license      MIT
// ==/UserScript==

(function() {
  'use strict';
  let qs = new URLSearchParams(location.search);
  let nav = document.querySelector('#nav');
  let a = nav.querySelector('a.nav-item');
  let a_en = a.cloneNode();
  let a_zh = a.cloneNode();

  a_zh.textContent = 'zh';
  qs.set('lang', 'zh-hant');
  a_zh.href = '?' + qs.toString();

  a_en.textContent = 'en';
  qs.set('lang', 'en');
  a_en.href = '?' + qs.toString();

  nav.append(a_en);
  nav.append(a_zh);
})();