- 后端
【免费下载链接】lang
List of 128 languages for Laravel Framework, Laravel Jetstream, Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova and Laravel UI.
本指南基於 Laravel Lang 開源倉庫的 docs/statuses/zh_HK.md 完成狀態報告,結合 locales/zh_HK/ 目錄下的實際翻譯文件與各source子包,系統梳理 zh_HK(香港繁體中文)語言包的翻譯缺口:全倉庫 128 種語言平均完成度為97.82%(147.1K / 150.4K),而 zh_HK 尚有38 個鍵未翻譯(json 32 個、php 3 個、php-inline 3 個)。讀者通過本文可準確掌握這 38 個缺失鍵的完整清單、來源模塊(Laravel Cashier / Nova / Passkeys / Framework 驗證器)、與已完成翻譯的質量對比,以及定位和補全翻譯的具體方法。
一、背景:Laravel Lang 與 zh_HK 語言包的定位
Laravel Lang 項目為 Laravel 生態提供多語言包,覆蓋 Laravel Framework、Jetstream、Fortify、Breeze、Cashier、Nova 與 UI 等多個官方組件,共收錄 128 種語言。每一種語言的翻譯文件按三種格式存放於 locales/ 目錄:
| 文件 | 用途 |
|---|---|
json.json | Laravel 前端/組件使用的 JSON 翻譯(按原文鍵查找),如 Nova 資源管理、Cashier 賬單、Passkeys 登入等界面文案 |
php.json | Laravel 驗證器(Validator)使用的 PHP 翻譯(按規則鍵查找),如required、email等驗證規則消息 |
json-inline.json | JSON 格式的「內聯」驗證消息(不含:attribute前綴,直接指向欄位本身) |
php-inline.json | PHP 格式的「內聯」驗證消息(不含:attribute前綴) |
_excludes.json | 有意不翻譯、保留原文的鍵清單(如API Token、ID、Nova等專有名詞) |
zh_HK 語言包即位於 locales/zh_HK/,其整體完成狀態由 docs/status.md 統一匯總,而每個語言的缺失細節記錄在 docs/statuses/zh_HK.md。
二、完成狀態總覽:38 個缺失鍵的分佈
根據 docs/statuses/zh_HK.md 的報告,zh_HK 語言包共缺失38 個鍵,分佈如下:
| 文件類型 | 缺失數量 |
|---|---|
json | 32 |
php-inline | 3 |
php | 3 |
| 合計 | 38 |
值得注意的是,json-inline.json沒有缺失記錄,說明其 15 個鍵(locales/zh_HK/json-inline.json)已全部翻譯完成。整體而言,zh_HK 的翻譯完成度處於全倉庫中上水平,與整體 97.82% 的完成度相當。
三、json 缺失鍵全清單(32 個)與來源模塊分析
狀態報告以表格形式逐條列出缺失鍵的 Key 與 Value(即當前仍顯示的英文原文)。以下按功能來源模塊歸類整理:
3.1 Laravel Cashier(賬單與發票)相關
| Key(缺失鍵) | 當前英文原文 |
|---|---|
| Invoice Email Addresses | Invoice Email Addresses |
| Invoice emails updated successfully. | Invoice emails updated successfully. |
| Please provide a maximum of three invoice emails addresses. | Please provide a maximum of three invoice emails addresses. |
| The invoice emails must be valid email addresses. | The invoice emails must be valid email addresses. |
| We will send an invoice download link to the email addresses that you specify below. You may separate multiple email addresses using commas. | We will send an invoice download link to the email addresses that you specify below. You may separate multiple email addresses using commas. |
| If you need to add specific contact or tax information to your invoices, like your full business name, VAT identification number, or address of record, you may add it here. | If you need to add specific contact or tax information to your invoices, like your full business name, VAT identification number, or address of record, you may add it here. |
| Please set a default payment method before retrying payments. | Please set a default payment method before retrying payments. |
| This payment was initiated, but the funds have not been received yet. This can take up to 14 days. | This payment was initiated, but the funds have not been received yet. This can take up to 14 days. |
這些鍵集中於 Cashier 的發票郵件管理(新增/更新收件電郵、發票下載鏈接、最多三個電郵地址的校驗)以及付款重試與資金到賬提示,均可在 source/cashier/ 的 JSON 源文件中找到對應原文。
3.2 Laravel Passkeys(無密碼登入)相關
| Key(缺失鍵) | 當前英文原文 |
|---|---|
| Passkey not recognized. It may have been removed from your account. | Passkey not recognized. It may have been removed from your account. |
| Passkey registration session expired. Please try again. | Passkey registration session expired. Please try again. |
| Passkey verification session expired. Please try again. | Passkey verification session expired. Please try again. |
| Unable to register passkey. Please try again. | Unable to register passkey. Please try again. |
| Unable to register this passkey. | Unable to register this passkey. |
| Unable to verify passkey. Please try again. | Unable to verify passkey. Please try again. |
| Unable to sign in with this account. | Unable to sign in with this account. |
| User Security | User Security |
這組鍵來自 source/passkeys/ 子包,對應 Passkeys 註冊、驗證、會話過期與登入失敗等安全場景,是 Laravel 新興無密碼認證能力的界面文案。
3.3 Laravel Nova(資源管理)相關
| Key(缺失鍵) | 當前英文原文 |
|---|---|
| Action Event | Action Event |
| Action Events | Action Events |
| Delete Notification | Delete Notification |
| Export As CSV | Export As CSV |
| Mark all notifications as read | Mark all notifications as read |
| OK | OK |
| The selected resources have been :action! | The selected resources have been :action! |
這些鍵來自 source/nova/,涉及 Nova 的 Action 事件、通知刪除/全部標記已讀、CSV 導出等管理後台操作。其中The selected resources have been :action!包含:action佔位符,翻譯時需要保留。
3.4 Laravel Framework(郵箱驗證 / 認證 / 環境加密)相關
| Key(缺失鍵) | 當前英文原文 |
|---|---|
| Email Verification | Email Verification |
| Verify your email address | Verify your email address |
| Reset your password | Reset your password |
| Secure Area | Secure Area |
| Username | Username |
| Invalid credential format. | Invalid credential format. |
| The existing encrypted environment file is not in readable format. Use --force to overwrite it. | The existing encrypted environment file is not in readable format. Use --force to overwrite it. |
| The existing encryption key is required to update the encrypted environment file. | The existing encryption key is required to update the encrypted environment file. |
| Unable to write the encrypted environment file. | Unable to write the encrypted environment file. |
最後三條與env:encrypt/env:decrypt加密環境文件命令相關,來源於 source/framework/ 子包。
四、php 與 php-inline 缺失鍵(各 3 個):Laravel 驗證器新增規則
php與php-inline兩類文件的缺失鍵完全相同,均為 Laravel 驗證器較新加入的三條規則:
| 規則鍵 | php(帶:attribute) | php-inline(不帶:attribute) |
|---|---|---|
array_keys | The :attribute field must only contain the following keys: :values. | This field must only contain the following keys: :values. |
base64 | The :attribute field must be a valid Base64 string. | This field must be a valid Base64 string. |
encoding | The :attribute field must be encoded in :encoding. | This field must be encoded in :encoding. |
從 locales/zh_HK/php.json 可見,其餘驗證規則(required、email、min、max、regex、uuid、password.*等)均已翻譯為繁體中文,唯獨array_keys、base64、encoding三條仍為英文原文——它們是 Laravel 框架較晚引入的驗證規則,zh_HK 語言包尚未跟進補齊。
五、有意保留原文的鍵:_excludes.json 的設計
需要區分「缺失」與「有意排除」。zh_HK 的 locales/zh_HK/_excludes.json 明確列出了 9 個不翻譯、保留英文的鍵:
[ "API Token", "API Tokens", "CSV (.csv)", "Email", "email", "Excel (.xlsx)", "ID", "Nova" ]這些屬於專有名詞、文件格式擴展名或產品名(如Nova),在繁體中文界面中保留英文原文是慣例做法,不會被計入缺失統計。這也提示貢獻者在補全翻譯時,應先檢查目標鍵是否在_excludes.json中,避免做無用功。
六、如何定位缺失鍵的準確來源
狀態報告只給出鍵名與英文原文,要確認其精確來源與上下文,可以按以下路徑在倉庫內定位:
- 在 source/ 各子包(
framework、cashier、nova、passkeys、jetstream、breeze、fortify、ui等)的 JSON 源文件中搜索對應英文原文; - 對比 locales/zh_HK/json.json:該文件中已翻譯的鍵(如
"A decryption key is required.": "需要解密密鑰。")與缺失鍵混排,缺失鍵的特徵是 Key 與 Value 相同(即仍是英文); - 驗證器類的缺失鍵(
array_keys、base64、encoding)則直接對照 source/framework/ 下的 PHP 驗證源文件,確認其為 Laravel Validator 的內建規則消息。
七、補全翻譯的質量基準:與既有翻譯風格保持一致
zh_HK 的既有翻譯質量可以作為補全缺失鍵的風格基準。從 locales/zh_HK/json.json 抽取的典型示例:
"A fresh verification link has been sent to your email address."→ 「一封新的驗證連結已經發送到您的電郵地址。」"Add a new team member to your team, allowing them to collaborate with you."→ 「新增一名團隊成員至您的團隊,讓他們與您合作。」"Are you sure you want to delete your account?"→ 「您確定要删除您的帐户嗎?」"Are you sure you want to log out?"→ 「您確定要登出嗎?」
從 locales/zh_HK/php.json 可見驗證消息的既有風格:
"accepted": "必須接受 :attribute。""between.string": ":attribute 必須介乎 :min 至 :max 個字符之間。""throttle": "您嘗試的登入次數過多,請在 :seconds 秒後再試。"
補全array_keys、base64、encoding時,應沿用上述「必須 / 有效的 / 編碼為」等既有用語與繁體字(電郵、賬戶、檔案、連結、登入)體系,並保留:attribute、:values、:encoding佔位符。
八、貢獻翻譯的實操建議
對於希望補全 zh_HK 缺失鍵的開發者,基於倉庫現有結構,操作步驟如下:
- 閱讀 docs/statuses/zh_HK.md 確認當前缺失清單(本報告由倉庫工具自動生成,隨翻譯進度實時更新);
- 在 locales/zh_HK/json.json 中,將對應缺失鍵的英文 Value 替換為繁體中文翻譯;
- 在 locales/zh_HK/php.json 與 locales/zh_HK/php-inline.json 中,分別補齊
array_keys、base64、encoding三條(php 版保留:attribute前綴,php-inline 版省略); - 翻譯完成後,重新生成的狀態報告會將對應鍵移出缺失清單,完成度隨之提升;
- 注意保持 JSON 格式合法、保留全部佔位符,並與
_excludes.json的排除策略保持一致。
九、結論
zh_HK(香港繁體中文)語言包在 Laravel Lang 倉庫中完成度良好,僅剩 38 個鍵待補齊,集中在 Cashier 賬單發票、Passkeys 無密碼登入、Nova 資源管理與 Framework 驗證器新規則四個方向。這些缺失鍵來源清晰、上下文明確,且既有翻譯提供了高質量的風格基準,補全難度可控。對於同時面向香港市場與台灣市場的 Laravel 應用,zh_HK 與 zh_TW 語言包可結合使用,並可參考 docs/status.md 全局完成狀態表,持續跟蹤各語言的翻譯進展。
- 后端
【免费下载链接】lang
List of 128 languages for Laravel Framework, Laravel Jetstream, Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova and Laravel UI.
相关推荐
Laravel Lang 繁體中文(zh_TW)語言包翻譯狀態解析:環境加密檔案的 3 個待翻譯 Key
Laravel Lang 繁體中文(zh_TW)語言包翻譯狀態解析:環境加密檔案的 3 個待翻譯 Key 本篇文章圍繞 docs/statuses/zh_TW.
后端Kilo 項目繁體中文(zh-tw)本地化術語規範:glossary 機制、翻譯對照表與工程實踐
Kilo 項目繁體中文(zh tw)本地化術語規範:glossary 機制、翻譯對照表與工程實踐 本指南圍繞 Kilo 開源倉庫中的 繁體中文術語表(.open
人工智能大模型AI Agent代码智能体工具调用交互助手CLIOpenCode 繁體中文術語表解析:zh-tw i18n 翻譯規範與自動同步機制
OpenCode 繁體中文術語表解析:zh tw i18n 翻譯規範與自動同步機制 本文以 OpenCode 仓库中的繁體中文(Traditional Chin
人工智能AI 应用AI Agent代码智能体CLI开发者工具
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考