Repository: importantimport/hatsu (language: rust)

Issue:
Language might not be set correctly (contentMap) with multi-language feeds?
With hatsu v0.3.1 / v0.3.2, it appears the language of the post (feed item) is not set correctly.

Take for example https://browser.pub/https%3A%2F%2Fblog.uvokchee.de%2Fposts%2Fhttps%3A%2F%2Fblog.uvokchee.de%2F2025%2F01%2Fmy-static-blog-now-has-activitypub.html

```
...

  "contentMap": {
    "de": "<p>My Static Blog now has ActivityPub</p>\n<p>Thanks to Hatsu, my blog now has ActivityPub support. Or so I hope. This is mostly a test post to see if it works.</p>\n<p><a href=\"https://blog.uvokchee.de/2025/01/my-static-blog-now-has-activitypub.html\">https://blog.uvokchee.de/2025/01/my-static-blog-now-has-activitypub.html</a></p>\n\n<a href=\"https://blog.uvokchee.de/t/tech\" rel=\"tag\">#<span>tech</span></a>"
  },
...
```

If you look at the feed:
https://blog.uvokchee.de/feed.xml
the respective post has the language set to en:

```
<entry xml:lang="en">
<title type="html">My Static Blog now has ActivityPub</title>
```

This is a mixed-language feed / blog, so I guess this leads to the problem.

The post object is already like this in the database, so I guess the "language detection" would have to happen on feed parsing / writing into the database? (I'll take a look and see if I can find where this happens).


Discussion / hints:
Hatsu will first try to query for the language of the post and only use the top-level language if it can't be queried.

https://github.com/importantimport/hatsu/blob/e148e7994b6b074eb43a8d982cf522cdc3d7203b/crates/apub/src/objects/note.rs#L141-L144
https://github.com/importantimport/hatsu/blob/e148e7994b6b074eb43a8d982cf522cdc3d7203b/crates/feed/src/user_feed_item.rs#L122

Well, another mistake I made.

Fix patch:
diff --git a/crates/feed/src/user_feed_item.rs b/crates/feed/src/user_feed_item.rs
index 6f7fc5c..ff1ad85 100644
--- a/crates/feed/src/user_feed_item.rs
+++ b/crates/feed/src/user_feed_item.rs
@@ -119,7 +119,7 @@ impl UserFeedItem {
                 .and_then(|link| Url::parse(&link.href).ok()),
             title: entry.title.clone().map(|text| text.content),
             summary: entry.summary.clone().map(|text| text.content),
-            language: None,
+            language: entry.language.clone(),
             tags: entry
                 .categories
                 .iter()


Test patch: