Skip to content

docs(zh-Hans): translate 15 API reference pages (utils + components) - #523

Closed
theluckystrike wants to merge 1 commit into
toss:mainfrom
theluckystrike:zh-hans-docs
Closed

theluckystrike wants to merge 1 commit into
toss:mainfrom
theluckystrike:zh-hans-docs

Conversation

@theluckystrike

Copy link
Copy Markdown
Contributor

Closes the zh-Hans portion of #501 (per the roadmap in #497 — claiming the sub-issue as agreed in the issue thread).

What

15 API reference pages translated to Simplified Chinese — all 12 utils and all 3 components pages that were missing a zh-Hans/ locale folder:

utils: buildContext, disableBodyScrollLock, enableBodyScrollLock, getKeyboardHeight, getSafeAreaInset, isAndroid, isIOS, isKeyboardVisible, isServer, mergeProps, mergeRefs, subscribeKeyboardHeight
components: ImpressionArea, Separated, SwitchCase

Method

  • Layout mirrors the Korean pages under ko/ (the reference layout per the contributing guide)
  • Terminology and style follow .claude/agents/agent-translation-reviewer zh-Hans rules: full-width punctuation (,。:;、()?!), half-width space between Chinese and adjacent Latin/digit/inline-code, identifiers untranslated
  • English .md sources untouched (JSDoc-generated)

Verification

Automated structural QA on all 15 files vs their source pages: code-fence counts, <Interface> tag counts, and name=/type= attributes all match; no Korean remnants; CJK confirmed present.

Closes the zh-Hans portion of toss#501. Layout follows ko/ pages; terminology
per .claude/agents/agent-translation-reviewer zh-Hans style guide
(full-width punctuation, half-width spacing around Latin/inline-code).
Verified: code fences, <Interface> tag counts, and name/type attributes
match source pages for all 15.
@changeset-bot

changeset-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: eb356fb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9bb3045) to head (eb356fb).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #523   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           69        69           
  Lines         2280      2280           
  Branches       737       737           
=========================================
  Hits          2280      2280           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hyesungoh hyesungoh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the translation, and for the hooks set in #519! The required items are untranslated headings in two files and a few terms that differ from the glossary in .claude/agents/agent-translation-reviewer.md.


`ImpressionArea` 是一个组件,用于测量特定 DOM 元素在屏幕上的可见时间,并在元素进入或离开视口时执行回调。该组件使用 `useImpressionRef` 钩子来跟踪元素的可见性。

## Interface

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Required: Heading left in English. The other zh-Hans pages use 接口 / 参数 / 返回值 / 示例.

Suggested change
## Interface
## 接口

): JSX.Element;
```

### Parameters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Required: Heading left in English. The other zh-Hans pages use 接口 / 参数 / 返回值 / 示例.

Suggested change
### Parameters
### 参数

description="用于样式设置的其他类名。"
/>

### Return Value

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Required: Heading left in English. The other zh-Hans pages use 接口 / 参数 / 返回值 / 示例.

Suggested change
### Return Value
### 返回值

description="一个跟踪其子元素可见性的 React 组件。"
/>

## Example

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Required: Heading left in English. The other zh-Hans pages use 接口 / 参数 / 返回值 / 示例.

Suggested change
## Example
## 示例

- bottom:34px(主屏幕指示条)
- left/right:0px

## Interface

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Required: Heading left in English. The other zh-Hans pages use 接口 / 参数 / 返回值 / 示例.

Suggested change
## Interface
## 接口

<Interface
name=""
type="boolean"
description="如果设备运行在 iOS 或 iPadOS 上则返回 <code>true</code>,否则返回 <code>false</code>。在服务器端渲染环境中返回 <code>false</code>。"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Required: Glossary and the existing hook pages use 服务端渲染.

Suggested change
description="如果设备运行在 iOS 或 iPadOS 上则返回 <code>true</code>,否则返回 <code>false</code>。在服务器端渲染环境中返回 <code>false</code>。"
description="如果设备运行在 iOS 或 iPadOS 上则返回 <code>true</code>,否则返回 <code>false</code>。在服务端渲染环境中返回 <code>false</code>。"

@@ -0,0 +1,32 @@
# isServer

`isServer` 是一个用于检查代码是否在服务器上运行的工具函数。在 `window` 未定义的 SSR(服务器端渲染)环境中,它返回 `true`;在客户端环境中,它返回 `false`。

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Required: Glossary and the existing hook pages use 服务端渲染.

Suggested change
`isServer` 是一个用于检查代码是否在服务器上运行的工具函数。在 `window` 未定义的 SSR(服务器端渲染)环境中,它返回 `true`;在客户端环境中,它返回 `false`。
`isServer` 是一个用于检查代码是否在服务器上运行的工具函数。在 `window` 未定义的 SSR(服务端渲染)环境中,它返回 `true`;在客户端环境中,它返回 `false`。

@@ -0,0 +1,31 @@
# getKeyboardHeight

`getKeyboardHeight` 是一个工具函数,返回当前屏幕上显示的键盘高度(以像素为单位)。该函数使用 Visual Viewport API 来计算键盘高度。假定运行环境支持 Visual Viewport 的现代环境(Safari / WKWebView 14+,Chrome / Android WebView 80+)。键盘高度的计算方式如下:`window.innerHeight - visualViewport.height - visualViewport.offsetTop` —— 需要减去 `offsetTop` 是为了在键盘出现时正确处理 iOS 的行为。

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Required: The reason for subtracting offsetTop is missing. The source says "where the visual viewport may shift vertically when the keyboard appears".

Suggested change
`getKeyboardHeight` 是一个工具函数,返回当前屏幕上显示的键盘高度(以像素为单位)。该函数使用 Visual Viewport API 来计算键盘高度。假定运行环境支持 Visual Viewport 的现代环境(Safari / WKWebView 14+,Chrome / Android WebView 80+)。键盘高度的计算方式如下:`window.innerHeight - visualViewport.height - visualViewport.offsetTop` —— 需要减去 `offsetTop` 是为了在键盘出现时正确处理 iOS 的行为。
`getKeyboardHeight` 是一个工具函数,返回当前屏幕上显示的键盘高度(以像素为单位)。该函数使用 Visual Viewport API 来计算键盘高度。假定运行环境支持 Visual Viewport 的现代环境(Safari / WKWebView 14+,Chrome / Android WebView 80+)。键盘高度的计算方式如下:`window.innerHeight - visualViewport.height - visualViewport.offsetTop` —— 需要减去 `offsetTop` 是为了正确处理 iOS 上键盘出现时 visual viewport 可能垂直偏移的情况。


**注意事项**

- 所有 Android 浏览器的用户代理中都包含 'Android' 标记。

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: Use full-width quotes in prose: “Android” / “iPad” / “MacIntel” (also isIOS.md L5–6).

Suggested change
- 所有 Android 浏览器的用户代理中都包含 'Android' 标记。
- 所有 Android 浏览器的用户代理中都包含“Android”标记。

@@ -0,0 +1,36 @@
# isKeyboardVisible

`isKeyboardVisible` 是用于检查当前屏幕键盘是否显示的工具函数。该函数内部使用 `getKeyboardHeight()`,当键盘高度大于 0 时返回 `true`。

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: The existing hook pages use 此函数 rather than 该函数. Same in getKeyboardHeight.md (L3, L13), getSafeAreaInset.md (L5, L27) and isKeyboardVisible.md L13.

@hyesungoh

Copy link
Copy Markdown
Member

Thanks again for the work here and on #519!
As mentioned in #501, #525 addressed its review comments first, so I've merged it and am closing this one.

Reviews of the merged zh-Hans pages are always welcome. 🙏

@hyesungoh hyesungoh closed this Sep 28, 2026
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.

3 participants