[Userscript] Forum: IME2Furigana

Nice, sounds cool!

Later this year I’m planning to build an actual Discourse plugin to simplify adding furigana. But I need a new computer first. :confounded:

7 Likes

ためしている
(didnt see the f)

1 Like

Right, I should have added an image to my first post to show the location of the button that activates this script’s functionality. Fixed.

1 Like

すごい!!!

亜梨画東御剤升ありがとうございます

4 Likes

便利べんりそうですね。
Also definitely nice because I just made a post where I typed this by hand, and that would get annoying fast.

2 Likes

Oh, but you have used the rp tags to add brackets to the furigana in this other post, so it looks much nicer when quoted. I have updated my script so that it also adds rp tags.

Version 0.2 now also returns the focus back to the textbox after clicking the “F” button so that you can immediately continue typing without having to click into the textbox first.

1 Like

Discourse has on their very long to-do list to eventually fix the quoting for ruby tags so it will include them in the quoted text. But I guess the rp tags are still useful (even in the long run) when copying between sites.

2 Likes

このスクリプトは素晴(すば)らしいです。

4 Likes

ルビーテキストが好きI like ruby text :slight_smile:

3 Likes

Isn’t this how it’s usually written anyway?


Neat script, it’s better than my script which converts <kanji>[furigana] into ruby


Bug report: The script remembers that I turned it on, but the button is says off when I start a new post (until I click it again and it says blur)

2 Likes

Generally the furigana should be above the specific kanji it’s actually associated with. The exception is when the reading of the word has no association with the individual kanji, like with 明日.

3 Likes

In my experience they seem to center the furigana on the word whenever the reading is longer than maybe 3 or 4 kana, for a word with two kanji

I actually just saw furigana in a physical book the other day that added whitespace similar to the browser to put the furigana above just the correct kanji. But I’ve seen what you said as well for long readings. I still think that’s bad practice when the reading only has one or two characters and would fit above the correct kanji though.

1 Like

Thanks for the report, I have fixed it (version 0.3).

Regarding the positioning of the furigana, I think that a clear mapping where possible would be preferable. But as far as I know most webbrowsers except for firefox don’t support ruby well enough to do this. I’ve read through https://www.w3.org/International/articles/ruby/markup.en a while ago and the browser support doesn’t look too good.

2 Likes

Kinda think something like 小林こばやし looks rather better than ばやし. Also, fewer tags needed.

2 Likes

I think the same holds for even 四月(しがつ) and がつ

3 Likes

Bit of a strange question, is it possible to make this available for any discourse forum? I would love to also be able to use this on BunPro for example.

I think it should work if you just add
// @match https://community.bunpro.jp/*
after or before
// @match https://community.wanikani.com/*

That would work, I just was wondering if there was a way to detect whether you are using a discourse forum, or if that would require a complex script.

I don’t think the URL can be used as an indicator if the webpage is a discouse forum, so I would have to inject the script into every webpage and then let it guess if the page is a discourse forum. The guess part is probably not a problem, but I don’t really like the idea that the script gets injected into every webpage you visit.

1 Like