Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add translate pipe with tags #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { environment } from "../environments/environment";

import { HammerModule, HammerGestureConfig, HAMMER_GESTURE_CONFIG } from "@angular/platform-browser";
import { DIRECTION_ALL } from "hammerjs";
import { TranslatePipeModule } from "src/pipes/translate/translate.pipe.module";

@Injectable()
export class HammerConfig extends HammerGestureConfig {
Expand All @@ -42,7 +43,8 @@ registerLocaleData(localePt, "pt-BR", localePtExtra);
AngularFireModule.initializeApp(environment.firebaseConfig),
AngularFireDatabaseModule,
AngularFireAnalyticsModule,
HammerModule
HammerModule,
TranslatePipeModule
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ],
Expand Down
14 changes: 7 additions & 7 deletions src/app/contact/contact.component.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<section id="contact" itemscope itemtype="https://schema.org/ContactPage">
<div class="feedback-container" [ngClass]="feedbackStatus">
<p class="success">
<span i18n="contact@@successfulSubmit">Thank you for contacting me, I'll reply to you very soon.</span>
<span i18n="contact@@successfulSubmit">{{ 'tag_contact_success' | translate }}</span>
<fa-icon [icon]="faTimes" class="icon" title="Close" (click)="closeFeedbackMessage()"></fa-icon>
</p>
<p class="error">
<span i18n="contact@@errorSubmit">Sorry, there is an instability, try again later, or contact me via email or social media.</span>
<span i18n="contact@@errorSubmit">{{ 'tag_contact_failure' | translate }}</span>
<fa-icon [icon]="faTimes" class="icon" title="Close" (click)="closeFeedbackMessage()"></fa-icon>
</p>
</div>
<div class="container" [ngClass]="{'fade': hasBeenSubmited}">
<div class="left-side">
<div class="title">
<h1 i18n="nav@@contact">Contact</h1>
<h1 i18n="nav@@contact">{{ 'tag_contact' | translate }}</h1>
</div>
<div class="top-container">
<div class="picture"></div>
<div class="info">
<p class="name" *ngIf="name"><span itemprop="name">{{ name }}</span></p>
<p class="email" *ngIf="email"><fa-icon [icon]="faEnvelope" class="icon" title="Email"></fa-icon><a href="mailto:{{ email }}" itemprop="email">{{ email }}</a></p>
<p class="phone" *ngIf="phone"><fa-icon [icon]="faPhone" class="icon" title="Phone"></fa-icon><span itemprop="telephone">{{ phone }}</span></p>
<p class="location" *ngIf="location"><fa-icon [icon]="faMapMarkerAlt" class="icon" title="City"></fa-icon><span itemprop="city">{{ location }}</span></p>
<p class="name" *ngIf="name"><span itemprop="name">{{ 'tag_name' | translate }}</span></p>
<p class="email" *ngIf="email"><fa-icon [icon]="faEnvelope" class="icon" title="Email"></fa-icon><a href="mailto:{{ 'tag_email' | translate }}" itemprop="email">{{ 'tag_email' | translate }}</a></p>
<p class="phone" *ngIf="phone"><fa-icon [icon]="faPhone" class="icon" title="Phone"></fa-icon><span itemprop="telephone">{{ 'tag_phone' | translate }}</span></p>
<p class="location" *ngIf="location"><fa-icon [icon]="faMapMarkerAlt" class="icon" title="City"></fa-icon><span itemprop="city">{{ 'tag_location' | translate }}</span></p>
</div>
</div>
<div class="bottom-container">
Expand Down
3 changes: 2 additions & 1 deletion src/app/experience/experience.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { ExperienceTimelineComponent } from "./experience-timeline/experience-ti
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
import { CommonModule } from "@angular/common";
import { CoreModule } from "../core/core.module";
import { TranslatePipeModule } from "src/pipes/translate/translate.pipe.module";

@NgModule({
imports: [ CommonModule, FontAwesomeModule, CoreModule ],
imports: [ CommonModule, FontAwesomeModule, CoreModule, TranslatePipeModule ],
declarations: [ ExperienceComponent, ExperienceTimelineComponent ],
exports: [ ExperienceComponent ]
})
Expand Down
4 changes: 2 additions & 2 deletions src/app/footer/footer.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<footer itemscope itemtype="https://schema.org/WPFooter">
<p class="fork-github"><a href="https://github.com/guilhermeborgesbastos/live-resume" target="_blank"><fa-icon [icon]="faGithubSquare" class="icon"></fa-icon><span>Fork on GitHub</span></a></p>
<p class="copyright">{{ year | date:'yyyy' }} &copy; Copyright</p>
<p class="fork-github"><a href="https://github.com/kshitij-halankar/live-resume-1" target="_blank"><fa-icon [icon]="faGithubSquare" class="icon"></fa-icon><span>{{ 'tag_github_fork' | translate }}</span></a></p>
<p class="copyright">{{ year | date:'yyyy' }} &copy; {{ 'tag_copyright' | translate }}</p>
</footer>
21 changes: 4 additions & 17 deletions src/app/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,20 @@
</div>

<div class="child logo-container" itemprop="brand" itemscope itemtype="https://schema.org/Brand">
<a (click)="resetMenu()" href="#" class="logo" itemprop="name" itemprop="logo">gbastos</a>
<a (click)="resetMenu()" href="#" class="logo" itemprop="name" itemprop="logo">{{ 'tag_name' | translate }}</a>
</div>

<div class="child nav-container" #nav [hidden]="!hasMenuToggled" itemscope itemtype="https://schema.org/SiteNavigationElement">
<ul>
<li><a (click)="resetMenu()" href="#about" i18n="nav@@aboutMe" itemprop="url"><span itemprop="name">About me</span></a></li>
<li><a (click)="resetMenu()" href="#about" i18n="nav@@aboutMe" itemprop="url"><span itemprop="name">{{ 'tag_about_me' | translate }}</span></a></li>
<li><a (click)="resetMenu()" href="#experience" i18n="nav@@experiences" itemprop="url"><span itemprop="name">Experiences</span></a></li>
<li><a (click)="resetMenu()" href="#posts" i18n="nav@@posts" itemprop="url"><span itemprop="name">Posts</span></a></li>
<li><a (click)="resetMenu()" href="#contact" i18n="nav@@contact" itemprop="url"><span itemprop="name">Contact</span></a></li>
<li><a (click)="resetMenu()" href="#posts" i18n="nav@@posts" itemprop="url"><span itemprop="name">{{ 'tag_posts' | translate }}</span></a></li>
<li><a (click)="resetMenu()" href="#contact" i18n="nav@@contact" itemprop="url"><span itemprop="name">{{ 'tag_contact' | translate }}</span></a></li>
<!-- TODO: update here -->
<li><a (click)="resetMenu()" href="assets/cv-english-guilherme-bastos-v2.0.pdf" i18n-title="nav@@open.as.pdf" title="Open Resume as PDF" target="_blank"><fa-icon [icon]="faCloudDownloadAlt" class="bar-icon"></fa-icon></a></li>
</ul>
</div>

<div class="child language-container">
<div class="frame">
<ul>
<li itemprop="availableLanguage" itemscope itemtype="https://schema.org/Language">
<a href="/en/index.html" [ngClass]="{'active': locale === 'en'}" itemprop="name">EN</a>
</li>
<li itemprop="availableLanguage" itemscope itemtype="https://schema.org/Language">
<a href="/pt/index.html" [ngClass]="{'active': locale === 'pt'}" itemprop="name">PT</a>
</li>
</ul>
</div>
</div>

<div class="child share-container" #shareBtn>
<fa-icon [icon]="faShareAlt" class="icon" (click)="share()" alt="share" itemprop="share"></fa-icon>
</div>
Expand Down
7 changes: 4 additions & 3 deletions src/app/header/header.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, OnInit, Input, ViewChild, ElementRef, Renderer2, Inject, LOCALE_ID, AfterViewInit } from "@angular/core";
import { faBars, faShareAlt, faCloudDownloadAlt, IconDefinition } from "@fortawesome/free-solid-svg-icons";
import { NgNavigatorShareService } from "ng-navigator-share";
import { tags } from "src/assets/tags/tags";

@Component({
selector: "app-header",
Expand Down Expand Up @@ -101,9 +102,9 @@ export class HeaderComponent implements OnInit, AfterViewInit {
async share() {
try{
await this.ngNavigatorShareService.share({
title: "Live Resume - Guilherme Borges Bastos",
text: "Hello, I'm a Full-stack Java Web Developer with 10+ years of experience designing web and mobile projects. Find out more in my live-resume!",
url: "https://guilhermeborgesbastos.com"
title: "Live Resume - " + tags.tag_name,
text: tags.tag_share_text,
url: tags.tag_share_url
});
} catch(error) {
console.log("You app is not shared, reason: ", error);
Expand Down
4 changes: 3 additions & 1 deletion src/app/resume/resume.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { CoreModule } from "../core/core.module";
import { PostsModule } from "../posts/posts.molule";
import { ContactService } from "../contact/contact.service";
import { FooterComponent } from "../footer/footer.component";
import { TranslatePipeModule } from "src/pipes/translate/translate.pipe.module";

@NgModule({
imports: [
Expand All @@ -21,7 +22,8 @@ import { FooterComponent } from "../footer/footer.component";
FontAwesomeModule,
WelcomeModule,
ExperienceModule,
PostsModule
PostsModule,
TranslatePipeModule
],
declarations: [
ResumeComponent,
Expand Down
19 changes: 19 additions & 0 deletions src/assets/tags/tags.ts

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kshitij-halankar, I like your suggestions, however, I cannot approve it since you changed the original content to your personal information. Thank you!

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export const tags = {
tag_name: "Kshitij Halankar",
tag_email: "kshitij.p.halankar@gmail.com",
tag_phone: "+1 000 000 0000",
tag_location : "Mississauga, ON, Canada",
tag_dob : "14-10-1995",
tag_years_old : "years old",
tag_about_me : "About me",
tag_posts : "Posts",
tag_contact : "Contact",
tag_share_text : "Hello, I'm a Full-stack Java Web Developer with 10+ years of experience designing web and mobile projects. Find out more in my live-resume!",
tag_share_url : "https://kshitij-halankar.github.io/live-resume-1/",
tag_copyright : "Copyright",
tag_github_fork : "Fork on GitHub",
tag_contact_success : "Thank you for contacting me, I'll reply to you very soon.",
tag_contact_failure:
"Sorry, there is an instability, try again later, or contact me via email or social media.",

};
19 changes: 19 additions & 0 deletions src/pipes/translate/translate.pipe.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { NgModule } from "@angular/core";
import { TranslatePipe } from "./translate.pipe";


@NgModule({
imports: [

],
declarations: [
TranslatePipe
],
exports: [
TranslatePipe
],
providers: [

]
})
export class TranslatePipeModule {}
12 changes: 12 additions & 0 deletions src/pipes/translate/translate.pipe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Pipe, PipeTransform } from '@angular/core';
import { tags } from 'src/assets/tags/tags';

@Pipe({name: 'translate'})
export class TranslatePipe implements PipeTransform {

transform( tag: string): string {
return tags[tag as keyof typeof tags];
}
}

// {{ '' | translate }}