Skip to content

Commit ec55a1e

Browse files
committed
feat: implement ProjectManager for workspace configuration and update localization labels
1 parent 38e74d6 commit ec55a1e

4 files changed

Lines changed: 9 additions & 10 deletions

File tree

package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
"project.action.convertNow": "Convert Now",
142142
"project.action.convertLater": "Convert Later",
143143
"project.action.enable": "Enable",
144-
"project.action.notEnable": "Don't Enable",
144+
"project.action.notEnable": "Don't Ask Again",
145145
"project.action.remindLater": "Remind Later",
146146
"project.info.enabledReady": "DocuGenius is enabled for this project. You can right-click files to convert them or turn on auto-convert in settings.",
147147
"project.info.conversionStarted": "Document conversion has started. Output will be saved to the \"DocuGenius\" folder.",

package.nls.zh-cn.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
"project.action.convertNow": "立即转换",
142142
"project.action.convertLater": "稍后转换",
143143
"project.action.enable": "启用",
144-
"project.action.notEnable": "不启用",
144+
"project.action.notEnable": "不再提醒",
145145
"project.action.remindLater": "稍后提醒",
146146
"project.info.enabledReady": "DocuGenius 已为当前项目启用。你可以右键文件进行转换,或在设置中开启自动转换。",
147147
"project.info.conversionStarted": "已开始转换文档,输出将保存到 \"DocuGenius\" 文件夹中。",

package.nls.zh.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
"project.action.convertNow": "立即转换",
142142
"project.action.convertLater": "稍后转换",
143143
"project.action.enable": "启用",
144-
"project.action.notEnable": "不启用",
144+
"project.action.notEnable": "不再提醒",
145145
"project.action.remindLater": "稍后提醒",
146146
"project.info.enabledReady": "DocuGenius 已为当前项目启用。你可以右键文件进行转换,或在设置中开启自动转换。",
147147
"project.info.conversionStarted": "已开始转换文档,输出将保存到 \"DocuGenius\" 文件夹中。",

src/projectManager.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export class ProjectManager {
281281
*/
282282
async showEnableDialog(): Promise<boolean> {
283283
const enableLabel = localize('project.action.enable');
284-
const disableLabel = localize('project.action.notEnable');
284+
const dontAskAgainLabel = localize('project.action.notEnable');
285285
const remindLaterLabel = localize('project.action.remindLater');
286286

287287
const choice = await vscode.window.showInformationMessage(
@@ -291,7 +291,7 @@ export class ProjectManager {
291291
detail: localize('project.prompt.enableDetail')
292292
},
293293
enableLabel,
294-
disableLabel,
294+
dontAskAgainLabel,
295295
remindLaterLabel
296296
);
297297

@@ -314,7 +314,7 @@ export class ProjectManager {
314314
}
315315
}
316316
return enabled;
317-
case disableLabel:
317+
case dontAskAgainLabel:
318318
await this.saveWorkspaceProjectConfig(
319319
vscode.workspace.workspaceFolders![0].uri.fsPath,
320320
{ ...ProjectManager.DEFAULT_CONFIG, enabled: false, lastActivated: new Date().toISOString() }
@@ -348,10 +348,9 @@ export class ProjectManager {
348348
}
349349

350350
const rootPath = workspaceFolders[0].uri.fsPath;
351-
const configPath = path.join(rootPath, ProjectManager.CONFIG_FILE_NAME);
352-
353-
// If project config file exists, don't show prompt
354-
if (fs.existsSync(configPath)) {
351+
// Respect any explicit project decision persisted either in .docugenius.json
352+
// or in VS Code workspace storage, including "don't ask again".
353+
if (this.hasPersistedProjectState(rootPath)) {
355354
return false;
356355
}
357356

0 commit comments

Comments
 (0)