-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add localization for register page (o2-auth)
Merge pull request #90 from live-dev999/live-dev999/issue32
- Loading branch information
Showing
23 changed files
with
515 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/Services/auth/O2NextGen.Auth.Web/Extensions/LocalizationExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Globalization; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Localization; | ||
using Microsoft.AspNetCore.Mvc.Razor; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace O2NextGen.Auth.Web.Extensions | ||
{ | ||
public static class LocalizationExtensions | ||
{ | ||
public static IServiceCollection AddConfiguredLocalization(this IServiceCollection services) | ||
{ | ||
services.AddLocalization(options => options.ResourcesPath = "Resources"); | ||
services.AddMvc() | ||
.AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix) | ||
.AddDataAnnotationsLocalization(); | ||
services | ||
.Configure<RequestLocalizationOptions>(options => | ||
{ | ||
var cultures = new[] | ||
{ | ||
new CultureInfo("en"), | ||
new CultureInfo("ru"), | ||
new CultureInfo("de"), | ||
new CultureInfo("tr"), | ||
new CultureInfo("he"), | ||
}; | ||
options.DefaultRequestCulture = new RequestCulture("ru"); | ||
options.SupportedCultures = cultures; | ||
options.SupportedUICultures = cultures; | ||
}); | ||
|
||
return services; | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/Services/auth/O2NextGen.Auth.Web/Migrations/20211107024126_InitDb.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
.../O2NextGen.Auth.Web/Pages/Register.cshtml → ...en.Auth.Web/Pages/Account/Register.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
@page | ||
@model RegisterModel | ||
|
||
@inject Microsoft.AspNetCore.Mvc.Localization.IViewLocalizer Localizer | ||
|
||
<div class="row"> | ||
<div class="col-md-4"> | ||
<form asp-route-returnUrl="@Model.ReturnUrl" method="post"> | ||
<h4>Create a new account.</h4> | ||
<h4>@Localizer["CreateNewUser"]</h4> | ||
<hr /> | ||
<div ></div> | ||
<div > | ||
<label asp-for="Input.Email"></label> | ||
<label asp-for="Input.Email">@Localizer["Email"]</label> | ||
<input asp-for="Input.Email" /> | ||
<span asp-validation-for="Input.Email" ></span> | ||
</div> | ||
<div class="form-group"> | ||
<label asp-for="Input.Password"></label> | ||
<label asp-for="Input.Password">@Localizer["Password"]</label> | ||
<input asp-for="Input.Password" /> | ||
<span asp-validation-for="Input.Password" ></span> | ||
</div> | ||
<div class="form-group"> | ||
<label asp-for="Input.ConfirmPassword"></label> | ||
<label asp-for="Input.ConfirmPassword">@Localizer["ConfirmPassword"]</label> | ||
<input asp-for="Input.ConfirmPassword" /> | ||
<span asp-validation-for="Input.ConfirmPassword" ></span> | ||
</div> | ||
<button type="submit" >Register</button> | ||
<button type="submit" >@Localizer["Register"]</button> | ||
</form> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/Services/auth/O2NextGen.Auth.Web/Pages/_ViewImports.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
@using Microsoft.AspNetCore.Identity | ||
@using O2NextGen.Auth.Pages | ||
@using O2NextGen.Auth.Web.Pages.Account | ||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
src/Services/auth/O2NextGen.Auth.Web/Resources/Pages/Account/Register.de.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
src/Services/auth/O2NextGen.Auth.Web/Resources/Pages/Account/Register.de.resx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<root> | ||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | ||
<xsd:element name="root" msdata:IsDataSet="true"> | ||
|
||
</xsd:element> | ||
</xsd:schema> | ||
<resheader name="resmimetype"> | ||
<value>text/microsoft-resx</value> | ||
</resheader> | ||
<resheader name="version"> | ||
<value>1.3</value> | ||
</resheader> | ||
<resheader name="reader"> | ||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<resheader name="writer"> | ||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<data name="CreateNewUser" xml:space="preserve"> | ||
<value>Neuen Benutzer erstellen.</value> | ||
</data> | ||
<data name="Register" xml:space="preserve"> | ||
<value>Registrieren</value> | ||
</data> | ||
<data name="Email" xml:space="preserve"> | ||
<value>Email</value> | ||
</data> | ||
<data name="Password" xml:space="preserve"> | ||
<value>Passwort</value> | ||
</data> | ||
<data name="ConfirmPassword" xml:space="preserve"> | ||
<value>Kennwort bestätigen</value> | ||
</data> | ||
</root> |
Oops, something went wrong.