Skip to content

Commit

Permalink
feat(login): add the locale changes (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsunvtech authored and lexzhukov committed Apr 19, 2017
1 parent c4dad9a commit e033edf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/app/pages/login/login.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
<div class="auth-main">
<div class="auth-block">
<h1>Sign in to ng2-admin</h1>
<a routerLink="/register" class="auth-link">New to ng2-admin? Sign up!</a>
<h1 translate>{{'login.title'}}</h1>
<a routerLink="/register" class="auth-link" translate>{{'login.signup_link'}}</a>

<form [formGroup]="form" (ngSubmit)="onSubmit(form.value)" class="form-horizontal">
<div class="form-group row" [ngClass]="{'has-error': (!email.valid && email.touched), 'has-success': (email.valid && email.touched)}">
<label for="inputEmail3" class="col-sm-2 control-label">Email</label>
<label for="inputEmail3" class="col-sm-2 control-label" translate>{{'login.email'}}</label>

<div class="col-sm-10">
<input [formControl]="email" type="email" class="form-control" id="inputEmail3" placeholder="Email">
<input [formControl]="email" type="email" class="form-control" id="inputEmail3" placeholder="{{'login.email' | translate}}">
</div>
</div>
<div class="form-group row" [ngClass]="{'has-error': (!password.valid && password.touched), 'has-success': (password.valid && password.touched)}">
<label for="inputPassword3" class="col-sm-2 control-label">Password</label>
<label for="inputPassword3" class="col-sm-2 control-label" translate>{{'login.password'}}</label>

<div class="col-sm-10">
<input [formControl]="password" type="password" class="form-control" id="inputPassword3" placeholder="Password">
<input [formControl]="password" type="password" class="form-control" id="inputPassword3" placeholder="{{'login.password' | translate}}">
</div>
</div>
<div class="form-group row">
<div class="offset-sm-2 col-sm-10">
<button [disabled]="!form.valid" type="submit" class="btn btn-default btn-auth">Sign in</button>
<a routerLink="/login" class="forgot-pass">Forgot password?</a>
<button [disabled]="!form.valid" type="submit" class="btn btn-default btn-auth" translate>{{'login.sign_in'}}</button>
<a routerLink="/login" class="forgot-pass" translate>{{'login.forgot_password'}}</a>
</div>
</div>
</form>

<div class="auth-sep"><span><span>or Sign in with one click</span></span></div>
<div class="auth-sep"><span><span translate>{{'login.sign_from_app_text'}}</span></span></div>

<div class="al-share-auth">
<ul class="al-share clearfix">
<li><i class="socicon socicon-facebook" title="Share on Facebook"></i></li>
<li><i class="socicon socicon-twitter" title="Share on Twitter"></i></li>
<li><i class="socicon socicon-google" title="Share on Google Plus"></i></li>
<li><i class="socicon socicon-facebook" title="{{'login.share_on_facebook' | translate}}"></i></li>
<li><i class="socicon socicon-twitter" title="{{'login.share_on_twitter' | translate}}"></i></li>
<li><i class="socicon socicon-google" title="{{'login.share_on_google_plus' | translate}}"></i></li>
</ul>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/app/pages/login/login.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AppTranslationModule } from '../../app.translation.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgaModule } from '../../theme/nga.module';

Expand All @@ -10,6 +11,7 @@ import { routing } from './login.routing';
@NgModule({
imports: [
CommonModule,
AppTranslationModule,
ReactiveFormsModule,
FormsModule,
NgaModule,
Expand Down
12 changes: 12 additions & 0 deletions src/assets/i18n/US/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{
"login": {
"title": "Sign in to ng2-admin",
"signup_link": "New to ng2-admin? Sign up!",
"email": "Email",
"password": "Password",
"sign_in": "Sign in",
"forgot_password": "Forgot password?",
"sign_from_app_text": "or Sign in with one click",
"share_on_facebook": "Share on Facebook",
"share_on_twitter": "Share on Twitter",
"share_on_google_plus": "Share on Google Plus"
},
"general": {
"akveo": "Akveo",
"home": "Home",
Expand Down

0 comments on commit e033edf

Please sign in to comment.