Skip to content

Commit 2479c3d

Browse files
author
DESKTOP-HA04FD6\Admin
committed
docs: fix bilingual download guidance
1 parent d78aa86 commit 2479c3d

5 files changed

Lines changed: 45 additions & 18 deletions

File tree

docs/AI_INTEGRATION.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ For normal reads, use the `nextCursor` and `resumeReceipt` returned by the servi
143143
Use the following only when explicitly accepting that continuity cannot be verified:
144144

145145
```text
146-
--after-sequence <十进制序号> --allow-unverified-seek
146+
--after-sequence <decimal-sequence-number> --allow-unverified-seek
147147
```
148148

149149
This type of read may omit or duplicate events, or cross a range that cannot be proven. Its result must be marked as an unverified seek.

docs/INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
只从本项目 GitHub Releases 页面下载安装包。发布页同时提供 `SHA256SUMS.txt`,可选地用 PowerShell 核对:
2929

3030
```powershell
31-
Get-FileHash '.\Lemon串口监控-安装程序-x64.exe' -Algorithm SHA256
31+
Get-FileHash '.\LemonSerialMonitor-Setup-x64.exe' -Algorithm SHA256
3232
```
3333

3434
显示的 SHA-256 应与同一版本发布页一致。文件来源或哈希不一致时不要运行。
3535

3636
## 一键安装
3737

38-
1. 双击 `Lemon串口监控-安装程序-x64.exe`
38+
1. 双击 `LemonSerialMonitor-Setup-x64.exe`
3939
2. Windows 显示 SmartScreen 或“用户账户控制”时,只在下载来源和 SHA-256 与同版 Release 一致后继续。
4040
3. 完整阅读“本地测试证书使用说明”,勾选接受后继续。
4141
4. 选择桌面程序安装位置。默认是:

docs/TROUBLESHOOTING.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Export processes the full persisted session, not only the selected rows. To copy
122122
First run:
123123

124124
```powershell
125-
& '<安装目录>\ai\Lemon.SerialMonitor.AI.exe' status --json
125+
& '<installation-directory>\ai\Lemon.SerialMonitor.AI.exe' status --json
126126
```
127127

128128
Check:

scripts/Test-BilingualDocs.ps1

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,18 @@ foreach ($relativePath in $documents.Keys) {
116116
}
117117

118118
$installerAssetName = 'LemonSerialMonitor-Setup-x64.exe'
119-
if ($documents['README.md'].IndexOf(
120-
$installerAssetName,
121-
[StringComparison]::Ordinal) -lt 0) {
122-
throw "README.md must contain installer asset name $installerAssetName"
119+
$installerDownloadPaths = @(
120+
'README.md',
121+
'README.en.md',
122+
'docs/INSTALL.md',
123+
'docs/INSTALL.en.md'
124+
)
125+
foreach ($relativePath in $installerDownloadPaths) {
126+
if ($documents[$relativePath].IndexOf(
127+
$installerAssetName,
128+
[StringComparison]::Ordinal) -lt 0) {
129+
throw "$relativePath must contain installer asset name $installerAssetName"
130+
}
123131
}
124132

125133
$englishCorpus = @(

tests/powershell/BilingualDocs.Tests.ps1

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ $safetyTerms = @(
2727
'not hardware certification'
2828
)
2929

30+
$installerAssetName = 'LemonSerialMonitor-Setup-x64.exe'
31+
$installerDownloadPaths = @(
32+
'README.md',
33+
'README.en.md',
34+
'docs/INSTALL.md',
35+
'docs/INSTALL.en.md'
36+
)
37+
3038
function Write-TestUtf8File {
3139
param(
3240
[Parameter(Mandatory)][string] $Path,
@@ -51,14 +59,17 @@ function New-BilingualDocsFixture {
5159
'# Chinese fixture',
5260
"[English]($englishBaseName)"
5361
)
54-
if ($pair.Key -eq 'README.md') {
55-
$chineseLines += 'Download LemonSerialMonitor-Setup-x64.exe.'
62+
if ($script:installerDownloadPaths -contains $pair.Key) {
63+
$chineseLines += "Download $script:installerAssetName."
5664
}
5765

5866
$englishLines = @(
5967
'# English fixture',
6068
"[Chinese]($chineseBaseName)"
6169
)
70+
if ($script:installerDownloadPaths -contains $pair.Value) {
71+
$englishLines += "Download $script:installerAssetName."
72+
}
6273
if ($pair.Value -eq 'README.en.md') {
6374
$englishLines += $script:safetyTerms
6475
}
@@ -165,20 +176,28 @@ Describe 'Bilingual documentation guard' {
165176
$message | Should Match 'UTF-8'
166177
}
167178

168-
It 'rejects the wrong installer asset name in README.md' {
169-
$root = Join-Path $TestDrive 'wrong-installer'
179+
It 'rejects the wrong installer asset name in <RelativePath>' -TestCases @(
180+
@{ RelativePath = 'README.md' },
181+
@{ RelativePath = 'README.en.md' },
182+
@{ RelativePath = 'docs/INSTALL.md' },
183+
@{ RelativePath = 'docs/INSTALL.en.md' }
184+
) {
185+
param([string] $RelativePath)
186+
187+
$fixtureName = $RelativePath -replace '[^A-Za-z0-9]', '-'
188+
$root = Join-Path $TestDrive ('wrong-installer-' + $fixtureName)
170189
New-BilingualDocsFixture -Root $root
171-
$readmePath = Join-Path $root 'README.md'
172-
$readme = [IO.File]::ReadAllText($readmePath)
190+
$documentPath = Join-Path $root $RelativePath
191+
$document = [IO.File]::ReadAllText($documentPath)
173192
Write-TestUtf8File `
174-
-Path $readmePath `
175-
-Content $readme.Replace(
176-
'LemonSerialMonitor-Setup-x64.exe',
193+
-Path $documentPath `
194+
-Content $document.Replace(
195+
$installerAssetName,
177196
'LemonSerialMonitor-Setup.exe')
178197

179198
$message = Get-BilingualGuardError -Root $root
180199

181-
$message | Should Match 'README\.md'
200+
$message | Should Match ([regex]::Escape($RelativePath))
182201
$message | Should Match 'LemonSerialMonitor-Setup-x64\.exe'
183202
}
184203

0 commit comments

Comments
 (0)