Skip to content

fix: restore localized installer conclusions - #1194

Open
mvanhorn wants to merge 2 commits into
rime:masterfrom
mvanhorn:fix/1152-squirrel-installer-conclusion-localization
Open

mvanhorn wants to merge 2 commits into
rime:masterfrom
mvanhorn:fix/1152-squirrel-installer-conclusion-localization

Conversation

@mvanhorn

Copy link
Copy Markdown

Background

On a Mac whose preferred language is Simplified Chinese, the installer success screen still shows the English summary. The localized install conclusion never appears.

productbuild prefers a bare conclusion.html over the same page inside locale folders. That English page was left in the package tree when localized conclusions were added, so the built installer kept using it.

Summary

Removes the unlocalized conclusion page so the installer packages only the per-locale copies. Adds a check that builds a product archive from those resources and confirms the expanded product has no bare conclusion page, with the English, Simplified Chinese, and Traditional Chinese pages matching the sources after productbuild renames zh_CN to zh-Hans and zh_TW to zh-Hant.

Testing

Tests for the squirrel change live in package/test_localized_resources.sh.

Fixes #1152

Removes the unlocalized conclusion page so the installer packages only
the per-locale copies. Adds a check that builds a product archive from
those resources and confirms the expanded product has no bare conclusion
page, with the English, Simplified Chinese, and Traditional Chinese
pages matching the sources after productbuild renames zh_CN to zh-Hans
and zh_TW to zh-Hant.

Fixes rime#1152
@LEOYoon-Tsaw

Copy link
Copy Markdown
Member

你光把這頁刪掉不解決問題吧?

@mvanhorn

Copy link
Copy Markdown
Author

本地化的頁面在 9b012e8 已經加好了(en.lproj、zh_CN.lproj、zh_TW.lproj),問題只出在根目錄這份沒本地化的 conclusion.html。productbuild 會把它放進 Resources/ 根目錄,安裝器就優先用它,所以 .lproj 裏的版本永遠不會被選到。#1152 的回報者也試過,刪掉它之後就顯示中文了。

刪掉之後英文使用者仍會拿到 en.lproj 裏同樣內容的英文頁,其他語言應回落到 en.lproj。

我剛在本機跑了 package/test_localized_resources.sh:這個分支上通過,三個 lproj 都被打包(zh_CN、zh_TW 被改名成 zh-Hans、zh-Hant)且內容一致;把根目錄的 conclusion.html 放回去再跑就會失敗。

如果您指的是別的問題,例如還有其他地方也需要改,請告訴我,我再補。

@LEOYoon-Tsaw

Copy link
Copy Markdown
Member

最後確認一件事情,如果用戶語言設置中沒有中文、英文(例如是日文、德文等),此頁面將會如何顯示?

@mvanhorn

Copy link
Copy Markdown
Author

會顯示英文頁(en.lproj/conclusion.html),這不是問題,不需要改。

package/Distribution 只寫了 <conclusion file="conclusion.html">,包裏只有 en、zh-Hans、zh-Hant 三個 lproj。安裝器照用戶的語言列表由上往下找第一個有對應 lproj 的語言,都沒有時用 en.lproj。

我用此分支的 Distribution 和這三個 lproj 打了一個測試包,在 macOS 27.2 上用 installer -pkginfo -AppleLanguages 試過,結果如下:

  • 只有日文、德文、法文或韓文:en
  • 日文 + 德文:en
  • 德文 + 繁體中文:zh-Hant
  • 日文 + 簡體中文 + 英文:zh-Hans
  • zh-Hant-HK:zh-Hant

所以列表裏只要有中文,即使排在日文或德文後面,也會顯示中文。

這個測試是在每個 lproj 放一份 Localizable.strings,從安裝包標題看選中了哪個 lproj。我沒有在 Installer.app 裏實際走到結束頁,所以結束頁本身沒有親眼確認。

@LEOYoon-Tsaw

Copy link
Copy Markdown
Member

這個PR調整的是 conclusion.html 的顯示,當然要測到這一頁。

@mvanhorn

Copy link
Copy Markdown
Author

您說得對,這次我在 Installer.app 裏實際走到了結束頁。

用此分支(d3c589a)的 Distribution 和三個 lproj 打測試包,在 macOS 27.2 上用 -AppleLanguages 啟動 Installer.app,點完安裝,讀結束頁顯示的文字:

  • 繁體中文:zh_TW 的內容
  • 只有日文:英文內容
  • 德文 + 簡體中文 + 英文:zh_CN 的內容(安裝器介面本身是德文)

對照組:同樣的包把根目錄的 conclusion.html 放回去,繁體中文下結束頁顯示英文,也就是 #1152 的現象。

這個測試包和正式包有差別:

  • 沒有 payload,也不是真的 Squirrel,只用了 productbuild 打包同樣的資源。
  • 為了不用管理員權限,改成裝到用戶目錄(加了 <domains>,去掉 rootVolumeOnly)。
  • 去掉了 onConclusion="RequireLogout",所以裝完要求登出的提示沒有測到。
  • 語言是用啟動參數設的,沒有改系統設定。

我沒有用 make_package 打出的正式包測過,也沒有在系統語言真的設成這些語言的機器上測過。

@LEOYoon-Tsaw

Copy link
Copy Markdown
Member

老拿個AI測來測去測不到重點,等我有空試一下再說了。

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.

[Bug] 安装摘要(conclusion)的本地化不生效

2 participants