## Problem and outcome / 问题与结果 Inviting another device, changing sources and adjusting playback should preserve the selected access and accepted settings. This update adds local QR invitations, optional translations and a video buffer setting, and repairs App discovery, source retirement, shared controls, remote-input geometry and audio reporting within the existing 2.x contracts. ## Release notes ### English This update makes invitations easier to share and playback easier to adjust, while improving App connection, source switching and everyday controls. It also adds optional interface translations and more useful audio diagnostics. - Show the current invitation as a locally generated QR code for another device to scan, preserving the selected access information. - Add optional Traditional Chinese, Japanese and Korean translations. Chinese and English remain direct choices; the third menu includes extra languages and visual mode. Missing translations use English. - Add an **Increase playback buffering** switch with an adjustable target. More buffering may reduce stalls from uneven packet arrival, at the cost of added viewing delay. Automatic remains the default. - Ignore remote-control clicks on blank space outside a zoomed or rotated video. - Check for a local Piik App once when a site opens. Automatic discovery respects local-network permission; explicit connection keeps approval under your control, and passive failures stay quiet. - Keep a pending Browser screen or camera selection when the previous Native source ends or the App disconnects. Release the old source while allowing the new selection to finish; cancellation and Stop still end the operation correctly. - Improve App-to-App connections when port mappings shift during setup. - Keep playback hints clear of sharing controls, selection indicators inside their tracks, disabled action icons visible, and numeric settings aligned with accepted values. - Use receiver audio reports for outgoing shared-sound loss statistics, and add opt-in Windows capture-progress diagnostics to help locate missing audio. Existing 2.x App/site compatibility, saved room data and invitation privacy are preserved. Update the App for Native changes. After updating a hosted Server, refresh open site pages; App-local pages use the Web UI included in the updated App package. ### 中文 本次更新让邀请分享和播放调整更方便,并改善 App 连接、切换来源及日常控件。同时增加可选界面译文和更有帮助的音频诊断。 - 将当前邀请在本地生成二维码,保留所选访问凭证,方便另一台设备扫码加入。 - 增加繁体中文、日语和韩语可选译文。中英文保留快捷入口,第三个菜单提供附加语言与纯视觉模式;缺少的译文回退英文。 - 增加 **增加播放缓冲** 开关,并可调整目标值。更多缓冲可减少数据到达不均造成的停顿,但会增加观看延迟;默认仍由系统自动决定。 - 缩放或旋转画面后,不再把画面外空白区域的点击误传给远端。 - 打开站点时检查一次本地 Piik App。自动发现遵循本地网络权限,主动连接时才由你批准访问;被动发现失败保持安静。 - 旧 Native 来源结束或 App 断开时,保留正在进行的浏览器屏幕或摄像头选择。释放旧来源后仍可完成新选择;取消或主动停止时正确收尾。 - 改善建立连接时端口映射变化情况下的 App 间连接。 - 避免播放提示遮挡分享控件,让选中指示保持在轨道内,保留禁用按钮图标,并让数值设置显示实际接受的值。 - 共享声音的发送端丢包统计改用接收方音频报告,并增加可选的 Windows 采集进度诊断,帮助定位无声发生在哪一段。 保留现有 2.x App/站点兼容性、已保存的房间数据和邀请隐私。Native 改动需要更新 App。托管 Server 更新后请刷新已打开的页面;App 本地页面使用新版 App 包内的网页。 ## Verification / 验证 - Complete frontend check: TypeScript, 110 test files / 2001 tests, Web build. Go core check: format, tests, vet and supported cross-target builds; macOS App builds require their native SDK. - QR invitations passed independent local decoding, credential/rotation checks and short-window layout. Language/visual menus and guidance passed native and forced-polyfill Browser checks. - Native preparation passed actual Pion socket adoption, VP8 SRTP and reverse SRTCP controls. Remote-input geometry and accepted numeric settings have focused regressions. - Optional buffer transitions passed real P2P and actual SFU subscriber receiver-API controls for automatic to 300 ms to automatic. The SFU control used a Browser mock upstream rather than the embedded backend; Native preview delegation has unit coverage only. - Windows diagnostics passed strict translation compilation, counter tests and stderr-to-diagnostic-ZIP verification. Physical capture, optical QR scanning and a public-network success-rate improvement are not claimed. ## Impact / 影响 Compatible 2.x update: Browser/server v24, Native control v10, capture v7 and SQLite schema 2 remain unchanged. Optional translations preserve English fallback and the independent visual preference. Playback buffer is a local viewing preference and leaves the default automatic. Existing room authority and invitation handling are preserved. The HTTP compression dependency receives a compatible patch update. Mirror preparation detects a rejected missing tag before original-artifact downloads; the platform restriction remains open, with original-package validation and continuation rules intact. This does not establish fixes for #499, #502, #529 or #534.
199 lines
11 KiB
Markdown
199 lines
11 KiB
Markdown
# Help translate Piik
|
|
|
|
The 2.x interface keeps Chinese, English and Visual only, and offers partial
|
|
Traditional Chinese, Japanese and Korean message catalogs. Missing messages,
|
|
text titles and playful copy use English. Visual-only presentation, saved
|
|
preferences and the Chinese/English/visual App console keep their existing roles.
|
|
New copy is required in Chinese and English; remove obsolete keys from every
|
|
catalog when removing a message.
|
|
|
|
[中文](./translating.zh-CN.md) · [Contributing](../../CONTRIBUTING.md)
|
|
|
|
Suggest wording, correct a translation or add a language through GitHub issues
|
|
and pull requests.
|
|
|
|
For a wording suggestion, [open an issue](https://github.com/TNTcraftHIM/Piik/issues/new/choose)
|
|
with the language, page/control, current text, proposed text and reason. Include
|
|
a screenshot or steps to reach it; remove private invitations, passwords and
|
|
personal content. You can send a suggestion without setting up development tools.
|
|
|
|
## Make your first correction
|
|
|
|
1. Try the affected screen and read the nearby controls. Check both existing
|
|
languages when helpful; the [terminology and voice guide](../standards/naming.md#voice-and-terminology)
|
|
owns names and writing style.
|
|
2. Fork Piik and work on a branch from current `main`, following
|
|
[Contributing](../../CONTRIBUTING.md#lean-workflow). Small text edits can also
|
|
be proposed through GitHub's file editor.
|
|
3. Find the text in the files below. In a locale file, change the string value
|
|
after the colon. Keep the key and its placeholders. Search the key in the
|
|
source to see where it appears; for example:
|
|
|
|
```sh
|
|
rg -n -F 'host.title' src/client
|
|
```
|
|
|
|
4. Preview the affected screen and run the [relevant checks](#preview-and-check).
|
|
For a typo in one language, edit that language. If the underlying meaning
|
|
changes, update Chinese and English; remove an outdated optional translation
|
|
when it would misrepresent the behavior.
|
|
5. Open a PR to `main` with the wording problem, languages/surfaces changed and
|
|
preview results. For PR format, follow [Contributing](../../CONTRIBUTING.md#pull-request-scope).
|
|
|
|
## Find the right text
|
|
|
|
| Surface | Editable source |
|
|
| --- | --- |
|
|
| App launcher and shared Browser/App UI, including tooltips and accessible labels | [Locale registry](../../src/client/locales/index.ts), [English](../../src/client/locales/en.ts), [Chinese](../../src/client/locales/zh.ts); extra languages live beside them |
|
|
| Welcome lines, waiting captions and changing browser-tab titles | The `enPlayful` / `zhPlayful` pools and title-frame catalogs in those same files; website welcome lines reuse these pools |
|
|
| Website | [Page markup](../../site/index.html) and [interactive labels](../../site/main.js); text is paired by `en` and `zh-CN` |
|
|
| Introduction film | [Film sources](../../site/film/README.md); captions, artwork and playback labels have their own bilingual text |
|
|
| App console window | `consoleCopy` in [console.go](../../internal/app/console.go); entries are ordered English, Chinese, visual; retain the third slot even when empty |
|
|
| README and entry guides | [README pair](../../README.md), [documentation home](./README.md), [getting started](./getting-started.md), [troubleshooting](./troubleshooting.md) and [self-hosting](../operations/self-hosting.md), each with a `.zh-CN.md` counterpart |
|
|
|
|
Edit the source, then rebuild the surface that serves it:
|
|
|
|
- **App/Server UI:** catalogs are bundled with the web assets. Publish the updated
|
|
App or Server; a remote site's UI comes from that Server.
|
|
- **Website/film:** use the [website workflow](../operations/website.md).
|
|
- **Guides:** the documentation website renders repository Markdown at its next
|
|
publication. Navigation and search labels live in `site/docs/`.
|
|
|
|
Update related guides when a control's name changes. Technical references keep
|
|
one shared version under [documentation ownership](../standards/documentation.md).
|
|
|
|
## Preserve meaning and syntax
|
|
|
|
Write naturally for the target audience. Use the shared glossary for role and
|
|
password names. Introductions may be light; actions, errors and deployment steps
|
|
must be clear. Preserve the conditions on performance, platform and connection
|
|
claims. A cultural reference should still make sense to someone unfamiliar with it.
|
|
Machine-assisted drafts need proofreading by someone who understands the language
|
|
and the screen; raise unclear source text in the PR instead of guessing.
|
|
|
|
For App startup failures, translate the launcher and console explanations
|
|
together. Keep their shared reason codes and raw technical details unchanged.
|
|
|
|
Locale files are TypeScript objects. These are existing examples:
|
|
|
|
```ts
|
|
// en.ts
|
|
"host.title": "{name}'s screen",
|
|
// zh.ts
|
|
"host.title": "{name} 的屏幕",
|
|
```
|
|
|
|
Keep the lookup key `host.title`. Move `{name}` to fit the sentence, preserving
|
|
its spelling, braces and occurrence count. The formatter replaces each variable
|
|
once and accepts plain strings. For plural forms, HTML or different sentence
|
|
composition, describe the needed change in the PR so the caller and formatter
|
|
can be updated together.
|
|
|
|
Keep quotes, escapes and commas valid. Preserve commands, config keys, URLs,
|
|
download filenames and format markers such as `%s` in Go console text. Translate
|
|
link labels and image descriptions; repair internal anchors when translating
|
|
Markdown headings. Keep legal license text and third-party notices intact.
|
|
|
|
## Add a language
|
|
|
|
Search existing issues and PRs for the language first. For a larger translation,
|
|
start an issue with its language tag, intended coverage and any terminology or
|
|
layout questions, so contributors can coordinate work and review.
|
|
|
|
1. Copy `src/client/locales/en.ts` to a file such as `fr.ts`. Translate the
|
|
messages and title labels, write natural [playful entries](#playful-copy), and
|
|
rename the three exports. Use `Partial<Record<CopyKey, string>>` for optional
|
|
message catalogs; retain `TitleFrameCatalog` and `PlayfulCatalog` from `zh.ts`.
|
|
You can reuse the English title/playful
|
|
catalogs until those optional surfaces are translated.
|
|
Chinese currently defines the key set; either existing language can provide
|
|
context. Include translated keys only; missing messages use the shared English fallback.
|
|
2. Import the exports in [locales/index.ts](../../src/client/locales/index.ts)
|
|
and add one registry entry. For example, **after translating** the catalogs:
|
|
|
|
```ts
|
|
fr: { name: "Français", short: "FR", tag: "fr", copy: fr,
|
|
titleFrames: frTitleFrames, playful: frPlayful },
|
|
```
|
|
|
|
Use an ASCII filename/key, the language's native name in `name`, a recognizable
|
|
one-to-three-character button label in `short`, and a matching language tag
|
|
in `tag`. Distinguish coexisting regional/script variants.
|
|
Extra languages share the third control's dropdown with visual mode, beside
|
|
the Chinese and English shortcuts. Check language
|
|
selection, saved preferences and App handoff against the
|
|
[system-language policy](../standards/presentation-lifecycle.md#visual-language).
|
|
3. Check complete screens and the launch flow. New UI languages use English in
|
|
the App console until its own translation is added. Console additions also
|
|
require updating the launcher and loopback accepted-language checks together;
|
|
use the [App module map](../standards/engineering.md#module-map).
|
|
4. State coverage in the PR. Website, film and documentation translations can be
|
|
contributed separately; update their language controls when adding a language.
|
|
For right-to-left scripts, implement and check text direction and layout.
|
|
|
|
Translate visual-mode labels and explanations in the normal catalog; keep that
|
|
presentation option available.
|
|
|
|
## Playful copy
|
|
|
|
Each language owns its welcome and waiting arrays, and each playful title has a
|
|
fixed `label` plus a `variations` array. Add or remove entries in that language
|
|
without matching another language's count, order or references. An empty array
|
|
omits the decoration; one entry stays static. Operational keys and title labels
|
|
remain complete in Chinese and English. Errors, pauses, endings, required actions
|
|
and slogans stay fixed.
|
|
|
|
Welcome entries carry `text` and two `symbols`, chosen from the existing
|
|
[icon vocabulary](../../src/client/ui/icons.tsx) to express that sentence in the
|
|
visual cipher. For example:
|
|
|
|
```ts
|
|
{ text: "Your seat is right here.", symbols: ["couch", "heart"] },
|
|
```
|
|
|
|
Waiting entries are plain strings such as `"Pull up a comfy chair."`. Keep them
|
|
brief and natural in context. Avoid temporary trends, literal borrowed dialogue
|
|
and statements that invent progress, success or remaining time.
|
|
|
|
Timing follows the [playful-copy lifecycle](../standards/visual-language.md#playful-copy-lifecycle).
|
|
Preview welcome text and its cipher at
|
|
`/__tooltip-preview`; use `/__status-preview` for waiting captions and titles.
|
|
Check both narrow windows and language changes. The website's build picks up
|
|
welcome edits automatically; its other copy remains separate.
|
|
|
|
## Preview and check
|
|
|
|
Use the Node/npm versions and local setup in [Run from source](../README.md#run-from-source).
|
|
For UI catalog edits, run from the repository root:
|
|
|
|
```sh
|
|
npm ci
|
|
npm run typecheck
|
|
npm test -- tests/copy.test.ts
|
|
```
|
|
|
|
These checks cover missing keys, empty text, placeholders, language selection
|
|
and handoff. Proofread the translation in the running UI too.
|
|
|
|
Run the local UI and server as described in the source guide. Choose the language
|
|
from the top-right controls, open the affected screen and inspect long names or counts
|
|
in context. Check narrow windows, keyboard focus, tooltips and accessible labels.
|
|
With extra languages registered, verify that the dropdown stays usable near
|
|
viewport edges and exposes its expanded/collapsed state to assistive technology.
|
|
For new languages, also check a reload, App launch, switching back to English,
|
|
and the optional visual mode. Keep meaningful phrases together instead of adding
|
|
spaces or hard line breaks to force one desktop layout.
|
|
|
|
Website and film changes use the [website preview](../operations/website.md#preview).
|
|
For Markdown changes, run `node scripts/check-docs.mjs` after staging new files,
|
|
then review GitHub's rendered Markdown and translated links. Additional checks
|
|
for code changes follow [Contributing](../../CONTRIBUTING.md#verification-entrypoints).
|
|
|
|
## Further reading
|
|
|
|
- [OBS translation guide](https://github.com/obsproject/obs-studio/wiki/How-To-Contribute-Translations-For-OBS): proofread in the running application and understand technical terms.
|
|
- [Godot translation guide](https://contributing.godotengine.org/en/latest/other/translations.html): locate source context and coordinate terminology.
|
|
- [Weblate translation guidance](https://docs.weblate.org/en/latest/user/translating.html#translating-special-text-safely): handle placeholders and markup carefully.
|
|
- [W3C language-tag guidance](https://www.w3.org/International/questions/qa-choosing-language-tags): use BCP 47 tags to identify languages and their variants.
|
|
- [Unicode CLDR language names](https://cldr.unicode.org/translation/displaynames/languagelocale-names): menu-name reference. Browser `Intl.DisplayNames` can help find native names; choose Piik's short button label in the registry.
|