Translating Books and Papers

I have a side project called BookLoggr which was created for the purpose of saving notes to books as I have done for decades but on the empty back pages of books. A year ago I added a feature for uploading pdfs and found myself often just cutting and pasting interesting sentences. I soon started saving academic papers as well as books.

Only recently have I begun to appreciate reading beginner books in french. On each page, I’ll find many new words that I need to look up and annotate with the english word inside the book. It is very time consuming and awkward to put the book down, pull up and type the word into the translation form. It is much less disruptive to be able to click a button to translate the page and I can optionally write the english word inside the physical copy of the book.

So, I decided to repurpose my existing interface for adding a note (which was already associated with a page number) to make the note the entire contents of a page. Now, before I start reading the french book, I add each page of the book as a note. Last night, I wrote the code to allow clicking a button to translate a page of french text using DeepL.


I added the pages last night and will try it out and see how it goes…

Correction: check_webfinger!

Mastodon is not the fediverse and in my check_webfinger! post, I’m afraid I made that assumption. In particular, I concluded

So, from the perspective of mastodon, the domain component of your identifier you are known as is determined by which domain serves your actor document rather than the domain serving the original “well known” webfinger document.

which is not necessarily true if you consider the fediverse outside of Mastodon.

Instead, it seems that I should have said that the domain component of your identifier is determined by the domain component of the subject field returned in the webfinger response from the domain that serves your actor document when mastodon makes its 2nd webfinger request which is done in the check_webfinger! method.

  def check_webfinger!
    webfinger                            = webfinger!("acct:#{@username}@#{@domain}")
    confirmed_username, confirmed_domain = split_acct(webfinger.subject)

In the code above, the @domain passed to webfinger! is the domain of the server providing the activitypub actor document but the confirmed_domain can be different (e.g. your personal domain) if your original “well known” webfinger document was not pointing to a Mastodon server for providing the actor document.

Therefore, if you have a static personal website, it is not necessary to also host the actor document there as long as the fediverse node providing the actor document is smart enough to provide your personal domain in the subject when mastodon makes a webfinger call to it. A caveat is that such a fediverse node accomodating personal domains would not be able to distinguish between and when mastodon webfingers for