Skip to content

Commit 8419bcf

Browse files
author
AENERV7
committed
feat: add macOS system menu localization strings
- Add Localizable.strings for zh-Hans, zh-Hant, en in src-tauri/lproj/ - Configure bundle.macOS.files in tauri.conf.json to auto-bundle lproj - Remove manual lproj directory creation from CI workflow - Bump version to 0.2.9
1 parent 44618ae commit 8419bcf

8 files changed

Lines changed: 179 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ jobs:
5151
- name: Prepare macOS artifact
5252
if: matrix.os == 'macos-latest'
5353
run: |
54-
APP="src-tauri/target/${{ matrix.target }}/release/bundle/macos/YAUZ.app"
55-
RESOURCES="$APP/Contents/Resources"
56-
mkdir -p "$RESOURCES/zh-Hans.lproj" "$RESOURCES/zh-Hant.lproj" "$RESOURCES/en.lproj"
5754
cd "src-tauri/target/${{ matrix.target }}/release/bundle/macos"
5855
zip -r "$GITHUB_WORKSPACE/YAUZ-macos-arm64.zip" YAUZ.app
5956

.kiro/steering/project.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,9 @@ inclusion: always
2828
- Every code change must be accompanied by a version bump before committing.
2929
- Version must be updated in all three files: `package.json`, `src-tauri/Cargo.toml`, `src-tauri/tauri.conf.json`.
3030
- Use semantic versioning (MAJOR.MINOR.PATCH).
31+
32+
## macOS Localization
33+
34+
- macOS system menus (File, Edit, Window, etc.) and WebView context menus require both `CFBundleLocalizations` in `Info.plist` AND actual `.lproj` directories with `Localizable.strings` files in `Contents/Resources/` of the `.app` bundle.
35+
- Localization string files are stored in `src-tauri/lproj/{zh-Hans,zh-Hant,en}.lproj/Localizable.strings` and bundled automatically via `tauri.conf.json` `bundle.macOS.files`.
36+
- `Info.plist` is configured via `src-tauri/Info.plist` and referenced in `tauri.conf.json` under `bundle.macOS.infoPlist`.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yauz",
3-
"version": "0.2.8",
3+
"version": "0.2.9",
44
"private": true,
55
"scripts": {
66
"tauri": "tauri",

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yauz"
3-
version = "0.2.8"
3+
version = "0.2.9"
44
edition = "2021"
55

66
[lib]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* macOS system menu localization - English (base) */
2+
/* This file ensures English is recognized as a supported localization */
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/* macOS system menu localization - Simplified Chinese */
2+
3+
/* Application menu */
4+
"Hide %@" = "隐藏 %@";
5+
"Hide Others" = "隐藏其他";
6+
"Show All" = "显示全部";
7+
"Quit %@" = "退出 %@";
8+
"About %@" = "关于 %@";
9+
"Preferences…" = "偏好设置…";
10+
"Settings…" = "设置…";
11+
"Services" = "服务";
12+
13+
/* File menu */
14+
"File" = "文件";
15+
"Close" = "关闭";
16+
"Close Window" = "关闭窗口";
17+
18+
/* Edit menu */
19+
"Edit" = "编辑";
20+
"Undo" = "撤销";
21+
"Redo" = "重做";
22+
"Cut" = "剪切";
23+
"Copy" = "拷贝";
24+
"Paste" = "粘贴";
25+
"Paste and Match Style" = "粘贴并匹配样式";
26+
"Delete" = "删除";
27+
"Select All" = "全选";
28+
"Find" = "查找";
29+
"Find…" = "查找…";
30+
"Find and Replace…" = "查找和替换…";
31+
"Find Next" = "查找下一个";
32+
"Find Previous" = "查找上一个";
33+
"Use Selection for Find" = "使用所选内容查找";
34+
"Spelling and Grammar" = "拼写和语法";
35+
"Show Spelling and Grammar" = "显示拼写和语法";
36+
"Check Document Now" = "立即检查文稿";
37+
"Check Spelling While Typing" = "键入时检查拼写";
38+
"Check Grammar With Spelling" = "随拼写检查语法";
39+
"Correct Spelling Automatically" = "自动纠正拼写";
40+
"Substitutions" = "替换";
41+
"Show Substitutions" = "显示替换";
42+
"Smart Copy/Paste" = "智能拷贝/粘贴";
43+
"Smart Quotes" = "智能引号";
44+
"Smart Dashes" = "智能破折号";
45+
"Smart Links" = "智能链接";
46+
"Text Replacement" = "文本替换";
47+
"Transformations" = "转换";
48+
"Make Upper Case" = "大写";
49+
"Make Lower Case" = "小写";
50+
"Capitalize" = "首字母大写";
51+
"Speech" = "语音";
52+
"Start Speaking" = "开始朗读";
53+
"Stop Speaking" = "停止朗读";
54+
55+
/* View menu */
56+
"View" = "显示";
57+
"Enter Full Screen" = "进入全屏幕";
58+
"Exit Full Screen" = "退出全屏幕";
59+
"Toggle Full Screen" = "切换全屏幕";
60+
"Show Toolbar" = "显示工具栏";
61+
"Hide Toolbar" = "隐藏工具栏";
62+
"Show Sidebar" = "显示边栏";
63+
"Hide Sidebar" = "隐藏边栏";
64+
"Actual Size" = "实际大小";
65+
"Zoom In" = "放大";
66+
"Zoom Out" = "缩小";
67+
68+
/* Window menu */
69+
"Window" = "窗口";
70+
"Minimize" = "最小化";
71+
"Zoom" = "缩放";
72+
"Bring All to Front" = "前置全部窗口";
73+
"Close All" = "关闭全部";
74+
"Arrange in Front" = "在前面排列";
75+
"Tile Window to Left of Screen" = "将窗口拼贴到屏幕左侧";
76+
"Tile Window to Right of Screen" = "将窗口拼贴到屏幕右侧";
77+
"Move Window to Left Side of Screen" = "将窗口移到屏幕左侧";
78+
"Move Window to Right Side of Screen" = "将窗口移到屏幕右侧";
79+
80+
/* Help menu */
81+
"Help" = "帮助";
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/* macOS system menu localization - Traditional Chinese */
2+
3+
/* Application menu */
4+
"Hide %@" = "隱藏 %@";
5+
"Hide Others" = "隱藏其他";
6+
"Show All" = "顯示全部";
7+
"Quit %@" = "結束 %@";
8+
"About %@" = "關於 %@";
9+
"Preferences…" = "偏好設定⋯";
10+
"Settings…" = "設定⋯";
11+
"Services" = "服務";
12+
13+
/* File menu */
14+
"File" = "檔案";
15+
"Close" = "關閉";
16+
"Close Window" = "關閉視窗";
17+
18+
/* Edit menu */
19+
"Edit" = "編輯";
20+
"Undo" = "還原";
21+
"Redo" = "重做";
22+
"Cut" = "剪下";
23+
"Copy" = "拷貝";
24+
"Paste" = "貼上";
25+
"Paste and Match Style" = "貼上並符合樣式";
26+
"Delete" = "刪除";
27+
"Select All" = "全選";
28+
"Find" = "尋找";
29+
"Find…" = "尋找⋯";
30+
"Find and Replace…" = "尋找和取代⋯";
31+
"Find Next" = "尋找下一個";
32+
"Find Previous" = "尋找上一個";
33+
"Use Selection for Find" = "使用所選範圍尋找";
34+
"Spelling and Grammar" = "拼字和文法";
35+
"Show Spelling and Grammar" = "顯示拼字和文法";
36+
"Check Document Now" = "立即檢查文件";
37+
"Check Spelling While Typing" = "輸入時檢查拼字";
38+
"Check Grammar With Spelling" = "隨拼字檢查文法";
39+
"Correct Spelling Automatically" = "自動修正拼字";
40+
"Substitutions" = "替代";
41+
"Show Substitutions" = "顯示替代";
42+
"Smart Copy/Paste" = "智慧型拷貝/貼上";
43+
"Smart Quotes" = "智慧型引號";
44+
"Smart Dashes" = "智慧型破折號";
45+
"Smart Links" = "智慧型連結";
46+
"Text Replacement" = "文字替換";
47+
"Transformations" = "轉換";
48+
"Make Upper Case" = "大寫";
49+
"Make Lower Case" = "小寫";
50+
"Capitalize" = "首字大寫";
51+
"Speech" = "語音";
52+
"Start Speaking" = "開始朗讀";
53+
"Stop Speaking" = "停止朗讀";
54+
55+
/* View menu */
56+
"View" = "顯示方式";
57+
"Enter Full Screen" = "進入全螢幕";
58+
"Exit Full Screen" = "結束全螢幕";
59+
"Toggle Full Screen" = "切換全螢幕";
60+
"Show Toolbar" = "顯示工具列";
61+
"Hide Toolbar" = "隱藏工具列";
62+
"Show Sidebar" = "顯示側邊欄";
63+
"Hide Sidebar" = "隱藏側邊欄";
64+
"Actual Size" = "實際大小";
65+
"Zoom In" = "放大";
66+
"Zoom Out" = "縮小";
67+
68+
/* Window menu */
69+
"Window" = "視窗";
70+
"Minimize" = "縮到最小";
71+
"Zoom" = "縮放";
72+
"Bring All to Front" = "將所有視窗移至最前";
73+
"Close All" = "全部關閉";
74+
"Arrange in Front" = "在前面排列";
75+
"Tile Window to Left of Screen" = "將視窗拼貼到螢幕左側";
76+
"Tile Window to Right of Screen" = "將視窗拼貼到螢幕右側";
77+
"Move Window to Left Side of Screen" = "將視窗移到螢幕左側";
78+
"Move Window to Right Side of Screen" = "將視窗移到螢幕右側";
79+
80+
/* Help menu */
81+
"Help" = "輔助說明";

src-tauri/tauri.conf.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"productName": "YAUZ",
3-
"version": "0.2.8",
3+
"version": "0.2.9",
44
"identifier": "com.yauz.dev",
55
"build": {
66
"frontendDist": "../dist"
@@ -23,7 +23,12 @@
2323
"active": false,
2424
"icon": ["icons/icon.png", "icons/icon.ico", "icons/icon.icns"],
2525
"macOS": {
26-
"infoPlist": "Info.plist"
26+
"infoPlist": "Info.plist",
27+
"files": {
28+
"Resources/zh-Hans.lproj/Localizable.strings": "lproj/zh-Hans.lproj/Localizable.strings",
29+
"Resources/zh-Hant.lproj/Localizable.strings": "lproj/zh-Hant.lproj/Localizable.strings",
30+
"Resources/en.lproj/Localizable.strings": "lproj/en.lproj/Localizable.strings"
31+
}
2732
}
2833
}
2934
}

0 commit comments

Comments
 (0)