Skip to content

Commit

Permalink
Merge pull request #5 from maurobonfietti/translate
Browse files Browse the repository at this point in the history
Translate
  • Loading branch information
maurobonfietti authored Nov 7, 2020
2 parents e3febd2 + 96d4bb4 commit eac15ff
Show file tree
Hide file tree
Showing 39 changed files with 516 additions and 1,739 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Social [Frontend]

This is an example of a simple social media, using MEAN Stack (MongoDB, Express.js, Angular and Node.js).
This is an example of a simple social media, using MEAN Stack: MongoDB, Express.js, Angular and Node.js.

## Application Stack

Expand Down
1,767 changes: 405 additions & 1,362 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
</div>
<ul class="nav navbar-nav" *ngIf="identity">
<li>
<a [routerLink]="['/home']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-home"></span> Inicio</a>
<a [routerLink]="['/home']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-home"></span> Home</a>
</li>
<li>
<a [routerLink]="['/timeline']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-th-list"></span> Timeline</a>
</li>
<li>
<a [routerLink]="['/gente']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-user"></span> Gente</a>
<a [routerLink]="['/gente']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-user"></span> Find Friends</a>
</li>
<li>
<a [routerLink]="['/mensajes']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-envelope"></span> Mensajes</a>
<a [routerLink]="['/mensajes']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-envelope"></span> Messages</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right" *ngIf="!identity">
<li>
<a [routerLink]="['/login']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-log-in"></span> Login</a>
</li>
<li>
<a [routerLink]="['/register']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-user"></span> Registrar</a>
<a [routerLink]="['/register']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-user"></span> Register</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right" *ngIf="identity">
Expand All @@ -34,13 +34,13 @@
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{identity.name}} <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
<a [routerLink]="['/perfil', identity._id]"><span class="glyphicon glyphicon-user"></span> Mi perfil</a>
<a [routerLink]="['/perfil', identity._id]"><span class="glyphicon glyphicon-user"></span> My Profile</a>
</li>
<li>
<a [routerLink]="['/mis-datos']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-cog"></span> Mis datos</a>
<a [routerLink]="['/my-account']" [routerLinkActive]="['active']"><span class="glyphicon glyphicon-cog"></span> My Account</a>
</li>
<li>
<a class="pointer" (click)="logout()"><span class="glyphicon glyphicon-log-out"></span> Cerrar sesion</a>
<a class="pointer" (click)="logout()"><span class="glyphicon glyphicon-log-out"></span> Logout</a>
</li>
</ul>
</li>
Expand Down
1 change: 0 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { routing, appRoutingProviders } from './app.routing';
import { MomentModule } from 'angular2-moment';

import { HttpModule } from '@angular/http';

// Module Custom
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const appRoutes: Routes = [
{path: 'home', component: HomeComponent},
{path: 'login', component: LoginComponent},
{path: 'register', component: RegisterComponent},
{path: 'mis-datos', component: UserEditComponent, canActivate:[UserGuard]},
{path: 'my-account', component: UserEditComponent, canActivate:[UserGuard]},
{path: 'gente', component: UsersComponent, canActivate:[UserGuard]},
{path: 'gente/:page', component: UsersComponent, canActivate:[UserGuard]},
{path: 'timeline', component: TimelineComponent, canActivate:[UserGuard]},
Expand Down
8 changes: 4 additions & 4 deletions src/app/components/followed/followed.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ <h1 class="h1-strong" *ngIf="user">{{title}} {{user.name}}</h1>
[class.btn-danger]="follow.user._id == followUserOver"
>
<span *ngIf="follow.user._id == followUserOver; else following">
<span class="glyphicon glyphicon-minus-sign"></span> Dejar de seguir
<span class="glyphicon glyphicon-minus-sign"></span> Stop Follow
</span>
<ng-template #following>
<span class="glyphicon glyphicon-ok-sign"></span> Siguiendo
<span class="glyphicon glyphicon-ok-sign"></span> Following
</ng-template>
</button>
</div>
</div>
</div>
</div>
<ul class="pagination pull-right">
<li *ngIf="page > 1"><a [routerLink]="['/seguidores', userPageId, prev_page]">Anterior</a></li>
<li *ngIf="pages != page"><a [routerLink]="['/seguidores', userPageId, next_page]">Siguiente</a></li>
<li *ngIf="page > 1"><a [routerLink]="['/seguidores', userPageId, prev_page]">Prev</a></li>
<li *ngIf="pages != page"><a [routerLink]="['/seguidores', userPageId, next_page]">Next</a></li>
</ul>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/followed/followed.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class FollowedComponent implements OnInit {
private _userService: UserService,
private _followService: FollowService
) {
this.title = 'Seguidores de';
this.title = 'Followers of';
this.url = GLOBAL.url;
this.identity = this._userService.getIdentity();
this.token = this._userService.getToken();
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/following/following.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ <h1 class="h1-strong" *ngIf="user">{{title}} {{user.name}}</h1>
</div>
</div>
<ul class="pagination pull-right">
<li *ngIf="page > 1"><a [routerLink]="['/siguiendo', userPageId, prev_page]">Anterior</a></li>
<li *ngIf="pages != page"><a [routerLink]="['/siguiendo', userPageId, next_page]">Siguiente</a></li>
<li *ngIf="page > 1"><a [routerLink]="['/siguiendo', userPageId, prev_page]">Prev</a></li>
<li *ngIf="pages != page"><a [routerLink]="['/siguiendo', userPageId, next_page]">Next</a></li>
</ul>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/following/following.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class FollowingComponent implements OnInit {
private _userService: UserService,
private _followService: FollowService
) {
this.title = 'Seguidos por';
this.title = 'Followed by';
this.url = GLOBAL.url;
this.identity = this._userService.getIdentity();
this.token = this._userService.getToken();
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="col-lg-8 col-lg-offset-2">
<div class="jumbotron">
<h1>{{title}}</h1>
<p> Nueva red social ;-)</p>
<p>Yes, Another Social Web App</p>
<p *ngIf="identity">
<a class="btn btn-success btn-lg" role="button" [routerLink]="['/timeline']" [routerLinkActive]="['active']">Timeline</a>
<a class="btn btn-default btn-lg" role="button" [routerLink]="['/gente']" [routerLinkActive]="['active']">Gente</a>
<a class="btn btn-primary btn-lg" role="button" [routerLink]="['/mensajes']" [routerLinkActive]="['active']">Mensajes</a>
<a class="btn btn-default btn-lg" role="button" [routerLink]="['/gente']" [routerLinkActive]="['active']">Find Friends</a>
<a class="btn btn-primary btn-lg" role="button" [routerLink]="['/mensajes']" [routerLinkActive]="['active']">Messages</a>
</p>
<img src="assets/social-3.png" />
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export class HomeComponent implements OnInit {
constructor(
private _userService: UserService
) {
this.title = 'Bienvenido!';
this.title = 'Welcome';
}

ngOnInit() {
console.log('[OK] Component: home.');
console.log('Social App Version: 0.2.0');
console.log('Social App Version: 0.3.0');
this.identity = this._userService.getIdentity();
}

Expand Down
12 changes: 6 additions & 6 deletions src/app/components/login/login.component.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<div class="col-lg-5">
<h1 class="h1-strong">{{title}}</h1>
<div class="alert alert-success" *ngIf="status == 'success'">
Te has identificado correctamente, bienvenido!!
Successful login, welcome!
</div>
<div class="alert alert-danger" *ngIf="status == 'error'">
Error al iniciar sesión, datos incorrectos.
Login failed: email or password invalid.
</div>
<form #loginForm="ngForm" (ngSubmit)="onSubmit()" class="col-lg-12">
<p>
<label>Email</label>
<input type="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" name="email" #email="ngModel" [(ngModel)]="user.email" class="form-control" required />
<span *ngIf="!email.valid && email.touched" >El email no es correcto!</span>
<span *ngIf="!email.valid && email.touched" >Invalid email.</span>
</p>
<p>
<label>Contraseña</label>
<label>Password</label>
<input type="password" name="password" #password="ngModel" [(ngModel)]="user.password" class="form-control" required />
<span *ngIf="!password.valid && password.touched" >La Contraseña es obligatoria!</span>
<span *ngIf="!password.valid && password.touched" >Password is required.</span>
</p>
<input type="submit" value="Ingresar" class="btn btn-success" [disabled]="!loginForm.form.valid">
<input type="submit" value="Login" class="btn btn-success" [disabled]="!loginForm.form.valid">
</form>
</div>
2 changes: 1 addition & 1 deletion src/app/components/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class LoginComponent implements OnInit {
private _router: Router,
private _userService: UserService
) {
this.title = 'Inicia Sesión';
this.title = 'Login';
this.user = new User("", "", "", "", "", "", "ROLE_USER", "");
}

Expand Down
14 changes: 7 additions & 7 deletions src/app/components/profile/profile.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1 class="h1-strong">
</div>
<div class="user-name pull-left">
<div class="label label-default pull-left" *ngIf="followed">
Te Sigue
Following you
</div>
<div class="clearfix"></div>
<div class="pull-left">
Expand All @@ -27,7 +27,7 @@ <h1 class="h1-strong">
*ngIf="!following"
(click)="followUser(user._id)"
>
Seguir
Follow
</button>
<button
class="btn btn-primary"
Expand All @@ -38,10 +38,10 @@ <h1 class="h1-strong">
[class.btn-danger]="user._id == followUserOver"
>
<span *ngIf="user._id == followUserOver; else following">
<span class="glyphicon glyphicon-minus-sign"></span> Dejar de seguir
<span class="glyphicon glyphicon-minus-sign"></span> Stop Follow
</span>
<ng-template #following>
<span class="glyphicon glyphicon-ok-sign"></span> Siguiendo
<span class="glyphicon glyphicon-ok-sign"></span> Following
</ng-template>
</button>
</div>
Expand All @@ -50,7 +50,7 @@ <h1 class="h1-strong">
<div class="following-data">
<a [routerLink]="['/siguiendo', user._id, 1]">
<span class="label-stats">
Siguiendo
Following
</span>
<span class="number-stats">
{{stats.following}}
Expand All @@ -60,7 +60,7 @@ <h1 class="h1-strong">
<div class="following-data">
<a [routerLink]="['/seguidores', user._id, 1]">
<span class="label-stats">
Seguidores
Followers
</span>
<span class="number-stats">
{{stats.followed}}
Expand All @@ -70,7 +70,7 @@ <h1 class="h1-strong">
<div class="following-data">
<a [routerLink]="['/perfil', user._id]">
<span class="label-stats">
Publicaciones
Posts
</span>
<span class="number-stats">
{{stats.publications}}
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/profile/profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class ProfileComponent implements OnInit {
private _userService: UserService,
private _followService: FollowService
) {
this.title = 'Perfil';
this.title = 'Profile';
this.identity = this._userService.getIdentity();
this.token = this._userService.getToken();
this.url = GLOBAL.url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h4 class="publication-text pull-left">
<div class="col-lg-12 text-center" *ngIf="publications && publications.length">
<p>
<button class="btn btn-success" (click)="viewMore()" *ngIf="!noMore">
Ver más publicaciones
See more posts
</button>
</p>
</div>
2 changes: 1 addition & 1 deletion src/app/components/publications/publications.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class PublicationsComponent implements OnInit {
private _userService: UserService,
private _publicationService: PublicationService
) {
this.title = 'Publicaciones';
this.title = 'Posts';
this.identity = this._userService.getIdentity();
this.token = this._userService.getToken();
this.url = GLOBAL.url;
Expand Down
22 changes: 11 additions & 11 deletions src/app/components/register/register.component.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<div class="col-lg-5">
<h1 class="h1-strong">{{title}}</h1>
<div class="alert alert-success" *ngIf="status == 'success'">
Registro completado correctamente, <a [routerLink]="['/login']">ingresa aqui.</a>
<div class="alert alert-success" >
User created successfully. <a [routerLink]="['/login']">Login here.</a>
</div>
<div class="alert alert-danger" *ngIf="status == 'error'">
Error al registrarse. Reintenta mas tarde.
Error when you try to register. Try again later.
</div>
<form #registerForm="ngForm" (ngSubmit)="onSubmit(registerForm)" class="col-lg-12">
<p>
<label>Nombre</label>
<label>First Name</label>
<input type="text" name="name" #name="ngModel" [(ngModel)]="user.name" class="form-control" required />
<span *ngIf="!name.valid && name.touched" >El nombre es obligatorio!</span>
<span *ngIf="!name.valid && name.touched" >First name is required.</span>
</p>
<p>
<label>Apellido</label>
<label>Last Name</label>
<input type="text" name="surname" #surname="ngModel" [(ngModel)]="user.surname" class="form-control" required />
<span *ngIf="!surname.valid && surname.touched" >El apellido es obligatorio!</span>
<span *ngIf="!surname.valid && surname.touched" >Last name is required.</span>
</p>
<p>
<label>Apodo</label>
<label>Nickname</label>
<input type="text" name="nick" #nick="ngModel" [(ngModel)]="user.nick" class="form-control" required />
<span *ngIf="!nick.valid && nick.touched" >El apodo es obligatorio!</span>
<span *ngIf="!nick.valid && nick.touched" >Nickname is required.</span>
</p>
<p>
<label>Email</label>
<input type="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" name="email" #email="ngModel" [(ngModel)]="user.email" class="form-control" required />
<span *ngIf="!email.valid && email.touched" >El email no es correcto!</span>
<span *ngIf="!email.valid && email.touched" >Invalid email.</span>
</p>
<p>
<label>Password</label>
<input type="password" name="password" #password="ngModel" [(ngModel)]="user.password" class="form-control" required />
<span *ngIf="!password.valid && password.touched" >El password es obligatorio!</span>
<span *ngIf="!password.valid && password.touched" >Password is required.</span>
</p>
<input type="submit" value="{{title}}" class="btn btn-success" [disabled]="!registerForm.form.valid">
</form>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/register/register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class RegisterComponent implements OnInit {
private _router: Router,
private _userService: UserService
) {
this.title = 'Registrate';
this.title = 'Register';
this.user = new User("", "", "", "", "", "", "ROLE_USER", "");
}

Expand Down
18 changes: 9 additions & 9 deletions src/app/components/sidebar/sidebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1 class="h1-strong">Hola, {{identity.name}}</h1>
<div class="following-data">
<a [routerLink]="['/siguiendo', identity._id, 1]">
<span class="label-stats">
Siguiendo
Following
</span>
<span class="number-stats">
{{stats.following}}
Expand All @@ -30,7 +30,7 @@ <h1 class="h1-strong">Hola, {{identity.name}}</h1>
<div class="following-data">
<a [routerLink]="['/seguidores', identity._id, 1]">
<span class="label-stats">
Seguidores
Followers
</span>
<span class="number-stats">
{{stats.followed}}
Expand All @@ -40,7 +40,7 @@ <h1 class="h1-strong">Hola, {{identity.name}}</h1>
<div class="following-data">
<a [routerLink]="['/perfil', identity._id]">
<span class="label-stats">
Publicaciones
Posts
</span>
<span class="number-stats">
{{stats.publications}}
Expand All @@ -51,21 +51,21 @@ <h1 class="h1-strong">Hola, {{identity.name}}</h1>
</div>
<div id="new-publication" class="col-lg-4 pull-left panel panel-default">
<div class="alert alert-success" *ngIf="status == 'success'">
Publicado correctamente
Posted correctly
</div>
<div class="alert alert-danger" *ngIf="status == 'error'">
No se pudo publicar
Could not publish
</div>
<form #newPubForm="ngForm" (ngSubmit)="onSubmit(newPubForm, $event)" class="col-lg-10">
<p>
<label>Que estas pensando hoy?</label>
<label>What are you thinking today?</label>
<textarea name="text" #text="ngModel" [(ngModel)]="publication.text" class="form-control" required></textarea>
<span *ngIf="!text.valid && text.touched">El texto es obligatorio</span>
<span *ngIf="!text.valid && text.touched">The text is required</span>
</p>
<p>
<label>Sube tu foto</label>
<label>Upload your photo</label>
<input type="file" placeholder="Subir imagen" (change)="fileChangeEvent($event)" />
</p>
<input type="submit" value="Enviar" class="btn btn-success" [disabled]="!newPubForm.form.valid" />
<input type="submit" value="Send" class="btn btn-success" [disabled]="!newPubForm.form.valid" />
</form>
</div>
Loading

0 comments on commit eac15ff

Please sign in to comment.