Skip to content

Commit 65fb8a8

Browse files
authored
Merge branch 'master' into jeremypw/save_all_window_docs
2 parents 3d806bb + d065ae9 commit 65fb8a8

File tree

8 files changed

+88
-74
lines changed

8 files changed

+88
-74
lines changed

po/extra/zh_TW.po

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: scratch\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-11-18 12:15+0000\n"
11-
"PO-Revision-Date: 2025-11-30 07:55+0000\n"
11+
"PO-Revision-Date: 2026-01-06 13:55+0000\n"
1212
"Last-Translator: Kisaragi Hiu <mail@kisaragi-hiu.com>\n"
1313
"Language-Team: Chinese (Traditional Han script) <https://"
1414
"l10n.elementaryos.org/projects/code/extra/zh_TW/>\n"
@@ -144,7 +144,7 @@ msgstr "在 C 語言符號的工具提示裡提供更多資訊"
144144

145145
#: data/code.metainfo.xml.in:76
146146
msgid "Cloning success is now indicated by toast instead of a dialog"
147-
msgstr ""
147+
msgstr "用 toast 而非對話框來顯示拓製成功"
148148

149149
#: data/code.metainfo.xml.in:77
150150
msgid "Global search and local search now have the same case sensitivity"
@@ -187,26 +187,26 @@ msgstr "改善:"
187187
msgid ""
188188
"The Project Chooser context menu now includes an option to clone a remote "
189189
"git repository"
190-
msgstr ""
190+
msgstr "新增拓製遠端 Git 版本庫的選項到專案挑選器內文選單"
191191

192192
#: data/code.metainfo.xml.in:111
193193
msgid ""
194194
"The \"Open Folder\" action now appears in the Project Chooser context menu"
195-
msgstr ""
195+
msgstr "將「開啟資料夾」動作移動到專案挑選器內文選單"
196196

197197
#: data/code.metainfo.xml.in:112
198198
msgid "The Vala symbol pane now shows a spinner while loading"
199-
msgstr ""
199+
msgstr "Vala 符號面板在載入中的時候現在會顯示旋轉圖示"
200200

201201
#: data/code.metainfo.xml.in:113
202202
msgid "The filter in the C symbol pane now works"
203-
msgstr ""
203+
msgstr "修正 C 符號面板的過濾器無法正常運作的問題"
204204

205205
#: data/code.metainfo.xml.in:131
206206
msgid ""
207207
"A new gutter is added for adding/removing edit marks that can be navigated "
208208
"between with keyboard shortcuts"
209-
msgstr ""
209+
msgstr "新增用來加入/移除編輯標記的標示區域,這些標記可以用鍵盤快捷鍵瀏覽"
210210

211211
#: data/code.metainfo.xml.in:132
212212
msgid "Remote branches may now be opened from the \"Branch\" menu"
@@ -231,72 +231,73 @@ msgstr "在「分支」子選單以分支名稱順序排序分支"
231231
msgid ""
232232
"The extension list now has switches instead of checkboxes in order to "
233233
"provide a larger target"
234-
msgstr ""
234+
msgstr "讓擴充元件列表使用切換開關而非勾選方塊,這樣點擊目標比較大"
235235

236236
#: data/code.metainfo.xml.in:137
237237
msgid ""
238238
"The terminal pane now implements smart copy-paste and follows the \"natural-"
239239
"copy-paste\" setting of Terminal"
240-
msgstr ""
240+
msgstr "新增智慧複製貼上的功能到終端機面板,並讓它跟隨《終端機》應用程式的「自然複製"
241+
"貼上」設定值"
241242

242243
#: data/code.metainfo.xml.in:138
243244
msgid "The Vala symbol pane now gives more information in the tooltips"
244-
msgstr ""
245+
msgstr "讓 Vala 符號面板在工具提示裡提供更多資訊"
245246

246247
#: data/code.metainfo.xml.in:142
247248
msgid "Launcher actions now have icons"
248-
msgstr ""
249+
msgstr "為啟動器動作加上圖示"
249250

250251
#: data/code.metainfo.xml.in:143
251252
msgid ""
252253
"Opening and immediately closing a new document no longer prevents further "
253254
"documents being opened"
254-
msgstr ""
255+
msgstr "修正開啟新文件後馬上關閉它會使應用程式無法開啟更多文件的問題"
255256

256257
#: data/code.metainfo.xml.in:144
257258
msgid ""
258259
"The Vala symbol pane may only block the UI for a limited time if there are a "
259260
"large number of symbols"
260-
msgstr ""
261+
msgstr "修正 Vala 符號面板在有非常多符號時會擋住介面更新太久的問題"
261262

262263
#: data/code.metainfo.xml.in:145
263264
msgid "The \"Open in …\" menu is no longer empty when running as Flatpak"
264-
msgstr ""
265+
msgstr "修正 Flatpak 版的「開啟於…」選單是空的的問題"
265266

266267
#: data/code.metainfo.xml.in:146
267268
msgid "The search term now persists until editing or closing the search bar."
268-
msgstr ""
269+
msgstr "讓搜尋字詞只有在編輯搜尋列或關閉搜尋列的時候才會改變或清空。"
269270

270271
#: data/code.metainfo.xml.in:147
271272
msgid ""
272273
"No longer allow the parent or child of an open project to be itself opened "
273274
"as a project"
274-
msgstr ""
275+
msgstr "不再允許將已開啟專案的上層目錄或子目錄本身同時作為專案開啟"
275276

276277
#: data/code.metainfo.xml.in:148
277278
msgid "The active project dropdown now keeps in sync"
278-
msgstr ""
279+
msgstr "維持作用中專案下拉式選單內容同步"
279280

280281
#: data/code.metainfo.xml.in:149
281282
msgid "Numbered lists are now handled correctly by Markdown plugin"
282-
msgstr ""
283+
msgstr "讓 Markdown 外掛程式正確處理編號清單"
283284

284285
#: data/code.metainfo.xml.in:150
285286
msgid "The highlighting plugin now works with selections of more than one word"
286-
msgstr ""
287+
msgstr "讓標明外掛程式在選取不只一個單詞時也能正常運作"
287288

288289
#: data/code.metainfo.xml.in:151
289290
msgid ""
290291
"The \"Open in …\" menu is now sorted and includes a \"Terminal Pane\" entry"
291-
msgstr ""
292+
msgstr "排序「開啟於…」選單並在其中包含「終端機面板」項目"
292293

293294
#: data/code.metainfo.xml.in:152
294295
msgid "Folders containing may items now expand faster without blocking the UI"
295-
msgstr ""
296+
msgstr "展開內含非常多項目的資料夾時介面不會再被阻擋更新而卡住"
296297

297298
#: data/code.metainfo.xml.in:153
298299
msgid "Symbol Pane now always scrolls document to selected symbol"
299-
msgstr ""
300+
msgstr "讓符號面板總是把文件捲動到所選符號"
300301

301302
#: data/code.metainfo.xml.in:184
302303
msgid "Add symbol filter to Outline pane"
@@ -447,7 +448,7 @@ msgstr "將顯示/隱藏面板的各按鈕全部整理成應用程式選單裡
447448
msgid ""
448449
"The sidebar now contains the project chooser button and fills the height of "
449450
"the window"
450-
msgstr "將專案選擇按鈕加入側邊欄中,並讓側邊欄填滿視窗高度"
451+
msgstr "將專案挑選按鈕加入側邊欄中,並讓側邊欄填滿視窗高度"
451452

452453
#: data/code.metainfo.xml.in:325
453454
msgid "Starting a global search with text selected now pre-fills that text"

po/zh_TW.po

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgstr ""
77
"Project-Id-Version: scratch\n"
88
"Report-Msgid-Bugs-To: \n"
99
"POT-Creation-Date: 2025-11-18 12:15+0000\n"
10-
"PO-Revision-Date: 2025-11-30 07:55+0000\n"
10+
"PO-Revision-Date: 2026-01-06 13:55+0000\n"
1111
"Last-Translator: Kisaragi Hiu <mail@kisaragi-hiu.com>\n"
1212
"Language-Team: Chinese (Traditional Han script) <https://"
1313
"l10n.elementaryos.org/projects/code/code/zh_TW/>\n"
@@ -126,17 +126,17 @@ msgstr "取消(_C)"
126126

127127
#: src/MainWindow.vala:1088
128128
msgid "Cloning completed"
129-
msgstr ""
129+
msgstr "已完成拓製"
130130

131131
#: src/MainWindow.vala:1089
132132
#, c-format
133133
msgid "Clone successfully created in %s"
134-
msgstr ""
134+
msgstr "已成功拓製到 %s"
135135

136136
#: src/MainWindow.vala:1095
137137
#, c-format
138138
msgid "Unable to clone %s"
139-
msgstr "無法複製 %s"
139+
msgstr "無法拓製 %s"
140140

141141
#: src/MainWindow.vala:1102
142142
msgid "Retry"
@@ -151,7 +151,7 @@ msgstr "用預設應用程式來開啟 '%s'"
151151
#. /TRANSLATORS "Git" is a proper name and must not be translated
152152
#: src/Dialogs/CloneRepositoryDialog.vala:55
153153
msgid "Create a local clone of a Git repository"
154-
msgstr "建立 Git 版本庫的本地複本"
154+
msgstr " Git 版本庫拓製到本地端"
155155

156156
#: src/Dialogs/CloneRepositoryDialog.vala:56
157157
msgid ""
@@ -161,15 +161,15 @@ msgstr "來源版本庫與本地資料夾都必須存在,也必須持有需要
161161

162162
#: src/Dialogs/CloneRepositoryDialog.vala:59
163163
msgid "Clone Repository"
164-
msgstr "複製版本庫"
164+
msgstr "拓製版本庫"
165165

166166
#: src/Dialogs/CloneRepositoryDialog.vala:69
167167
msgid "https://example.com/username/projectname.git"
168168
msgstr "https://example.com/username/projectname.git"
169169

170170
#: src/Dialogs/CloneRepositoryDialog.vala:93
171171
msgid "Select folder where the cloned repository will be created"
172-
msgstr "選取版本庫複本的上層資料夾"
172+
msgstr "選取版本庫拓製後複本的上層資料夾"
173173

174174
#: src/Dialogs/CloneRepositoryDialog.vala:96
175175
msgid "Select"
@@ -185,7 +185,7 @@ msgstr "位置"
185185

186186
#: src/Dialogs/CloneRepositoryDialog.vala:120
187187
msgid "Name of Clone"
188-
msgstr "複本名稱"
188+
msgstr "拓製後資料夾名稱"
189189

190190
#: src/Dialogs/CloneRepositoryDialog.vala:122
191191
msgid "Cloning in progress"
@@ -811,7 +811,7 @@ msgstr "開啟資料夾…"
811811

812812
#: src/Widgets/ChooseProjectButton.vala:89
813813
msgid "Clone Git Repository…"
814-
msgstr "複製 Git 版本庫…"
814+
msgstr "拓製 Git 版本庫…"
815815

816816
#: src/Widgets/DocumentView.vala:109
817817
msgid "Closed Tabs"
@@ -948,7 +948,7 @@ msgstr "對比"
948948

949949
#: src/Widgets/Sidebar.vala:52
950950
msgid "Cloning complete"
951-
msgstr ""
951+
msgstr "拓製完成"
952952

953953
#: src/Widgets/Sidebar.vala:80
954954
msgid "Collapse All"

src/FolderManager/FileView.vala

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
3636
public const string ACTION_CHECKOUT_REMOTE_BRANCH = "checkout-remote-branch";
3737
public const string ACTION_CLOSE_FOLDER = "close-folder";
3838
public const string ACTION_CLOSE_OTHER_FOLDERS = "close-other-folders";
39-
public const string ACTION_SET_ACTIVE_PROJECT = "set-active-project";
4039

4140
private const ActionEntry[] ACTION_ENTRIES = {
4241
{ ACTION_LAUNCH_APP_WITH_FILE_PATH, action_launch_app_with_file_path, "as" },
@@ -48,8 +47,7 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
4847
{ ACTION_NEW_FILE, add_new_file, "s" },
4948
{ ACTION_NEW_FOLDER, add_new_folder, "s"},
5049
{ ACTION_CLOSE_FOLDER, action_close_folder, "s"},
51-
{ ACTION_CLOSE_OTHER_FOLDERS, action_close_other_folders, "s"},
52-
{ ACTION_SET_ACTIVE_PROJECT, action_set_active_project, "s"}
50+
{ ACTION_CLOSE_OTHER_FOLDERS, action_close_other_folders, "s"}
5351
};
5452

5553
private GLib.Settings settings;
@@ -115,32 +113,23 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
115113
foreach (var child in root.children) {
116114
var project_folder_item = (ProjectFolderItem) child;
117115
if (project_folder_item != folder_root) {
118-
toplevel_action_group.activate_action (MainWindow.ACTION_CLOSE_PROJECT_DOCS, new Variant.string (project_folder_item.path));
116+
toplevel_action_group.activate_action (
117+
MainWindow.ACTION_CLOSE_PROJECT_DOCS,
118+
new Variant.string (project_folder_item.path)
119+
);
119120
root.remove (project_folder_item);
120121
git_manager.remove_project (project_folder_item);
121122
}
122123
}
123-
124124
//Make remaining project the active one
125-
git_manager.active_project_path = path;
126-
127-
write_settings ();
125+
set_project_active (path);
128126
}
129127

130-
private void action_set_active_project (SimpleAction action, GLib.Variant? parameter) {
131-
var path = parameter.get_string ();
132-
if (path == null || path == "") {
133-
return;
134-
}
135-
136-
var folder_root = find_path (root, path) as ProjectFolderItem;
137-
if (folder_root == null) {
138-
return;
139-
}
140-
141-
git_manager.active_project_path = path;
142-
143-
write_settings ();
128+
private void set_project_active (string path) {
129+
toplevel_action_group.activate_action (
130+
MainWindow.ACTION_SET_ACTIVE_PROJECT,
131+
new Variant.string (path)
132+
);
144133
}
145134

146135
public async void restore_saved_state () {
@@ -251,11 +240,15 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
251240
return null;
252241
}
253242

243+
public bool project_is_open (string project_path) {
244+
return get_project_for_file (GLib.File.new_for_path (project_path)) != null;
245+
}
246+
254247
public ProjectFolderItem? get_project_for_file (GLib.File file) {
255248
foreach (var item in root.children) {
256249
if (item is ProjectFolderItem) {
257250
var folder = (ProjectFolderItem)item;
258-
if (folder.contains_file (file)) {
251+
if (folder.file.file.equal (file) || folder.contains_file (file)) {
259252
return folder;
260253
}
261254
}

src/FolderManager/FolderItem.vala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ namespace Scratch.FolderManager {
6262
}
6363
}
6464

65-
6665
public void load_children () {
6766
if (loading_required) {
6867
foreach (var child in file.children) {

src/FolderManager/ProjectFolderItem.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ namespace Scratch.FolderManager {
146146
set_active_folder_item = new GLib.MenuItem (
147147
_("Set as Active Project"),
148148
GLib.Action.print_detailed_name (
149-
FileView.ACTION_PREFIX + FileView.ACTION_SET_ACTIVE_PROJECT,
149+
MainWindow.ACTION_PREFIX + MainWindow.ACTION_SET_ACTIVE_PROJECT,
150150
new Variant.string (file.path)
151151
)
152152
);

0 commit comments

Comments
 (0)