diff --git a/src/vs/workbench/parts/markers/browser/MarkersPanel.ts b/src/vs/workbench/parts/markers/browser/MarkersPanel.ts index 69321616220648e929d43a82a7c6516f708bfb81..a3829411fdd19cc3483d4b7b4c1f6069c35b803d 100644 --- a/src/vs/workbench/parts/markers/browser/MarkersPanel.ts +++ b/src/vs/workbench/parts/markers/browser/MarkersPanel.ts @@ -116,7 +116,7 @@ export class MarkersPanel extends Panel { private createFilterInputBox(parent: HTMLElement): void { this.filterInputBoxContainer= dom.append(parent, dom.emmet('.filter-box-container')); this.filterInputBox= new InputBox(this.filterInputBoxContainer, this.contextViewService, { - placeholder: Messages.getString('markers.panel.filter.placeholder') + placeholder: Messages.MARKERS_PANEL_FILTER_PLACEHOLDER }); this.toDispose.push(this.filterInputBox.onDidChange((filter:string) => { this.markersModel.filter= filter; diff --git a/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts b/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts index f1c5f32cb9a9f5043792fd858dead20f9fdbf7ae..93ef72608d6225a9c6c1ad1e1fa5e3455a908294 100644 --- a/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts +++ b/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts @@ -44,12 +44,12 @@ export function registerContributions(): void { 'vs/workbench/parts/markers/browser/MarkersPanel', 'MarkersPanel', Constants.MARKERS_PANEL_ID, - Messages.getString('markers.panel.no.problems'), + Messages.MARKERS_PANEL_NO_PROBLEMS, 'markersPanel' )); let actionRegistry = platform.Registry.as(ActionExtensions.WorkbenchActions); - actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleMarkersPanelAction, ToggleMarkersPanelAction.ID, Messages.getString('markers.panel.toggle.label'), { + actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleMarkersPanelAction, ToggleMarkersPanelAction.ID, Messages.MARKERS_PANEL_TOGGLE_LABEL, { primary: null, win: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M }, linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M }, diff --git a/src/vs/workbench/parts/markers/common/MarkersModel.ts b/src/vs/workbench/parts/markers/common/MarkersModel.ts index 84880f448512c4a6748b6a9d9ac7b278204c9d1b..0a08e5cd1b58f8e6ded8d92cc64574b6c963512c 100644 --- a/src/vs/workbench/parts/markers/common/MarkersModel.ts +++ b/src/vs/workbench/parts/markers/common/MarkersModel.ts @@ -116,7 +116,7 @@ export class MarkersModel { public getTitle(markerStatistics: MarkerStatistics):string { let title= MarkersModel.getStatisticsLabel(markerStatistics); - return title ? title : Messages.getString('markers.panel.no.problems'); + return title ? title : Messages.MARKERS_PANEL_NO_PROBLEMS; } public getMessage():string { @@ -125,31 +125,31 @@ export class MarkersModel { } if (this.hasResources()) { if (this.filter) { - return Messages.getString('markers.panel.no.problems.filters'); + return Messages.MARKERS_PANEL_NO_PROBLEMS_FILTERS; } if (this.showOnlyErrors) { - return Messages.getString('markers.panel.no.errors'); + return Messages.MARKERS_PANEL_NO_ERRORS; } } - return Messages.getString('markers.panel.no.problems.build'); + return Messages.MARKERS_PANEL_NO_PROBLEMS_BUILT; } public static getStatisticsLabel(markerStatistics: MarkerStatistics, onlyErrors:boolean=false):string { - let label= this.getLabel('', markerStatistics.errors, 'markers.panel.single.error.label', 'markers.panel.multiple.errors.label'); + let label= this.getLabel('', markerStatistics.errors, Messages.MARKERS_PANEL_SINGLE_ERROR_LABEL, Messages.MARKERS_PANEL_MULTIPLE_ERRORS_LABEL); if (!onlyErrors) { - label= this.getLabel(label, markerStatistics.warnings, 'markers.panel.single.warning.label', 'markers.panel.multiple.warnings.label'); - label= this.getLabel(label, markerStatistics.infos, 'markers.panel.single.info.label', 'markers.panel.multiple.infos.label'); - label= this.getLabel(label, markerStatistics.unknwons, 'markers.panel.single.unknown.label', 'markers.panel.multiple.unknowns.label'); + label= this.getLabel(label, markerStatistics.warnings, Messages.MARKERS_PANEL_SINGLE_WARNING_LABEL, Messages.MARKERS_PANEL_MULTIPLE_WARNINGS_LABEL); + label= this.getLabel(label, markerStatistics.infos, Messages.MARKERS_PANEL_SINGLE_INFO_LABEL, Messages.MARKERS_PANEL_MULTIPLE_INFOS_LABEL); + label= this.getLabel(label, markerStatistics.unknwons, Messages.MARKERS_PANEL_SINGLE_UNKNOWN_LABEL, Messages.MARKERS_PANEL_MULTIPLE_UNKNOWNS_LABEL); } return label; } - private static getLabel(title: string, markersCount: number, singleMarkerKey: string, multipleMarkerKey: string): string { + private static getLabel(title: string, markersCount: number, singleMarkerString: string, multipleMarkersFunction: (markersCount:number)=>string): string { if (markersCount <= 0) { return title; } title= title ? title + ', ' : ''; - title += Messages.getString(markersCount === 1 ? singleMarkerKey : multipleMarkerKey, ''+markersCount); + title += markersCount === 1 ? singleMarkerString : multipleMarkersFunction(markersCount); return title; } } \ No newline at end of file diff --git a/src/vs/workbench/parts/markers/common/Messages.ts b/src/vs/workbench/parts/markers/common/Messages.ts index 11513e4885ce84e0aa704d3bf82291961121d081..348a654b71fa3114c5d85fff8d4e8d23b05c0543 100644 --- a/src/vs/workbench/parts/markers/common/Messages.ts +++ b/src/vs/workbench/parts/markers/common/Messages.ts @@ -6,25 +6,21 @@ import nls = require('vs/nls'); -var Messages = { - 'markers.panel.toggle.label': 'Toggle Problems', - 'markers.panel.no.problems': 'No problems', - 'markers.panel.no.problems.build': 'This workspace is clear or not yet built', - 'markers.panel.no.problems.filters': 'No problems found with given filter criteria', - 'markers.panel.no.errors': 'This workspace has no errors', - 'markers.panel.single.error.label': '{0} Error', - 'markers.panel.multiple.errors.label': '{0} Errors', - 'markers.panel.single.warning.label': '{0} Warning', - 'markers.panel.multiple.warnings.label': '{0} Warnings', - 'markers.panel.single.info.label': '{0} Info', - 'markers.panel.multiple.infos.label': '{0} Infos', - 'markers.panel.single.unknown.label': '{0} Unknown', - 'markers.panel.multiple.unknowns.label': '{0} Unknowns', - 'markers.panel.filter.placeholder': 'Type to Filter', +export default class Messages { - getString: function(key:string, ...args: string[]): string { - return nls.localize(key, Messages[key], args); - } -}; + public static MARKERS_PANEL_TOGGLE_LABEL:string= nls.localize('markers.panel.toggle.label', "Toggle Problems"); + public static MARKERS_PANEL_NO_PROBLEMS:string= nls.localize('markers.panel.no.problems', "No problems"); + public static MARKERS_PANEL_NO_PROBLEMS_BUILT:string= nls.localize('markers.panel.no.problems.build', "This workspace is clear or not yet built"); + public static MARKERS_PANEL_NO_PROBLEMS_FILTERS:string= nls.localize('markers.panel.no.problems.filters', "No results found with provided filter criteria"); + public static MARKERS_PANEL_NO_ERRORS:string= nls.localize('markers.panel.no.errors', "This workspace has no errors"); + public static MARKERS_PANEL_FILTER_PLACEHOLDER:string= nls.localize('markers.panel.filter.placeholder', "Type to Filter"); -export default Messages; \ No newline at end of file + public static MARKERS_PANEL_SINGLE_ERROR_LABEL:string= nls.localize('markers.panel.single.error.label', "1 Error"); + public static MARKERS_PANEL_MULTIPLE_ERRORS_LABEL=(noOfErrors: number):string=>{return nls.localize('markers.panel.multiple.errors.label', "{0} Errors", ''+noOfErrors);}; + public static MARKERS_PANEL_SINGLE_WARNING_LABEL:string= nls.localize('markers.panel.single.warning.label', "1 Warning"); + public static MARKERS_PANEL_MULTIPLE_WARNINGS_LABEL=(noOfWarnings: number):string=>{return nls.localize('markers.panel.multiple.warnings.label', "{0} Warnings", ''+noOfWarnings);}; + public static MARKERS_PANEL_SINGLE_INFO_LABEL:string= nls.localize('markers.panel.single.info.label', "1 Info"); + public static MARKERS_PANEL_MULTIPLE_INFOS_LABEL=(noOfInfos: number):string=>{return nls.localize('markers.panel.multiple.infos.label', "{0} Infos", ''+noOfInfos);}; + public static MARKERS_PANEL_SINGLE_UNKNOWN_LABEL:string= nls.localize('markers.panel.single.unknown.label', "1 Unknown"); + public static MARKERS_PANEL_MULTIPLE_UNKNOWNS_LABEL=(noOfUnknowns: number):string=>{return nls.localize('markers.panel.multiple.unknowns.label', "{0} Unknowns", ''+noOfUnknowns);}; +} \ No newline at end of file