orna codex lang switcher

orna codex lang switcher!

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==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);
})();