Skip to content

Add: Chinese translation of abs() complexity documentation - #6

Open
shaozk wants to merge 1 commit into
heikkitoivonen:mainfrom
shaozk:translation-zh-abs
Open

Add: Chinese translation of abs() complexity documentation#6
shaozk wants to merge 1 commit into
heikkitoivonen:mainfrom
shaozk:translation-zh-abs

Conversation

@shaozk

@shaozk shaozk commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What This Changes

  • Add Simplified Chinese translation of the abs() complexity documentation.

Type of Change

  • New content
  • Bug fix
  • Documentation improvement
  • Structure/organization

Related Issues

N/A

This is translated by an LLM and reviewed by a human.

Normalize the Performance Patterns heading to 性能典范 in the
memoryview and sorted translations for consistency.

Co-Authored-By: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>

@heikkitoivonen heikkitoivonen left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this — the abs() page is solid work. Structure matches the English exactly (sections, paragraphs, list items, table shape), code blocks are byte-identical including the aligned-comment style, source_sha is correct and untouched, and the CJK punctuation is clean throughout. It merges cleanly onto main and passes the full make check.

Three terminology points I'd like to fix before merging, plus a note on scope. Note: these are from Claude Code running Opus 5 model. If you disagree, please let me know, and if possible, point to a source that would back your view.

1. ### 强类型### 类型转换 (blocking)

The English heading is "Type Coercion", and the section is about which types abs() accepts and what it returns:

  abs(-5)          # int
  abs(-5.0)        # float
  abs(-5j)         # complex (returns float)
  abs("-5")        # TypeError

强类型 means strong typing, which is a different concept — a reader scanning for typing semantics would land here by mistake. 类型转换 (or 类型强制转换) matches the section.

2. | 实例 || 情况 |

For the | Case | column header. 实例 reads as instance / example. This also makes three different renderings of the same English header across the zh pages:

page English Chinese
sorted.md Case 情况
memoryview_func.md Case 操作
abs.md (this PR) Case 实例

情况 is already established in sorted.md, so I'd standardise on that. (memoryview_func.md is a separate cleanup, not yours.)

3. ## 性能典范 — I'd like to keep 性能模式

典范 means paragon / exemplar — something held up to emulate. These sections list recurring techniques ("vs Copying", "Batch Processing"), which is "pattern" in the software sense, normally 模式 (as in 设计模式). It also splits the same English word two ways inside one file: memoryview_func.md would have 常见模式 for "Common Patterns" and 性能典范 for "Performance Patterns".

If you're reading 模式 as too weak here, I'm open to a different word — 性能实践 or similar — I'd just rather not land 典范. Happy to be corrected if I'm misreading the register.

On scope: the rename touches sorted.md and memoryview_func.md, which are otherwise unrelated to abs(). Could that go in its own PR? Headings drive anchor slugs, so renaming them breaks any existing inbound links to /zh/builtins/sorted/#性能模式. No in-repo links are affected (I checked), but it's worth deciding on its own rather than as a side effect of adding a page.

Follow-up, not your miss: the zh sidebar still shows Absolute in English for this now-Chinese page. Adding Absolute: <label> to the zh nav_translations in mkdocs.yml would complete it. We only documented that step in TRANSLATING.md after this branch was cut, so no worries — but it'd be good to include it here.

Everything else looks good to me. Thanks again!

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.

2 participants