From fa17332ff32939869782cd82f4d090b9c2e74601 Mon Sep 17 00:00:00 2001 From: Marcelo Mohr Maciel Date: Wed, 6 Feb 2019 21:37:33 -0200 Subject: [PATCH 1/3] adicionando PT-BR --- .../Localization/Resources/AbpAccount/Web/en.json | 9 ++++++++- .../Pages/Account/Login.cshtml | 14 +++++++------- .../Pages/Account/Login.cshtml.cs | 1 + .../Localization/MyProjectName/pt-BR.json | 8 ++++++++ 4 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 templates/mvc/src/MyCompanyName.MyProjectName.Domain/Localization/MyProjectName/pt-BR.json diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/en.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/en.json index 284cc5584f..1055309b22 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/en.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/en.json @@ -10,6 +10,13 @@ "UserLockedOutMessage": "The user account has been locked out due to invalid login attempts. Please wait a while and try again.", "InvalidUserNameOrPassword": "Invalid username or password!", "LoginIsNotAllowed": "You are not allowed to login! You need to confirm your email/phone number.", - "SelfRegistrationDisabledMessage": "Self user registration is disabled for this application. Contact to the application administrator to register a new user." + "SelfRegistrationDisabledMessage": "Self user registration is disabled for this application. Contact to the application administrator to register a new user.", + "Login": "Login", + "Cancel": "Cancel", + "Register": "Register", + "UseAnotherServiceToLogIn.": "Use another service to log in.", + "InvalidLoginRequest": "Invalid login request", + "ThereAreNoLoginSchemesConfiguredForThisClient": "There are no login schemes configured for this client.", + "LogInUsingYourProviderAccount": "Log in using your {0} account" } } \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml index 81c29c0fb6..2ed1143f76 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml @@ -23,14 +23,14 @@ @Html.DisplayNameFor(m => m.LoginInput.RememberMe) - Cancel @* TODO: Only show if identity server is used *@ - Login + @L["Cancel"] @* TODO: Only show if identity server is used *@ + @L["Login"]
@if (string.Equals(await SettingManager.GetOrNullAsync(AccountSettingNames.IsSelfRegistrationEnabled), "true", StringComparison.OrdinalIgnoreCase)) { - Register + @L["Register"] }
} @@ -38,13 +38,13 @@ @if (Model.VisibleExternalProviders.Any()) {
-

Use another service to log in.

+

@L["UseAnotherServiceToLogIn"]

@foreach (var provider in Model.VisibleExternalProviders) { - + }
@@ -53,7 +53,7 @@ @if (!Model.EnableLocalLogin && !Model.VisibleExternalProviders.Any()) {
- Invalid login request - There are no login schemes configured for this client. + @L["InvalidLoginRequest"] + @L["ThereAreNoLoginSchemesConfiguredForThisClient"]
} diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs index 4de08796bd..5fab86150b 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs @@ -14,6 +14,7 @@ using Volo.Abp.Identity; using Volo.Abp.Security.Claims; using Volo.Abp.Uow; using Volo.Abp.Validation; +using Microsoft.AspNetCore.Mvc.Localization; namespace Volo.Abp.Account.Web.Pages.Account { diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Domain/Localization/MyProjectName/pt-BR.json b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/Localization/MyProjectName/pt-BR.json new file mode 100644 index 0000000000..8c818a07af --- /dev/null +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/Localization/MyProjectName/pt-BR.json @@ -0,0 +1,8 @@ +{ + "culture": "pt-BR", + "texts": { + "Menu:Home": "Principal", + "Welcome": "Seja bem-vindo!", + "LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io." + } +} \ No newline at end of file From fe2652a1774e01d55cd4a3a6c5b17a087d93a271 Mon Sep 17 00:00:00 2001 From: Marcelo Mohr Maciel Date: Thu, 7 Feb 2019 11:17:40 -0200 Subject: [PATCH 2/3] Translating hardcoded strings and adding PT-BR. --- .../Resources/AbpAccount/Web/pt-BR.json | 9 ++++- .../Resources/AbpAccount/Web/tr.json | 9 ++++- .../Resources/AbpAccount/Web/zh-Hans.json | 33 +++++++++++-------- .../Pages/Account/Login.cshtml | 1 + 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json index 45eb49d2ca..fec54c0476 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json @@ -10,6 +10,13 @@ "UserLockedOutMessage": "Esta conta de usuário está bloqueada devido a muitas tentativas de entrar. Por favor, espero alguns instantes e tente novamente.", "InvalidUserNameOrPassword": "Usuário ou senha estão incorretos!", "LoginIsNotAllowed": "Você não possui permissão para entrar! Você deveconfirmar seu e-mail ou número de telefone.", - "SelfRegistrationDisabledMessage": "Não é permitido que você crie uma nova conta neste site. Contate um administrador para que ele crie uma conta para você." + "SelfRegistrationDisabledMessage": "Não é permitido que você crie uma nova conta neste site. Contate um administrador para que ele crie uma conta para você.", + "Login": "Entrar", + "Cancel": "Cancelar", + "Register": "Registrar-se", + "UseAnotherServiceToLogIn.": "Use outro serviço para entrar.", + "InvalidLoginRequest": "Requisição de acesso inválida!", + "ThereAreNoLoginSchemesConfiguredForThisClient": "Não existe um esquema de acesso para este usuário", + "LogInUsingYourProviderAccount": "Acessse utilizando sua conta {0}" } } \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json index b56354053c..54ae7b0016 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json @@ -10,6 +10,13 @@ "UserLockedOutMessage": "Kullanıcı hesabı hatalı giriş denemeleri nedeniyle kilitlenmiştir. Lütfen bir süre bekleyip tekrar deneyin.", "InvalidUserNameOrPassword": "Kullanıcı adı ya da şifre geçersiz!", "LoginIsNotAllowed": "Giriş yapamazsınız! E-posta adresinizi ya da telefon numaranızı doğrulamanız gerekiyor.", - "SelfRegistrationDisabledMessage": "Bu uygulama için kullanıcıların kendi kendilerine kaydolmaları engellenmiştir. Yeni bir kullanıcı kaydetmek için lütfen uygulama yöneticisi ile iletişime geçin." + "SelfRegistrationDisabledMessage": "Bu uygulama için kullanıcıların kendi kendilerine kaydolmaları engellenmiştir. Yeni bir kullanıcı kaydetmek için lütfen uygulama yöneticisi ile iletişime geçin.", + "Login": "Login", + "Cancel": "Cancel", + "Register": "Register", + "UseAnotherServiceToLogIn.": "Use another service to log in.", + "InvalidLoginRequest": "Invalid login request", + "ThereAreNoLoginSchemesConfiguredForThisClient": "There are no login schemes configured for this client.", + "LogInUsingYourProviderAccount": "Log in using your {0} account" } } \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json index b019757f83..fdaa5ff228 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json @@ -1,15 +1,22 @@ { - "culture": "zh-Hans", - "texts": { - "UserName": "用户名称", - "EmailAddress": "邮箱地址", - "UserNameOrEmailAddress": "用户名称或邮箱地址", - "Password": "密码", - "RememberMe": "记住我", - "UseAnotherServiceToLogin": "使用另一个服务登录", - "UserLockedOutMessage": "登录失败,用户账户已被锁定.请稍后再试.", - "InvalidUserNameOrPassword": "用户名或密码错误!", - "LoginIsNotAllowed": "无法登录!你需要验证邮箱地址/手机号.", - "SelfRegistrationDisabledMessage": "应用程序未开放注册,请联系管理员添加新用户." - } + "culture": "zh-Hans", + "texts": { + "UserName": "用户名称", + "EmailAddress": "邮箱地址", + "UserNameOrEmailAddress": "用户名称或邮箱地址", + "Password": "密码", + "RememberMe": "记住我", + "UseAnotherServiceToLogin": "使用另一个服务登录", + "UserLockedOutMessage": "登录失败,用户账户已被锁定.请稍后再试.", + "InvalidUserNameOrPassword": "用户名或密码错误!", + "LoginIsNotAllowed": "无法登录!你需要验证邮箱地址/手机号.", + "SelfRegistrationDisabledMessage": "应用程序未开放注册,请联系管理员添加新用户.", + "Login": "Login", + "Cancel": "Cancel", + "Register": "Register", + "UseAnotherServiceToLogIn.": "Use another service to log in.", + "InvalidLoginRequest": "Invalid login request", + "ThereAreNoLoginSchemesConfiguredForThisClient": "There are no login schemes configured for this client.", + "LogInUsingYourProviderAccount": "Log in using your {0} account" } +} diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml index 2ed1143f76..69268afed3 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml @@ -1,6 +1,7 @@ @page @using Volo.Abp.Account.Web.Settings @model Volo.Abp.Account.Web.Pages.Account.LoginModel +@inherits Volo.Abp.Account.Web.Pages.Account.AccountPage @inject Volo.Abp.Settings.ISettingManager SettingManager @if (Model.EnableLocalLogin) { From a237fb76c934e0fa121bdf0c37c7d5fcf8d29d79 Mon Sep 17 00:00:00 2001 From: Marcelo Mohr Maciel Date: Thu, 7 Feb 2019 11:17:40 -0200 Subject: [PATCH 3/3] Translating hardcoded strings and adding PT-BR. --- .../Resources/AbpAccount/Web/pt-BR.json | 9 ++++- .../Resources/AbpAccount/Web/tr.json | 9 ++++- .../Resources/AbpAccount/Web/zh-Hans.json | 33 +++++++++++-------- .../Pages/Account/Login.cshtml | 1 + .../Pages/Account/Login.cshtml.cs | 1 - 5 files changed, 37 insertions(+), 16 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json index 45eb49d2ca..fec54c0476 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/pt-BR.json @@ -10,6 +10,13 @@ "UserLockedOutMessage": "Esta conta de usuário está bloqueada devido a muitas tentativas de entrar. Por favor, espero alguns instantes e tente novamente.", "InvalidUserNameOrPassword": "Usuário ou senha estão incorretos!", "LoginIsNotAllowed": "Você não possui permissão para entrar! Você deveconfirmar seu e-mail ou número de telefone.", - "SelfRegistrationDisabledMessage": "Não é permitido que você crie uma nova conta neste site. Contate um administrador para que ele crie uma conta para você." + "SelfRegistrationDisabledMessage": "Não é permitido que você crie uma nova conta neste site. Contate um administrador para que ele crie uma conta para você.", + "Login": "Entrar", + "Cancel": "Cancelar", + "Register": "Registrar-se", + "UseAnotherServiceToLogIn.": "Use outro serviço para entrar.", + "InvalidLoginRequest": "Requisição de acesso inválida!", + "ThereAreNoLoginSchemesConfiguredForThisClient": "Não existe um esquema de acesso para este usuário", + "LogInUsingYourProviderAccount": "Acessse utilizando sua conta {0}" } } \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json index b56354053c..54ae7b0016 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/tr.json @@ -10,6 +10,13 @@ "UserLockedOutMessage": "Kullanıcı hesabı hatalı giriş denemeleri nedeniyle kilitlenmiştir. Lütfen bir süre bekleyip tekrar deneyin.", "InvalidUserNameOrPassword": "Kullanıcı adı ya da şifre geçersiz!", "LoginIsNotAllowed": "Giriş yapamazsınız! E-posta adresinizi ya da telefon numaranızı doğrulamanız gerekiyor.", - "SelfRegistrationDisabledMessage": "Bu uygulama için kullanıcıların kendi kendilerine kaydolmaları engellenmiştir. Yeni bir kullanıcı kaydetmek için lütfen uygulama yöneticisi ile iletişime geçin." + "SelfRegistrationDisabledMessage": "Bu uygulama için kullanıcıların kendi kendilerine kaydolmaları engellenmiştir. Yeni bir kullanıcı kaydetmek için lütfen uygulama yöneticisi ile iletişime geçin.", + "Login": "Login", + "Cancel": "Cancel", + "Register": "Register", + "UseAnotherServiceToLogIn.": "Use another service to log in.", + "InvalidLoginRequest": "Invalid login request", + "ThereAreNoLoginSchemesConfiguredForThisClient": "There are no login schemes configured for this client.", + "LogInUsingYourProviderAccount": "Log in using your {0} account" } } \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json index b019757f83..fdaa5ff228 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json +++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json @@ -1,15 +1,22 @@ { - "culture": "zh-Hans", - "texts": { - "UserName": "用户名称", - "EmailAddress": "邮箱地址", - "UserNameOrEmailAddress": "用户名称或邮箱地址", - "Password": "密码", - "RememberMe": "记住我", - "UseAnotherServiceToLogin": "使用另一个服务登录", - "UserLockedOutMessage": "登录失败,用户账户已被锁定.请稍后再试.", - "InvalidUserNameOrPassword": "用户名或密码错误!", - "LoginIsNotAllowed": "无法登录!你需要验证邮箱地址/手机号.", - "SelfRegistrationDisabledMessage": "应用程序未开放注册,请联系管理员添加新用户." - } + "culture": "zh-Hans", + "texts": { + "UserName": "用户名称", + "EmailAddress": "邮箱地址", + "UserNameOrEmailAddress": "用户名称或邮箱地址", + "Password": "密码", + "RememberMe": "记住我", + "UseAnotherServiceToLogin": "使用另一个服务登录", + "UserLockedOutMessage": "登录失败,用户账户已被锁定.请稍后再试.", + "InvalidUserNameOrPassword": "用户名或密码错误!", + "LoginIsNotAllowed": "无法登录!你需要验证邮箱地址/手机号.", + "SelfRegistrationDisabledMessage": "应用程序未开放注册,请联系管理员添加新用户.", + "Login": "Login", + "Cancel": "Cancel", + "Register": "Register", + "UseAnotherServiceToLogIn.": "Use another service to log in.", + "InvalidLoginRequest": "Invalid login request", + "ThereAreNoLoginSchemesConfiguredForThisClient": "There are no login schemes configured for this client.", + "LogInUsingYourProviderAccount": "Log in using your {0} account" } +} diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml index 2ed1143f76..69268afed3 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml @@ -1,6 +1,7 @@ @page @using Volo.Abp.Account.Web.Settings @model Volo.Abp.Account.Web.Pages.Account.LoginModel +@inherits Volo.Abp.Account.Web.Pages.Account.AccountPage @inject Volo.Abp.Settings.ISettingManager SettingManager @if (Model.EnableLocalLogin) { diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs index 5fab86150b..4de08796bd 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs @@ -14,7 +14,6 @@ using Volo.Abp.Identity; using Volo.Abp.Security.Claims; using Volo.Abp.Uow; using Volo.Abp.Validation; -using Microsoft.AspNetCore.Mvc.Localization; namespace Volo.Abp.Account.Web.Pages.Account {