aboutsummaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-06-25 16:06:41 -0400
committerBobby <[email protected]>2023-06-25 16:06:41 -0400
commitb2099c9dcedc713cc7ff3f9be253b7b218f7fb72 (patch)
treed3a7ae23501575c8adc619b08cabc19cf91d497a /static/js
parent2143f7e90ac87cc4cb366e045da074432b9b83a6 (diff)
downloadthatcomputerscientist-b2099c9dcedc713cc7ff3f9be253b7b218f7fb72.tar.xz
thatcomputerscientist-b2099c9dcedc713cc7ff3f9be253b7b218f7fb72.zip
Font Rendering for Japanese and Code Blocks
Diffstat (limited to 'static/js')
-rw-r--r--static/js/tl.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/static/js/tl.js b/static/js/tl.js
index 599f64bd..44c8b044 100644
--- a/static/js/tl.js
+++ b/static/js/tl.js
@@ -13,13 +13,15 @@ function restoreLang() {
localStorage.setItem("lang", "en");
$('#tl_ja').hide();
$('#tl_en').show();
+ $('body').addClass('en');
+ $('body').removeClass('ja');
var translateContainers = $('iframe');
if (translateContainers.length === 0) {
// nothing
} else {
translateContainers.each(function (index, element) {
- if (element.contentWindow.document.getElementById(":1.restore")) {
- element.contentWindow.document.getElementById(":1.restore").click();
+ if (element.contentWindow.document.getElementById(":1.close")) {
+ element.contentWindow.document.getElementById(":1.close").click();
}
});
}
@@ -29,8 +31,9 @@ function translateJapanese() {
localStorage.setItem("lang", "ja");
$('#tl_en').hide();
$('#tl_ja').show();
+ $('body').addClass('ja');
+ $('body').removeClass('en');
var selectEl = document.querySelector("select.goog-te-combo");
- console.log(selectEl);
if (!selectEl) {
setTimeout(function () {
translateJapanese();
@@ -54,8 +57,12 @@ if (!currentLang) {
if (currentLang === "ja") {
$('#tl_en').hide();
$('#tl_ja').show();
+ $('body').addClass('ja');
+ $('body').removeClass('en');
} else {
$('#tl_ja').hide();
$('#tl_en').show();
+ $('body').addClass('en');
+ $('body').removeClass('ja');
restoreLang();
}