@@ -35,6 +35,7 @@ import { revive } from 'vs/base/common/marshalling';
35
35
import { IExtensionsProfileScannerService , IScannedProfileExtension } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService' ;
36
36
import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile' ;
37
37
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity' ;
38
+ import { ILocalizedString } from 'vs/platform/action/common/action' ;
38
39
39
40
export type IScannedExtensionManifest = IRelaxedExtensionManifest & { __metadata ?: Metadata } ;
40
41
@@ -793,13 +794,23 @@ class ExtensionsScanner extends Disposable {
793
794
if ( translated === undefined && originalMessages ) {
794
795
translated = originalMessages [ messageKey ] ;
795
796
}
796
- let message : string | undefined = typeof translated === 'string' ? translated : ( typeof translated ? .message === 'string' ? translated . message : undefined ) ;
797
+ let message : string | undefined = typeof translated === 'string' ? translated : translated . message ;
797
798
if ( message !== undefined ) {
798
799
if ( pseudo ) {
799
800
// FF3B and FF3D is the Unicode zenkaku representation for [ and ]
800
801
message = '\uFF3B' + message . replace ( / [ a o u e i ] / g, '$&$&' ) + '\uFF3D' ;
801
802
}
802
- obj [ key ] = command && ( key === 'title' || key === 'category' ) && originalMessages ? { value : message , original : originalMessages [ messageKey ] } : message ;
803
+ // This branch returns ILocalizedString's instead of Strings so that the Command Palette can contain both the localized and the original value.
804
+ if ( command && originalMessages && ( key === 'title' || key === 'category' ) ) {
805
+ const originalMessage = originalMessages [ messageKey ] ;
806
+ const localizedString : ILocalizedString = {
807
+ value : message ,
808
+ original : typeof originalMessage === 'string' ? originalMessage : originalMessage ?. message
809
+ } ;
810
+ obj [ key ] = localizedString ;
811
+ } else {
812
+ obj [ key ] = message ;
813
+ }
803
814
} else {
804
815
this . logService . warn ( this . formatMessage ( extensionLocation , localize ( 'missingNLSKey' , "Couldn't find message for key {0}." , messageKey ) ) ) ;
805
816
}
0 commit comments