Repository navigation
Conversation
Chinese newsletters 203+ referenced /en/ pages for issues that already have a /zh/ translation (issue bitcoinops#2383). Only the language segment is retargeted: 196 references. Two are intentionally left on /en/: - a quoted tweet in bitcoinops#200, whose text is verbatim third-party content - bitcoinops#5, where the /en/ anchor is already dead upstream; changing the language segment would not fix anything
Fix 40 references across 23 files. Each new fragment is verified against the id the target Chinese page emits in a local jekyll build, and each edit is located by full link string rather than line number -- an earlier pass mis-assigned four anchors in bitcoinops#231 through line drift. Four groups: - term names replaced by the heading they belong to (#musig2, #rollup, #ln-penalty, #btcd-lnd, #bip324) - <!--n1-->/<!--n8--> placeholder comments replaced by the full slug - the {:#x-only-pubkeys} marker restored in bitcoinops#72 - bitcoinops#231 [news214 sp] repointed to #updated-silent-payments-pr; the English original does carry this reference, only its fragment is wrong
The Chinese source wrote the comment anchor as 'bitcoincompatible' while the English page emits 'bitcoin-compatible'. Only the heading and bitcoinops#231's reference use it, so align both sides and keep the reference identical to the English original instead of translating the fragment.
It seems https://bitcoinops.org/en/newsletters/2018/06/26/#first-optech-workshop is indeed correct? It seems some of the anchors have changed which is ok internally it seems but if anyone has bookmarked the old anchors, they will end up on that page without the anchor. I think this is ok but just wanted to bring it up. Also, I think you touch some of @hulatown 's translated pages so tagging him here in case he has any feedback. |
|
Thanks — you're right on all three points, and I've corrected the description. #5 is not an upstream problem. On the anchors that changed, here is the count, measured against the built HTML rather than the source:
So the cost is exactly what you describe — a bookmark to one of the 91 old ids lands at the top of the page. I agree that is acceptable. If you would rather keep them alive, I can add empty @hulatown — only two of the files touched here were originally added by you (#252 and #253, 2023-05-24 and 2023-05-31). The edits there are language segment and anchor only, no wording changes. Happy to revert anything that looks off. I've also added an "Anchor changes" section to the description with these numbers, and corrected the note about #5. |
bitschmidty
left a comment
There was a problem hiding this comment.
It seems the older "2022” commit also changes some wording, not just links and anchors.
I'm ok either way on these. If they're intentional, we can keep them, lmk @bittomhan
Summary
Fixes #2383.
Chinese translations of newsletters #203 onward linked to the
/en/page even when a/zh/translation already existed. This PR points them at the Chinese page, and corrects the anchors that would otherwise land on the wrong place.Two kinds of edits are needed, because switching the language segment alone is not enough:
/en/newsletters/→/zh/newsletters/for 196 references. The target Chinese page exists in every case.If only step 1 were done, those 42 links would render and navigate, but land at the top of the page instead of the referenced item — a silent half-fix. They are kept in a separate commit so the two concerns can be reviewed independently.
Size
d3f6fe38be8ee2941f61d2f5dc0ff28a6b21643dupstream/masterd3f6fe38predates this work: it covers #204–#228 with the same two kinds of edits (41 references, plus 174 anchor reforms that make the Chinese item ids match the English ones). It was never merged, so it travels with this branch rather than being redone.How the anchors were chosen
Two cases, both verified against the id the target page actually emits in a local
jekyll build:#conclusion→#结论on the 2020 year-in-review.Three specific problems were found and fixed along the way:
n1/n8were used as item ids on Compat: color address type #202 and Compat: re-order RBF and segwit #198, so the page emitted those instead of the full slug. Replaced with the real slug.{:#x-only-pubkeys}marker that the English page has, so the paragraph generated no id at all. Restored.#pron [style] August updates #214, which exists in neither language. The English original does carry this reference, only its fragment is wrong; it now points at#updated-silent-payments-pr, the item that sentence describes.Anchor changes
#2383 also asks that future translations be able to reuse the anchors we already have, which is only true if the Chinese page emits the same id as the English page for the same item. This PR therefore also aligns item ids, and that changes some anchors. Measured by diffing the ids in the built HTML before and after:
#musig2→#musig2-security-vulnerability,#rollup→#validity-rollups-research, and the two degraded#n1/#n8→#experimentation-with-silent-payments/#btcpay-server-1-5-1.#newsbecomes#新闻on compat: Mycelium on Android supports sending to P2WPKH and P2SH #216 and Plugins: auto-anchor: use smallest match #218, because those pages had an untranslated## Newsheading that is now translated. This is the only case where a Chinese id moves away from the English one.hrefin the built site afterwards: 0 fragments pointing at a Chinese newsletter resolve to a missing id.The cost is that a bookmark to one of the 91 old ids now lands at the top of the page. Keeping them alive is possible by adding an empty
<a id="old-id">next to each new one, but that is 91 lines of marker noise on 24 pages for ids that were mostly malformed to begin with (n1,n8, duplicated suffixes), so this PR does not do it. Happy to add them if reviewers prefer.Not touched by this PR
[workshop announce]reference points at/en/newsletters/2018/06/26/#first-optech-workshop. That id does exist on the English page, and the Chinese page of the same newsletter emits its own id,#第一次-optech-工作坊. The reference is correct as written; it is simply outside the Newsletters: add 60 (2019-08-21) #203-onward scope of Chinese translation link updates #2383, so it is left alone rather than because of a missing anchor.Three files below #203 are touched, each for a specific reason rather than as part of the bulk conversion: #72 (adds the
{:#x-only-pubkeys}marker the translation had dropped), #180 (two references retargeted to the Chinese heading ids), and #198 (the degradedn8id).Verification
bundle exec jekyll buildpasses (exit 0) in a clean build.Notes for the reviewer
be8ee294is a mechanical one-line-per-reference change; the anchor commit is where judgement was involved.#preparing-for-taproot-1-bech32m-sending-support→#准备-taproot-1bech32m-发送支持). Making them identical would require adding comment anchors to those five pages, which would in turn break references already pointing at the Chinese ids.