Skip to content

Commit f4ab348

Browse files
have edit sessions use ILocalizedString (microsoft#153933)
1 parent 623cde6 commit f4ab348

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

src/vs/workbench/contrib/sessionSync/browser/sessionSync.contribution.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle
1010
import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions';
1111
import { ServicesAccessor } from 'vs/editor/browser/editorExtensions';
1212
import { localize } from 'vs/nls';
13-
import { ISessionSyncWorkbenchService, Change, ChangeType, Folder, EditSession, FileType, EDIT_SESSION_SYNC_TITLE, EditSessionSchemaVersion } from 'vs/workbench/services/sessionSync/common/sessionSync';
13+
import { ISessionSyncWorkbenchService, Change, ChangeType, Folder, EditSession, FileType, EDIT_SESSION_SYNC_CATEGORY, EditSessionSchemaVersion } from 'vs/workbench/services/sessionSync/common/sessionSync';
1414
import { ISCMRepository, ISCMService } from 'vs/workbench/contrib/scm/common/scm';
1515
import { IFileService } from 'vs/platform/files/common/files';
1616
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
@@ -44,19 +44,21 @@ registerSingleton(ISessionSyncWorkbenchService, SessionSyncWorkbenchService);
4444

4545
const resumeLatestCommand = {
4646
id: 'workbench.experimental.editSessions.actions.resumeLatest',
47-
title: { value: localize('resume latest', "{0}: Resume Latest Edit Session", EDIT_SESSION_SYNC_TITLE), original: 'Edit Sessions' },
47+
title: { value: localize('resume latest', "Resume Latest Edit Session"), original: 'Resume Latest Edit Session' },
48+
category: EDIT_SESSION_SYNC_CATEGORY,
4849
};
4950
const storeCurrentCommand = {
5051
id: 'workbench.experimental.editSessions.actions.storeCurrent',
51-
title: { value: localize('store current', "{0}: Store Current Edit Session", EDIT_SESSION_SYNC_TITLE), original: 'Edit Sessions' },
52+
title: { value: localize('store current', "Store Current Edit Session"), original: 'Store Current Edit Session' },
53+
category: EDIT_SESSION_SYNC_CATEGORY,
5254
};
5355
const continueEditSessionCommand = {
5456
id: '_workbench.experimental.editSessions.actions.continueEditSession',
5557
title: { value: localize('continue edit session', "Continue Edit Session..."), original: 'Continue Edit Session...' },
5658
};
5759
const openLocalFolderCommand = {
5860
id: '_workbench.experimental.editSessions.actions.continueEditSession.openLocalFolder',
59-
title: localize('continue edit session in local folder', "Open In Local Folder"),
61+
title: { value: localize('continue edit session in local folder', "Open In Local Folder"), original: 'Open In Local Folder' },
6062
};
6163
const queryParamName = 'editSessionId';
6264

@@ -146,8 +148,7 @@ export class SessionSyncContribution extends Disposable implements IWorkbenchCon
146148
this._register(registerAction2(class ContinueEditSessionAction extends Action2 {
147149
constructor() {
148150
super({
149-
id: continueEditSessionCommand.id,
150-
title: continueEditSessionCommand.title,
151+
...continueEditSessionCommand,
151152
f1: true
152153
});
153154
}
@@ -181,8 +182,7 @@ export class SessionSyncContribution extends Disposable implements IWorkbenchCon
181182
this._register(registerAction2(class ApplyLatestEditSessionAction extends Action2 {
182183
constructor() {
183184
super({
184-
id: resumeLatestCommand.id,
185-
title: resumeLatestCommand.title,
185+
...resumeLatestCommand,
186186
menu: {
187187
id: MenuId.CommandPalette,
188188
}
@@ -203,8 +203,7 @@ export class SessionSyncContribution extends Disposable implements IWorkbenchCon
203203
this._register(registerAction2(class StoreLatestEditSessionAction extends Action2 {
204204
constructor() {
205205
super({
206-
id: storeCurrentCommand.id,
207-
title: storeCurrentCommand.title,
206+
...storeCurrentCommand,
208207
menu: {
209208
id: MenuId.CommandPalette,
210209
}
@@ -275,7 +274,7 @@ export class SessionSyncContribution extends Disposable implements IWorkbenchCon
275274
const result = await this.dialogService.confirm({
276275
message: localize('apply edit session warning', 'Applying your edit session may overwrite your existing uncommitted changes. Do you want to proceed?'),
277276
type: 'warning',
278-
title: EDIT_SESSION_SYNC_TITLE
277+
title: EDIT_SESSION_SYNC_CATEGORY.value
279278
});
280279
if (!result.confirmed) {
281280
return;
@@ -399,8 +398,7 @@ export class SessionSyncContribution extends Disposable implements IWorkbenchCon
399398
this._register(registerAction2(class ContinueInLocalFolderAction extends Action2 {
400399
constructor() {
401400
super({
402-
id: openLocalFolderCommand.id,
403-
title: openLocalFolderCommand.title,
401+
...openLocalFolderCommand,
404402
precondition: IsWebContext
405403
});
406404
}

src/vs/workbench/services/sessionSync/browser/sessionSyncWorkbenchService.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { IAuthenticationProvider } from 'vs/platform/userDataSync/common/userDat
1919
import { UserDataSyncStoreClient } from 'vs/platform/userDataSync/common/userDataSyncStoreService';
2020
import { AuthenticationSession, AuthenticationSessionsChangeEvent, IAuthenticationService } from 'vs/workbench/services/authentication/common/authentication';
2121
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
22-
import { EDIT_SESSIONS_SIGNED_IN, EditSession, EDIT_SESSION_SYNC_TITLE, ISessionSyncWorkbenchService, EDIT_SESSIONS_SIGNED_IN_KEY } from 'vs/workbench/services/sessionSync/common/sessionSync';
22+
import { EDIT_SESSIONS_SIGNED_IN, EditSession, EDIT_SESSION_SYNC_CATEGORY, ISessionSyncWorkbenchService, EDIT_SESSIONS_SIGNED_IN_KEY } from 'vs/workbench/services/sessionSync/common/sessionSync';
2323

2424
type ExistingSession = IQuickPickItem & { session: AuthenticationSession & { providerId: string } };
2525
type AuthenticationProviderOption = IQuickPickItem & { provider: IAuthenticationProvider };
@@ -337,7 +337,8 @@ export class SessionSyncWorkbenchService extends Disposable implements ISessionS
337337
constructor() {
338338
super({
339339
id: 'workbench.sessionSync.actions.resetAuth',
340-
title: localize('reset auth', '{0}: Sign Out', EDIT_SESSION_SYNC_TITLE),
340+
title: localize('reset auth', 'Sign Out'),
341+
category: EDIT_SESSION_SYNC_CATEGORY,
341342
precondition: ContextKeyExpr.equals(EDIT_SESSIONS_SIGNED_IN_KEY, true),
342343
menu: [{
343344
id: MenuId.CommandPalette,

src/vs/workbench/services/sessionSync/common/sessionSync.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { localize } from 'vs/nls';
7+
import { ILocalizedString } from 'vs/platform/action/common/action';
78
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
89
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
910

10-
export const EDIT_SESSION_SYNC_TITLE = localize('session sync', 'Edit Sessions');
11+
export const EDIT_SESSION_SYNC_CATEGORY: ILocalizedString = {
12+
original: 'Edit Sessions',
13+
value: localize('session sync', 'Edit Sessions')
14+
};
1115

1216
export const ISessionSyncWorkbenchService = createDecorator<ISessionSyncWorkbenchService>('ISessionSyncWorkbenchService');
1317
export interface ISessionSyncWorkbenchService {

0 commit comments

Comments
 (0)