Compare commits

...

1 Commits

Author SHA1 Message Date
d3a0b35811 Added appropriate startup services and configs.
Some checks failed
RealYHD/props/pipeline/head There was a failure building this commit
ydeng/props/pipeline/head There was a failure building this commit
Added example files for reference on how to perform localization.
2022-04-25 11:58:33 -05:00
3 changed files with 32 additions and 3 deletions

View File

@ -5,7 +5,6 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<PublishTrimmed>false</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<!-- <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> -->

View File

@ -7,7 +7,6 @@ using Microsoft.Extensions.Hosting;
using Props.Data;
using Props.Models.User;
using Props.Services.Modules;
using System;
namespace Props
{
@ -44,7 +43,16 @@ namespace Props
}
services.AddDefaultIdentity<ApplicationUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddEntityFrameworkStores<ApplicationDbContext>();
services.AddRazorPages();
services.AddLocalization(options =>
{
options.ResourcesPath = "locales";
});
services.AddRazorPages().AddViewLocalization(options =>
{
options.ResourcesPath = "locales";
}).AddDataAnnotationsLocalization();
services.AddSingleton<IShopManager, ModularShopManager>();
services.AddScoped<IMetricsManager, LiveMetricsManager>();
@ -61,8 +69,14 @@ namespace Props
app.UseMigrationsEndPoint();
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRequestLocalization(options =>
{
options.SetDefaultCulture("en-US");
});
app.UseRouting();
app.UseAuthentication();

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="description" xml:space="preserve">
<value>Props is a community driven website meant to help with organizing your online component shopping experience. Create project component lists, search across multiple commonly used online retail stores and share your projects with rest of the community!</value>
</data>
<data name="help.title" xml:space="preserve">
<value>Getting Started</value>
</data>
<data name="help.searchIntroduction" xml:space="preserve">
<value>Props is a site designed to help with the online project component shopping experience. Create project component lists and search across multiple commonly used online retail stores to find the ideal purchase.</value>
</data>
<!-- single line comment -->
<!-- multi
line
comment -->
</root>