@@ -11,6 +11,7 @@ import * as targz from 'tar.gz';
1111const isWindows = / ^ w i n / . test ( process . platform ) ;
1212const textFileExtensions = [ '.gitignore' , 'template_gitignore' , '.config' , '.cs' , '.cshtml' , '.csproj' , '.html' , '.js' , '.json' , '.jsx' , '.md' , '.nuspec' , '.ts' , '.tsx' ] ;
1313const yeomanGeneratorSource = './src/yeoman' ;
14+ const localizationPackageGuid = '{296D76CB-AD6F-4B46-9072-33CC07E265F8}' ;
1415
1516const dotNetPackages = {
1617 builtIn : 'Microsoft.DotNet.Web.Spa.ProjectTemplates' ,
@@ -22,15 +23,16 @@ interface TemplateConfig {
2223 dotNetNewId : string ;
2324 dotNetPackageId : string ;
2425 displayName : string ;
26+ localizationIdStart : number ;
2527}
2628
2729const templates : { [ key : string ] : TemplateConfig } = {
28- 'angular' : { dotNetPackageId : dotNetPackages . builtIn , dir : '../../templates/AngularSpa/' , dotNetNewId : 'Angular' , displayName : 'Angular' } ,
29- 'aurelia' : { dotNetPackageId : dotNetPackages . extra , dir : '../../templates/AureliaSpa/' , dotNetNewId : 'Aurelia' , displayName : 'Aurelia' } ,
30- 'knockout' : { dotNetPackageId : dotNetPackages . extra , dir : '../../templates/KnockoutSpa/' , dotNetNewId : 'Knockout' , displayName : 'Knockout.js' } ,
31- 'react-redux' : { dotNetPackageId : dotNetPackages . builtIn , dir : '../../templates/ReactReduxSpa/' , dotNetNewId : 'ReactRedux' , displayName : 'React.js and Redux' } ,
32- 'react' : { dotNetPackageId : dotNetPackages . builtIn , dir : '../../templates/ReactSpa/' , dotNetNewId : 'React' , displayName : 'React.js' } ,
33- 'vue' : { dotNetPackageId : dotNetPackages . extra , dir : '../../templates/VueSpa/' , dotNetNewId : 'Vue' , displayName : 'Vue.js' }
30+ 'angular' : { dotNetPackageId : dotNetPackages . builtIn , dir : '../../templates/AngularSpa/' , dotNetNewId : 'Angular' , displayName : 'Angular' , localizationIdStart : 100 } ,
31+ 'aurelia' : { dotNetPackageId : dotNetPackages . extra , dir : '../../templates/AureliaSpa/' , dotNetNewId : 'Aurelia' , displayName : 'Aurelia' , localizationIdStart : 200 } ,
32+ 'knockout' : { dotNetPackageId : dotNetPackages . extra , dir : '../../templates/KnockoutSpa/' , dotNetNewId : 'Knockout' , displayName : 'Knockout.js' , localizationIdStart : 300 } ,
33+ 'react-redux' : { dotNetPackageId : dotNetPackages . builtIn , dir : '../../templates/ReactReduxSpa/' , dotNetNewId : 'ReactRedux' , displayName : 'React.js and Redux' , localizationIdStart : 400 } ,
34+ 'react' : { dotNetPackageId : dotNetPackages . builtIn , dir : '../../templates/ReactSpa/' , dotNetNewId : 'React' , displayName : 'React.js' , localizationIdStart : 500 } ,
35+ 'vue' : { dotNetPackageId : dotNetPackages . extra , dir : '../../templates/VueSpa/' , dotNetNewId : 'Vue' , displayName : 'Vue.js' , localizationIdStart : 600 }
3436} ;
3537
3638function isTextFile ( filename : string ) : boolean {
@@ -251,10 +253,13 @@ function buildDotNetNewNuGetPackage(packageId: string) {
251253 }
252254 } , null , 2 ) ) ;
253255
256+ const localisedNameId = templateConfig . localizationIdStart + 0 ;
257+ const localisedDescId = templateConfig . localizationIdStart + 1 ;
258+
254259 fs . writeFileSync ( path . join ( templateConfigDir , 'vs-2017.3.host.json' ) , JSON . stringify ( {
255260 $schema : 'http://json.schemastore.org/vs-2017.3.host' ,
256- name : { text : templateConfig . displayName } ,
257- description : { text : `ASP.NET Core application with MVC and ${ templateConfig . displayName } ` } ,
261+ name : { text : templateConfig . displayName , package : localizationPackageGuid , id : localisedNameId . toString ( ) } ,
262+ description : { text : `ASP.NET Core application with ${ templateConfig . displayName } ` , package : localizationPackageGuid , id : localisedDescId . toString ( ) } ,
258263 order : 301 ,
259264 icon : 'icon.png' ,
260265 learnMoreLink : 'https://github.com/aspnet/JavaScriptServices' ,
0 commit comments