Skip to content

[fix](doc) translate.md: align en/zh to 11 examples; fix en table widths and case mixing#3798

Open
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/translate-align-examples
Open

[fix](doc) translate.md: align en/zh to 11 examples; fix en table widths and case mixing#3798
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/translate-align-examples

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 26, 2026

Summary

Doc page (4.x): `scalar-functions/string-functions/translate.md` (EN + ZH).

This page was Pattern-A: each side covered some corner cases the other didn't, plus EN had several small bugs.

EN bugs fixed

  • Result tables for examples 1-3 had divider rows 2 chars short of the column-name row — the ASCII grid rendered ragged on docusaurus.
  • Examples 1-4 used lowercase `translate(...)`, examples 5-9 used uppercase `TRANSLATE(...)` — the column headers in the result blocks were inconsistent within the same page.
  • Missed four corner cases ZH already covered: multi-character mapping (`'ac' -> 'zx'`), NULL propagation, empty-string edge cases, and the duplicate-on-both-sides example (`'aabbccaa', 'abab', 'xyuv'`).

EN content trims

  • Dropped the standalone "char deletion via empty ``" example — its behavior is now in the broader empty-string example.
  • Dropped the Palhoça example — UTF-8 coverage is in the multi-byte example.

ZH gains

  • Added the "every occurrence in source is replaced" example (`'abcda', 'a', 'z'` -> `zbcdz`) that EN had, which makes the one-occurrence-vs-many distinction explicit.
  • Light prose edits so the example intros read as parallel translations.

After this change both pages share the same 11 examples in the same order. Every result block is verbatim mysql client output on Apache Doris 4.1.1.

Test plan

  • Run every example end-to-end on the cluster — each result block matches.
  • EN and ZH structure: identical 11-step list.
  • No `Syntax` block changes.

🤖 Generated with Claude Code

…widths

This page is a Pattern-A merge with several small issues on each side.

EN:
- Result tables for examples 1-3 had divider lines 2 characters short
  of the column-name row, so the grid renders ragged on docusaurus.
- Examples 1-4 used lowercase `translate(...)` while 5-9 used uppercase
  `TRANSLATE(...)`, so the result-block column headers were
  inconsistent within the same page.
- Missed four corner cases that ZH already covered: multi-character
  mapping (`'ac' -> 'zx'`), NULL propagation across all three args,
  empty-string edge cases (empty source / empty `<from>` / empty
  `<to>`), and the duplicate-on-both-sides example
  (`'aabbccaa', 'abab', 'xyuv'`).
- Dropped the standalone "char deletion via empty `<to>`" example
  (example 4) — its behavior is now part of the broader
  empty-string example.
- Dropped the "special character" Palhoça example — UTF-8 coverage
  is provided by the broader multi-byte example.

ZH:
- Added the "every occurrence in source is replaced" example
  (`'abcda', 'a', 'z'`) that EN had, which made the
  one-instance-vs-many distinction explicit.
- Light prose edits on intros so they read as parallel translations
  of the EN intros.

After this change EN and ZH share the same 11 examples in the same
order. Every result block is the verbatim mysql client output on
Apache Doris 4.1.1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant