As of now, I don’t really frequent this forum, but I came across the fact that Han unification also affects this forum. That is, some Kanji look different from what are usually seen in Japanese media. Instead, they became like of mainland China or Taiwan counterparts.
Some of the drastic differences include, 直線、海、過ぎる、似る、角、誤解.
After all, I don’t even know if it is even possible to force Japanese font (like Noto Sans JP) on Discourse, but I think it does matter, being a Japanese community.
Ideally it should using var selectors, but I don’t know if it is feasible with the current tools, and if not, whether Discourse would add the feature for clients that use Eastern languages.
If your device is set up to prioritize Japanese over Chinese (e.g. by installing a Japanese keyboard) it should always render correctly.
In HTML, you can specify the language per span/div, but I don’t think it would be straightforward to do that in Discourse. It would probably require overriding a lot of Discourse code since I’d guess they are generally language agnostic.
It should be possible to set font-family (CSS property) to a list including a Japanese font face / variant, although tbh I would find that annoying as despite having the Noto fonts installed, I would much prefer to use Motoya “Maru”.
The only way to default to Japanese is to mark the whole forum as Japanese. But most of the forum is English, not Japanese. It would probably render everything better, but search engines might treat the forums differently if all the English text is marked as Japanese.
The right way to do it is to mark Japanese text as Japanese, like this:
That’s not exactly intuitive, so it would be great to have a button or something to mark text as Japanese. But since WK’s forums are hosted by Discourse, customization probably isn’t an option.
This is a third-party script/app and is not created by the WaniKani team. By using this, you understand that it can stop working at any time or be discontinued indefinitely.
It appears that forcing font can be quite overdone and unbeautiful. (Also, an ugly way to avoid styling code using !important.)
// ==UserScript==
// @name WaniKani Community prioritize Japanese glyphs
// @namespace https://github.com/patarapolw
// @version 0.1.3
// @description Prioritization of Japanese glyphs for Han unification
// @author polv
// @license MIT
// @match https://community.wanikani.com/*
// @icon https://www.google.com/s2/favicons?domain=community.wanikani.com
// @grant none
// ==/UserScript==
(() => {
function injectLangHTML(lang) {
// I might not need to use MutationObserver at all...
const obs = new MutationObserver(() => {
if (document.documentElement.lang !== lang) {
document.documentElement.lang = lang;
}
});
obs.observe(document.documentElement, { attributeFilter: ["lang"] });
// Only this part is the real thing.
document.documentElement.lang = lang;
}
injectLangHTML("ja-JP");
})();
Edit: It appears to be extremely simple. Only <html lang="en"> needs to be edited. (And <html lang="ja"> doesn’t work in Firefox for Arch Linux for some reasons.)
interestingly installing the userscript did not change it at all for me. I guess its because I have japanese installed as a langauge with higher priority than chinese on my computer (i quite often experience the problem in the other direction tho)
Just type the span tags exactly as shown. Certain html tags and attributes are whitelisted in discourse. In fact, it was me and @seanblue that got the folks at discourse to whitelist the lang tag.
Interesting.
By the way, when I mentioned marking the whole forum as Japanese, I meant adding a lang tag to a top-level html tag, rather than actually configuring your account language.
That’s because most of the badges are built into Discourse and Discourse includes a Japanese translation of the site. Notice that all the custom WaniKani badges (like the durtle ones) aren’t translated.