mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 04:29:41 +00:00
chore: rename practice.rs to practice.course.rs
This commit is contained in:
35
zh-CN/assets/lang1.js
Normal file
35
zh-CN/assets/lang1.js
Normal file
@ -0,0 +1,35 @@
|
||||
(function () {
|
||||
var path = window.location.pathname;
|
||||
var link = "https://practice.course.rs" + path;
|
||||
var word = "English";
|
||||
var lang = "zh-CN";
|
||||
var changeLang = "切换到英语";
|
||||
|
||||
if (window.location.href.indexOf("zh.") == -1) {
|
||||
link = "https://practice-zh.practice.rs" + path;
|
||||
word = "简体中文";
|
||||
lang = "en";
|
||||
changeLang = "Switch to Chinese";
|
||||
}
|
||||
|
||||
var lang_node = "";
|
||||
if (link != "") {
|
||||
lang_node =
|
||||
'<a href="' +
|
||||
link +
|
||||
'" title="' +
|
||||
changeLang +
|
||||
'" aria-label="' +
|
||||
changeLang +
|
||||
'"><i id="change-language-button" class="fa fa-language"> ' +
|
||||
word +
|
||||
"</i></a>";
|
||||
}
|
||||
|
||||
console.log(lang_node);
|
||||
var insertNode = document.getElementsByClassName("right-buttons");
|
||||
if (insertNode.length > 0) {
|
||||
var html = insertNode[0].innerHTML;
|
||||
insertNode[0].innerHTML = html + lang_node;
|
||||
}
|
||||
})();
|
Reference in New Issue
Block a user