A bug report discusses the localization of posts in topics with more than 20 posts, where only the first 20 posts are translated when switching languages, and subsequent posts remain untranslated. Moin describes the issue, noting that toggling language translation and scrolling causes the first 20 posts to be translated while later posts stay in the original language. Falco clarifies that the “Show Original” button only applies to the current page of posts and is not respected when loading new posts via scrolling. Moin adds that the issue may involve a missing request when scrolling, as the /posts.json endpoint does not respect the content-localization-show-original cookie. nat confirms the issue and nat notes that a fix has been merged and will likely be deployed to Meta within an hour.
Expected: All posts are English. Actual result: The first 20 posts are English, but those loaded on scrolling are in the original language.
This also happens on other topics with more than 20 posts. I chose this post as the example because the last posts aren’t in English, so it can be reproduced with an English interface. If you choose a different interface language, you can reproduce it on a topic with English posts too.
Took me a while to understand, but the gist of the bug is:
“Show Original” button only applies to current “page” of posts, and it not respected when loading next page via scrolling
Right?
This would drill down to the route at GET https://meta.discourse.org/t/#{topic.id}/posts.json?post_ids[]=#{posts.id} not respecting the cookie content-localization-show-original: "true".
My problem was that I was reading the topic in the original language. Then I used the toggle, because I don’t speak Chinese. That took me back to the first post (I don’t fully understand why; it doesn’t always happen. That’s why I chose scrolling in the steps above).
And then the first 20 posts were in English, but the last ones were still in Chinese.
I think in that case, a show-original: "false" would be what I needed to see all posts in English. I haven’t tried it the other way around or checked the requests. I haven’t found a replacement for the Kiwi browser which allows using dev tools on Android.
The /posts.json?post_ids does cater for “show original”, but the issue is due to the frontend store just loading the existing posts. Here’s a fix that also addresses the annoying jump back to first post.