Repository navigation
Conversation
…ed headings The merge train dropped the TemplateLocale (#2357) and AssetCatalog.Read (#2379) paragraphs from docs/en and docs/zh l10n.md, glued the rich-text direction paragraph (#2310) onto the "Per-language asset catalogs" heading, and left the MirrorRect paragraph under "CSV exchange". In text.md the GenerateSDF paragraph (#2301) landed in the rich-text section and "Wrapping and overrun" (#2297) became a subsection of "Text effects".
…oundary Ellipsize returned the whole string for OverrunClip, and OverrunWordEllipsis cut the rune slice at the word boundary and then resliced it back out to max-1 runes, so it gave the same result as OverrunEllipsis. Both now honour the limit, with table tests for every mode and CJK input. The Overrun constants get doc comments and BreakLines describes what it breaks at.
…contract SDFOptions gained an Effects field next to its own Outline and OutlineColor, so an outline set through the shared contract was silently ignored by the one backend that can draw it. SDF drawing now uses Effects.Outline and OutlineColor when its own outline fields are unset, TextEffects fields get doc comments with units, and the Effects fields on Options and PlatformStyle say that those backends do not draw them yet. The previous test only read back a struct literal; it now checks the SDF style the options resolve to.
…h text reorderRichLine matched the bidi-reordered string back to tokens by cluster text, so a line that repeats a letter gave the visual-first copy the logical-first token (wrong reveal index and style), and any right-to-left line with a mirrored bracket or a reversed ZWJ sequence failed the match and was silently left in logical order. A line with an inline icon was never reordered. l10n gains VisualRuneOrder, which returns the logical rune index at each visual position from the same bidi pass as VisualOrder, and rich layout now permutes tokens by it, draws mirrored brackets as VisualOrder does, keeps the tokens of one grapheme cluster together, and treats an icon as U+FFFC.
ImportCSV let a later row with the same key silently replace an earlier one and accepted repeated, empty or non-canonical locale columns and empty keys; it now refuses them with the CSV line. ValidatePlaceholders only checked that the source placeholders survived, treated "{{" escapes as placeholders and reported a random one first; it now requires the same placeholders with the same counts, follows the StripPlaceholders brace rules and reports in sorted order. The tests cover sorting, a byte-stable round trip with quoted and multi-line cells, and each refusal.
ImportCSV let a later row with the same key silently replace an earlier one and accepted repeated, empty or non-canonical locale columns and empty keys; it now refuses them with the CSV line. ValidatePlaceholders only checked that the source placeholders survived, treated "{{" escapes as placeholders and reported a random one first; it now requires the same placeholders with the same counts, follows the StripPlaceholders brace rules and reports in sorted order. The tests cover sorting, a byte-stable round trip with quoted and multi-line cells, and each refusal.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up review of the l10n and text pull requests the merge train landed on 2026-11-29, checked against current
main.#2312 feat(l10n): add CSV exchange helpers
Landed intact. Problems:
ImportCSVlet a second row with the same key silently replace the first, and accepted empty keys and repeated, empty or non-canonical locale columns;ValidatePlaceholdersonly checked that source placeholders survived (a translation adding{bonus}passed), counted{{/}}escapes as placeholders unlikeStripPlaceholders/Catalog.T, and reported a map-order-dependent placeholder first. The test only read one cell back.This PR:
ImportCSVrefuses those tables with the CSV line,ExportCSVrefuses an empty key or a bad locale column,ValidatePlaceholdersrequires the same placeholders with the same counts using theStripPlaceholdersbrace rules and reports in sorted order. Tests cover key order, a byte-stable round trip with quoted and multi-line cells, each refusal and the placeholder rules. #1431 stays open (PO,game l10n, editor are not done; the PR did not claim to close it).#2349 test: fuzz localization yaml loader
Landed intact (its changelog fragment was folded into the 0.4.0 release). The only non-empty seed had no plurals; this PR also seeds the target from
testdata/en.yaml.#2357 feat(l10n): add template locale selection
Code landed intact; the
docs/enanddocs/zhl10n.mdparagraph was dropped by the merge. Restored under "Choosing a template's locale".#2379 feat(l10n): add localized asset read helper
Code landed intact; the "Reading localized assets" section was dropped from both
l10n.mdfiles. Restored.#2297 feat(text): add wrapping and overrun helpers
Problems:
Ellipsizereturned the whole string forOverrunClip(no truncation at all), andOverrunWordEllipsiscut the rune slice at the word boundary and then resliced it back out tomax-1runes, so it behaved exactly likeOverrunEllipsis. TheOverrunconstants had no doc comments andBreakLinesclaimed Unicode whitespace breaking while it only breaks at space and tab. The merge also nested "Wrapping and overrun" under "Text effects" intext.md.This PR fixes both modes with table tests (including CJK), documents the constants and corrects the
BreakLinescomment, and makes the docs heading a section of its own.#2298 feat(text): add shared text effects contract
Problems:
SDFOptionsgainedEffectsnext to its ownOutline/OutlineColor, so an outline set through the shared contract was silently ignored by the only backend that can draw one;TextEffectsfields had no doc comments or units; the test only read back a struct literal. Thegameui.mdsentence the merge dropped ("Text widgets can carry the sharedtext.TextEffectsstyle") is not restored because no gameui widget has such a field.This PR makes SDF drawing use
Effects.Outline/OutlineColorwhen its own outline fields are unset, documents every field, states onOptions.EffectsandPlatformStyle.Effectsthat those backends do not draw them yet, and replaces the test with one that checks the resolved SDF style.#2301 feat: add deterministic font sdf generation
Code landed intact; the docs paragraph landed in the rich-text section and is moved to the SDF fonts section. The PR said "Closes #1421", but it only converts an alpha mask to a single-channel SDF: there is no TrueType/OpenType outline reading, no MSDF, no
game assetsfont sidecarkind, nocharsFrombaking and no atlas output. #1421 does not meet its acceptance and should be reopened.#2310 feat(text): make rich layout grapheme and RTL aware
Problems:
reorderRichLinematched the reordered string back to tokens by cluster text. With a repeated letter (Hebrew "אבא") the visually first copy took the logically first token, so the wrong glyph got that token's style and reveal index; any right-to-left line whereVisualOrderchanges the text (mirrored brackets, a ZWJ sequence reversed rune by rune) failed the match and was silently left in logical order; a line with an inline icon was never reordered. The merge also glued the docs paragraph onto the "Per-language asset catalogs" heading in bothl10n.mdfiles.This PR adds
l10n.VisualRuneOrder(the logical rune index at each visual position, from the same bidi pass asVisualOrder;reorderLineis split so both share it) and has rich layout permute tokens by it, take each token's drawn rune fromVisualOrder(mirrored brackets), keep a cluster's tokens together and treat an icon as U+FFFC. Tests check reveal indices and style for a repeated letter and the order with brackets; the note gets an amendment. Headings fixed.Verification
go tool nsgo test ./pkg/l10n/... ./pkg/text/...(blackmac): 120 passedgo tool nsgo check ./pkg/l10n/...and./pkg/text/...,go tool nsgo test ./internal/repocheck/...,go run ./tools/changelog check,bun run verify-notesThe commit "fix(l10n): refuse ambiguous CSV tables and extra placeholders" appears twice; the second one (only
yaml_fuzz_test.go) is the fuzz seed change.Screenshots: None