Skip to content

Commit

Permalink
Pushed version number and little cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkLiKally committed Sep 26, 2018
1 parent 743537e commit 77f0001
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 43 deletions.
59 changes: 24 additions & 35 deletions examples/Example.WebApp/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using I18Next.Net.AspNetCore;
using I18Next.Net.AspNetCore;
using I18Next.Net.Backends;
using I18Next.Net.Extensions;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

Expand All @@ -23,48 +17,43 @@ public Startup(IConfiguration configuration)

public IConfiguration Configuration { get; }

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});

services.AddI18NextLocalization(i18n => i18n.IntegrateToAspNetCore());

services.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
.AddI18NextViewLocalization();
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
}

// Enable request localization in order to determine the users desired language based on the Accept-Language header.
app.UseRequestLocalization(options => options.AddSupportedCultures("de", "en"));

app.UseHttpsRedirection();

app.UseStaticFiles();
app.UseCookiePolicy();

app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
"default",
"{controller=Home}/{action=Index}/{id?}");
});
}

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Option 1: Simple setup for AspNetCore using the default configuration
services.AddI18NextLocalization(i18n => i18n.IntegrateToAspNetCore());

// Option 2: Customize the locales location in order to use the same json files on the client side.
// services.AddI18NextLocalization(i18n =>
// {
// i18n.IntegrateToAspNetCore()
// .AddBackend(new JsonFileBackend("wwwroot/locales"));
// });

services.AddMvc()
// Enable view localization and register required I18Next services
.AddI18NextViewLocalization();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Product>I18Next.Net</Product>
<Authors>DarkLiKally</Authors>
<Company>DarkLiKally</Company>
<Version>0.5.1</Version>
<Version>0.6.0</Version>
<RepositoryUrl>https://github.com/DarkLiKally/I18Next.Net</RepositoryUrl>
<PackageProjectUrl>https://github.com/DarkLiKally/I18Next.Net</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
Expand Down
2 changes: 1 addition & 1 deletion src/I18Next.Net.AspNetCore/I18Next.Net.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/DarkLiKally/I18Next.Net</RepositoryUrl>
<PackageProjectUrl>https://github.com/DarkLiKally/I18Next.Net</PackageProjectUrl>
<Version>0.5.1</Version>
<Version>0.6.0</Version>
<Authors>DarkLiKally</Authors>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/I18Next.Net.Extensions/I18Next.Net.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Product>I18Next.Net</Product>
<Authors>DarkLiKally</Authors>
<Company>DarkLiKally</Company>
<Version>0.5.1</Version>
<Version>0.6.0</Version>
<RepositoryUrl>https://github.com/DarkLiKally/I18Next.Net</RepositoryUrl>
<PackageProjectUrl>https://github.com/DarkLiKally/I18Next.Net</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
Expand Down
2 changes: 1 addition & 1 deletion src/I18Next.Net.ICU/I18Next.Net.ICU.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<RepositoryUrl>https://github.com/DarkLiKally/I18Next.Net</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Product>I18Next.Net</Product>
<Version>0.5.1</Version>
<Version>0.6.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MessageFormat" Version="3.0.1" />
Expand Down
2 changes: 1 addition & 1 deletion src/I18Next.Net.PolyglotJs/I18Next.Net.PolyglotJs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageProjectUrl>https://github.com/DarkLiKally/I18Next.Net</PackageProjectUrl>
<RepositoryUrl>https://github.com/DarkLiKally/I18Next.Net</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>0.5.1</Version>
<Version>0.6.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\I18Next.Net\I18Next.Net.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/I18Next.Net/I18Next.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/DarkLiKally/I18Next.Net</RepositoryUrl>
<PackageProjectUrl>https://github.com/DarkLiKally/I18Next.Net</PackageProjectUrl>
<Version>0.5.1</Version>
<Version>0.6.0</Version>
<Authors>DarkLiKally</Authors>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
Expand Down
2 changes: 0 additions & 2 deletions src/I18Next.Net/I18NextNet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public I18NextNet(ITranslationBackend backend, ITranslator translator, ILanguage

public ILogger Logger { get; set; }

public List<IPostProcessor> PostProcessors => Translator.PostProcessors;

public ITranslator Translator { get; }

public ITranslationBackend Backend { get; }
Expand Down

0 comments on commit 77f0001

Please sign in to comment.