From 4f9473db6f77f0411cf38c7e5756e3366de0e8dc Mon Sep 17 00:00:00 2001 From: vijikannan Date: Mon, 22 Jul 2019 14:44:21 +0530 Subject: [PATCH] Translator --- server/i18n/de.json | 22 +++- server/i18n/en.json | 20 ++- src/app/app.module.ts | 7 - .../components/footer/footer.component.ts | 3 +- .../components/header/header.component.html | 42 +----- .../components/header/header.component.ts | 2 + .../components/search/search.component.html | 2 +- .../components/search/search.component.ts | 3 +- .../siteheader/siteheader.component.html | 12 +- .../siteheader/siteheader.component.ts | 2 + src/app/shared/shared.module.ts | 14 +- .../block-detail/block-detail.component.html | 50 +++---- .../block-detail/block-detail.component.ts | 3 + src/app/view/block-view/block-view.module.ts | 12 +- .../graph-detail/graph-detail.component.html | 42 +++--- .../graph-detail/graph-detail.component.ts | 6 + src/app/view/graph-view/graph-view.module.ts | 16 ++- .../block-detail-list.component.html | 8 +- .../block-detail-list.component.ts | 3 +- .../home/graph-list/graph-list.component.html | 122 +++++++++--------- .../home/graph-list/graph-list.component.ts | 3 +- src/app/view/home/home.module.ts | 15 ++- .../latestblocks/latestblocks.component.html | 26 ++-- .../latestblocks/latestblocks.component.ts | 4 +- .../home/not-found/not-found.component.html | 6 +- .../home/not-found/not-found.component.ts | 4 +- src/app/view/view.module.ts | 15 ++- 27 files changed, 268 insertions(+), 196 deletions(-) diff --git a/server/i18n/de.json b/server/i18n/de.json index 60ceae0..11e72ad 100644 --- a/server/i18n/de.json +++ b/server/i18n/de.json @@ -2,7 +2,7 @@ "home": { "HEADER_TEXT": "Sie befinden sich in Testnet", "COUNTDOWN": "Mainnet-Countdown", - "EXPLORE_IT": ", Entdecke es", + "EXPLORE_IT": "Entdecke es", "VIEWALL": "Alle Diagramme anzeigen", "BLOCKCHAIN_HEIGHT": "Blockchain Höhe", "LATEST_BLOCK": "Letzter Block", @@ -15,7 +15,9 @@ "DIFFICULTY" : "Schwierigkeit", "POW_ALGO" : "Pow Algo", "INPUTS" : "Eingänge", + "INPUT" : "Eingang", "OUTPUTS" : "Ausgänge", + "OUTPUT" : "Ausgabe", "KERNELS" : "Kernel", "EPIC" : "Epos", "EXPLORE" : "Erkunden", @@ -29,13 +31,25 @@ "TRANSACTION_FEES" : "Transkationsgebühren", "SUPPLY_GROWTH" : "Angebotswachstum", "HASHRATE_GROWTH_CHART" : "HashRate-Wachstumstabelle", - "BLOCK INTERVAL" : "Sperrintervall", + "BLOCK_INTERVAL" : "Sperrintervall", "TRANSACTIONS_VS_DATE" : "Transaktionen gegen Datum", "DAYS" : "Tage", "MONTHS" : "Monate", "WEEK" : "Woche", "SEARCH_TEXT" : "Suche nach Hash oder Höhe", - "BLOCK_REWARD" : "Block Belohnung" - + "BLOCK_REWARD" : "Block Belohnung", + "NOT_FOUND" : "Seite nicht gefunden", + "NOT_FOUND1" : "Die von Ihnen gesuchte Seite wurde nicht gefunden", + "NOT_FOUND2" : "Gehe zum Explorer", + "COMMIT" : "verpflichten", + "ALGORITHM" : "Pow-Algorithmus", + "TYPE" : "Art", + "SPEND" : "Verbringen", + "FEATURES" : "Eigenschaften", + "LOCK" : "Sperren", + "SEARCH_RESULT" : "Suchergebnisse für", + "SEARCH_RESULT1" : "Ihr Suchbegriff", + "SEARCH_RESULT2" : "ist zu kurz", + "SEARCH_RESULT3" : "Bitte geben Sie mindestens sechs Zeichen ein, wenn Sie nach Hash suchen" } } diff --git a/server/i18n/en.json b/server/i18n/en.json index 72f054d..6d327e7 100644 --- a/server/i18n/en.json +++ b/server/i18n/en.json @@ -15,7 +15,9 @@ "DIFFICULTY" : "Difficulty", "POW_ALGO" : "Pow Algo", "INPUTS" : "Inputs", + "INPUT" : "Input", "OUTPUTS" : "Outputs", + "OUTPUT" : "Output", "KERNELS" : "Kernels", "EPIC" : "Epic", "EXPLORE" : "Explore", @@ -29,13 +31,25 @@ "TRANSACTION_FEES" : "Transcation Fees", "SUPPLY_GROWTH" : "Supply Growth", "HASHRATE_GROWTH_CHART" : "HashRate Growth Chart", - "BLOCK INTERVAL" : "Block Interval", + "BLOCK_INTERVAL" : "Block Interval", "TRANSACTIONS_VS_DATE" : "Transcations Vs Date", "DAYS" : "days", "MONTHS" : "months", "WEEK" : "week", "SEARCH_TEXT" : "Search by hash or height", - "BLOCK_REWARD" : "Block Reward" - + "BLOCK_REWARD" : "Block Reward", + "NOT_FOUND" : "Page Not Found", + "NOT_FOUND1" : "Page you are looking for is not found", + "NOT_FOUND2" : "Go to Explorer", + "ALGORITHM" : "Pow Algorithm", + "COMMIT" : "commit", + "TYPE" : "Type", + "SPEND" : "Spend", + "FEATURES" : "Features", + "LOCK" : "Lock", + "SEARCH_RESULT" : "Search Results for", + "SEARCH_RESULT1" : "Your search term", + "SEARCH_RESULT2" : "is too short", + "SEARCH_RESULT3" : "please enter at least six characters if searching by hash" } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ace121b..f1f2b75 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -21,13 +21,6 @@ export class CustomLoader extends ChartService implements TranslateLoader { public getTranslation(lang): Observable { - // return this.http.get(this.apiHost+'/Translation?lang='+lang).pipe( - // map((res: any) => { - // console.log("Data got: "); - // console.log(res); - // return res; - // }) - // ); let params = new HttpParams(); params = params.append('lang', lang); return this.apiGetRequest(params,'/blockchain_kernel/translator').pipe( diff --git a/src/app/shared/components/footer/footer.component.ts b/src/app/shared/components/footer/footer.component.ts index 7853437..b70d6ba 100644 --- a/src/app/shared/components/footer/footer.component.ts +++ b/src/app/shared/components/footer/footer.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit, Inject } from '@angular/core'; import { DOCUMENT } from '@angular/common'; +import { TransServiceService } from '../../services/trans-service.service'; @Component({ selector: 'epic-explorer-footer', @@ -7,7 +8,7 @@ import { DOCUMENT } from '@angular/common'; styleUrls: ['./footer.component.css'], }) export class FooterComponent implements OnInit { - constructor(@Inject(DOCUMENT) private document: Document) {} + constructor(@Inject(DOCUMENT) private document: Document,public translate: TransServiceService) {} ngOnInit() {} diff --git a/src/app/shared/components/header/header.component.html b/src/app/shared/components/header/header.component.html index ffcf5f8..02a2672 100755 --- a/src/app/shared/components/header/header.component.html +++ b/src/app/shared/components/header/header.component.html @@ -3,8 +3,8 @@
- Block Reward + {{'home.BLOCK_REWARD' | translate}}
{{ hashdata.BlockchainBlockFetchQuery.BlockReward }} Epic
@@ -67,7 +67,7 @@
- Age + {{'home.AGE' | translate}}
{{ hashdata.BlockchainBlockFetchQuery.Timestamp }}
@@ -76,7 +76,7 @@
- Pow Algorithm + {{'home.ALGORITHM' | translate}}
{{ hashdata.BlockchainBlockFetchQuery.PoWAlgorithm }}
@@ -100,7 +100,7 @@
-
Commit
+
{{'home.COMMIT' | translate}}
@@ -110,7 +110,7 @@
@@ -149,13 +149,13 @@
-
Output Type
+
{{'home.OUTPUT' | translate}} {{'home.TYPE' | translate}}
-
Spent
+
{{'home.SPENT' | translate}}
-
Commit
+
{{'home.COMMIT' | translate}}
@@ -164,13 +164,13 @@
-
Output Type
{{ hashoutput.OutputType }}
+
{{'home.OUTPUT' | translate}} {{'home.TYPE' | translate}}
{{ hashoutput.OutputType }}
-
Spent
{{ hashoutput.Spent }}
+
{{'home.SPENT' | translate}}
{{ hashoutput.Spent }}
-
Commit
{{ hashoutput.Commit }}
+
{{'home.COMMIT' | translate}}
{{ hashoutput.Commit }}
@@ -202,7 +202,7 @@
@@ -211,13 +211,13 @@
-
Features
+
{{'home.FEATURES' | translate}}
-
Lock Height
+
{{'home.LOCK' | translate}} {{'home.HEIGHT' | translate}}
-
Fee
+
{{'home.FEE' | translate}}
@@ -225,14 +225,14 @@
-
Features
{{ hashkernel.Features }}
+
{{'home.FEATURES' | translate}}
{{ hashkernel.Features }}
-
Lock Height
{{ hashkernel.LockHeight }}
+
{{'home.LOCK' | translate}} {{'home.HEIGHT' | translate}}
{{ hashkernel.LockHeight }}
-
Fee
{{ hashkernel.Fee }} Epic
+
{{'home.FEE' | translate}}
{{ hashkernel.Fee }} Epic
@@ -269,8 +269,8 @@
-

Search Results for "{{params}}"

-

Your search term {{params}} is too short, please enter at least six characters if searching by hash.

+

{{'home.SEARCH_RESULT' | translate}} "{{params}}"

+

{{'home.SEARCH_RESULT1' | translate}} {{params}} {{'home.SEARCH_RESULT2' | translate}}, {{'home.SEARCH_RESULT3' | translate}}.

diff --git a/src/app/view/block-view/block-detail/block-detail.component.ts b/src/app/view/block-view/block-detail/block-detail.component.ts index 28481d7..868bc14 100644 --- a/src/app/view/block-view/block-detail/block-detail.component.ts +++ b/src/app/view/block-view/block-detail/block-detail.component.ts @@ -5,6 +5,8 @@ import { ActivatedRoute } from '@angular/router'; import { Title } from '@angular/platform-browser'; import { BlockDetailListComponent } from '../../home/block-detail-list/block-detail-list.component'; +import { TransServiceService } from '../../../shared/services/trans-service.service'; + @Component({ providers: [BlockDetailListComponent], selector: 'app-block-detail', @@ -24,6 +26,7 @@ export class BlockDetailComponent implements OnInit { activate_route: ActivatedRoute, private titleService: Title, private latestcomp: BlockDetailListComponent, + public translate: TransServiceService ) { activate_route.params.subscribe(val => { this.params = this.route.snapshot.params.hash; diff --git a/src/app/view/block-view/block-view.module.ts b/src/app/view/block-view/block-view.module.ts index 698ff24..3b9c69a 100644 --- a/src/app/view/block-view/block-view.module.ts +++ b/src/app/view/block-view/block-view.module.ts @@ -4,8 +4,18 @@ import { BlockViewRoutingModule } from './block-view-routing.module'; import { BlockViewWorkspaceComponent } from './block-view-workspace.component'; import { BlockDetailComponent } from './block-detail/block-detail.component'; +import { HttpClientModule, HttpClient, HttpParams } from '@angular/common/http'; +import {TranslateModule, TranslateLoader} from '@ngx-translate/core'; +import { TransServiceService } from '../../shared/services/trans-service.service'; +import { ChartService} from '../../shared/services/chart.service'; +import { CustomLoader } from 'src/app/app.module'; + @NgModule({ declarations: [BlockViewWorkspaceComponent, BlockDetailComponent], - imports: [CommonModule, BlockViewRoutingModule], + imports: [CommonModule, BlockViewRoutingModule, + TranslateModule.forChild({ + loader: {provide: TranslateLoader, useClass: CustomLoader, deps : [HttpClient]}, + })], + providers: [TransServiceService,ChartService], }) export class BlockViewModule {} diff --git a/src/app/view/graph-view/graph-detail/graph-detail.component.html b/src/app/view/graph-view/graph-detail/graph-detail.component.html index a62af34..e85ad5c 100644 --- a/src/app/view/graph-view/graph-detail/graph-detail.component.html +++ b/src/app/view/graph-view/graph-detail/graph-detail.component.html @@ -8,33 +8,33 @@
-

{{this.title}}

+

{{'home.HEADER_TEXT' | translate}}

1 week + " id="1" #item1 [ngClass]="{ active: selectedItem == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}} 15 days + " id="2" #item2 [ngClass]="{ active: selectedItem == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}} 30 days + " id="3" #item3 [ngClass]="{ active: selectedItem == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}} 60 days + " id="4" #item4 [ngClass]="{ active: selectedItem == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}} 3 months + " id="5" #item5 [ngClass]="{ active: selectedItem == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}
Input + [ngClass]="{ active: selectedItem8 == item1.id, txt_primay: true }">{{'home.INPUT' | translate}} Kernel + [ngClass]="{ active: selectedItem8 == item2.id, day15_txt: true }">{{'home.KERNEL' | translate}} Output + [ngClass]="{ active: selectedItem8 == item3.id, day30_txt: true }">{{'home.OUTPUT' | translate}}
@@ -44,8 +44,8 @@
diff --git a/src/app/view/graph-view/graph-detail/graph-detail.component.ts b/src/app/view/graph-view/graph-detail/graph-detail.component.ts index fa2d7fc..6512a6d 100644 --- a/src/app/view/graph-view/graph-detail/graph-detail.component.ts +++ b/src/app/view/graph-view/graph-detail/graph-detail.component.ts @@ -5,6 +5,10 @@ import { ActivatedRoute } from '@angular/router'; import { GraphListComponent } from '../../home/graph-list/graph-list.component'; import { Title } from '@angular/platform-browser'; +import { TransServiceService } from '../../../shared/services/trans-service.service'; + + + @Component({ providers: [GraphListComponent], selector: 'app-graph-detail', @@ -12,6 +16,7 @@ import { Title } from '@angular/platform-browser'; styleUrls: ['./graph-detail.component.css'], }) export class GraphDetailComponent implements OnInit { + TimeArr: any; public hashdata: any = []; public title: any; @@ -30,6 +35,7 @@ export class GraphDetailComponent implements OnInit { private chartService: ChartService, private comp: GraphListComponent, private titleService: Title, + public translate: TransServiceService ) {} ngOnInit() { var self = this; diff --git a/src/app/view/graph-view/graph-view.module.ts b/src/app/view/graph-view/graph-view.module.ts index 9a3cfc3..0ff1672 100644 --- a/src/app/view/graph-view/graph-view.module.ts +++ b/src/app/view/graph-view/graph-view.module.ts @@ -5,9 +5,23 @@ import { GraphViewWorkspaceComponent } from './graph-view-workspace.component'; import { GraphDetailComponent } from './graph-detail/graph-detail.component'; import { HomeModule } from '../home/home.module'; import { SharedModule } from '../../shared/shared.module'; + +import { HttpClientModule, HttpClient, HttpParams } from '@angular/common/http'; +import { CookieService } from 'ngx-cookie-service'; +import {TranslateModule, TranslateLoader} from '@ngx-translate/core'; +import { TransServiceService } from '../../shared/services/trans-service.service'; +import { ChartService} from '../../shared/services/chart.service'; +import { CustomLoader } from 'src/app/app.module'; + + + @NgModule({ declarations: [GraphViewWorkspaceComponent, GraphDetailComponent], - imports: [CommonModule, GraphViewRoutingModule, HomeModule,SharedModule + imports: [CommonModule, GraphViewRoutingModule, HomeModule,SharedModule, + TranslateModule.forChild({ + loader: {provide: TranslateLoader, useClass: CustomLoader, deps : [HttpClient]}, + }) ], + providers: [TransServiceService,CookieService,ChartService], }) export class GraphViewModule {} diff --git a/src/app/view/home/block-detail-list/block-detail-list.component.html b/src/app/view/home/block-detail-list/block-detail-list.component.html index 705edc7..e391b96 100644 --- a/src/app/view/home/block-detail-list/block-detail-list.component.html +++ b/src/app/view/home/block-detail-list/block-detail-list.component.html @@ -28,25 +28,25 @@

{{ latestblockdetail.block_height | number }}

-

Blockchain Height

+

{{'home.BLOCKCHAIN_HEIGHT' | translate}}

{{latestblockdetail.letest_block_num}} {{latestblockdetail.letest_block_duration}}

-

Latest Block

+

{{'home.LATEST_BLOCK' | translate}}

{{latestblockdetail.difficulty | number}} / {{latestblockdetail.targetdifficulty | number}}

-

Latest Block Difficulty

+

{{'home.LATEST_BLOCK1' | translate}}

{{latestblockdetail.coin_existence | number}} Epic

-

Coins in Existence

+

{{'home.COIN_IN' | translate}}

diff --git a/src/app/view/home/block-detail-list/block-detail-list.component.ts b/src/app/view/home/block-detail-list/block-detail-list.component.ts index 810d5df..7aa8982 100644 --- a/src/app/view/home/block-detail-list/block-detail-list.component.ts +++ b/src/app/view/home/block-detail-list/block-detail-list.component.ts @@ -4,6 +4,7 @@ import { HttpParams } from '@angular/common/http'; import * as io from 'socket.io-client'; import { environment } from '../../../../environments/environment'; import { BehaviorSubject, Observable, Subject } from 'rxjs'; +import { TransServiceService } from '../../../shared/services/trans-service.service'; @Component({ selector: 'app-block-detail-list', @@ -17,7 +18,7 @@ export class BlockDetailListComponent implements OnInit { private server = environment.domain; private socket; - constructor(private chartService: ChartService) { + constructor(private chartService: ChartService,public translate: TransServiceService) { this.chartService.createSocketConnection(); } diff --git a/src/app/view/home/graph-list/graph-list.component.html b/src/app/view/home/graph-list/graph-list.component.html index a4aa956..21d22cd 100644 --- a/src/app/view/home/graph-list/graph-list.component.html +++ b/src/app/view/home/graph-list/graph-list.component.html @@ -2,7 +2,7 @@
-

Total Difficulty

+

{{'home.TOTAL_DIFFICULTY' | translate}}

{{ this.lg_last | number }} @@ -26,22 +26,22 @@
1 week + " id="1" #item1 [ngClass]="{ active: selectedItem == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}} 15 days + " id="2" #item2 [ngClass]="{ active: selectedItem == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}} 30 days + " id="3" #item3 [ngClass]="{ active: selectedItem == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}} 60 days + " id="4" #item4 [ngClass]="{ active: selectedItem == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}} 3 months + " id="5" #item5 [ngClass]="{ active: selectedItem == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}
@@ -49,7 +49,7 @@
-

Transactions By Time

+

{{'home.TRANSACTIONS_BY_TIME' | translate}}

@@ -71,14 +71,14 @@
Input + [ngClass]="{ active: selectedItem8 == item1.id, txt_primay: true }">{{'home.INPUT' | translate}} Kernel + [ngClass]="{ active: selectedItem8 == item2.id, day15_txt: true }">{{'home.KERNELS' | translate}} Output + [ngClass]="{ active: selectedItem8 == item3.id, day30_txt: true }">{{'home.OUTPUT' | translate}}
@@ -86,7 +86,7 @@
-

Blocks

+

{{'home.BLOCKS' | translate}}

{{ this.brg_last | number }} @@ -109,22 +109,22 @@
1 week + " id="1" #item31 [ngClass]="{ active: selectedItem3 == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}} 15 days + " id="2" #item32 [ngClass]="{ active: selectedItem3 == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}} 30 days + " id="3" #item33 [ngClass]="{ active: selectedItem3 == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}} 60 days + " id="4" #item34 [ngClass]="{ active: selectedItem3 == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}} 3 months + " id="5" #item35 [ngClass]="{ active: selectedItem3 == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}
@@ -134,7 +134,7 @@
-

Transactions Fee

+

{{'home.TRANSACTION_FEES' | translate}}

{{this.fg_last |number}}
@@ -158,25 +158,25 @@
1 week + [ngClass]="{ active: selectedItem4 == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}} 15 days + [ngClass]="{ active: selectedItem4 == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}} 30 days + [ngClass]="{ active: selectedItem4 == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}} 60 days + [ngClass]="{ active: selectedItem4 == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}} 3 months + [ngClass]="{ active: selectedItem4 == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}
-

Supply Growth

+

{{'home.SUPPLY_GROWTH' | translate}}

{{ this.gg_last | number }} @@ -199,18 +199,18 @@
1 week + [ngClass]="{ active: selectedItem5 == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}} 15 days + [ngClass]="{ active: selectedItem5 == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}} 30 days + [ngClass]="{ active: selectedItem5 == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}} 60 days + [ngClass]="{ active: selectedItem5 == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}} 3 months + [ngClass]="{ active: selectedItem5 == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}
@@ -218,7 +218,7 @@
-

Blocks Mined

+

{{'home.BLOCKS_MINED' | translate}}

{{ this.dg_last | number }} @@ -243,18 +243,18 @@
1 week + [ngClass]="{ active: selectedItem7 == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}} 15 days + [ngClass]="{ active: selectedItem7 == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}} 30 days + [ngClass]="{ active: selectedItem7 == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}} 60 days + [ngClass]="{ active: selectedItem7 == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}} 3 months + [ngClass]="{ active: selectedItem7 == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}
@@ -264,7 +264,7 @@
-

HashRate Growth Chart

+

{{'home.HASHRATE_GROWTH_CHART' | translate}}

{{ this.hg_last | number }} @@ -287,18 +287,18 @@
1 week + [ngClass]="{ active: selectedItem9 == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}} 15 days + [ngClass]="{ active: selectedItem9 == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}} 30 days + [ngClass]="{ active: selectedItem9 == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}} 60 days + [ngClass]="{ active: selectedItem9 == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}} 3 months + [ngClass]="{ active: selectedItem9 == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}
@@ -306,7 +306,7 @@
-

Block Interval

+

{{'home.BLOCK_INTERVAL' | translate}}

{{ this.ag_last | number }} sec
@@ -328,18 +328,18 @@
1 week + [ngClass]="{ active: selectedItem2 == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}} 15 days + [ngClass]="{ active: selectedItem2 == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}} 30 days + [ngClass]="{ active: selectedItem2 == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}} 60 days + [ngClass]="{ active: selectedItem2 == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}} 3 months + [ngClass]="{ active: selectedItem2 == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}
@@ -347,7 +347,7 @@
-

Transactions vs Date

+

{{'home.TRANSACTIONS_VS_DATE' | translate}}

{{ this.tg_last | number }} @@ -371,22 +371,22 @@
1 week + #item1 [ngClass]="{ active: selectedItem8 == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}} 15 days + " id="2" #item2 [ngClass]="{ active: selectedItem8 == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}} 30 days + " id="3" #item3 [ngClass]="{ active: selectedItem8 == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}} 60 days + " id="4" #item4 [ngClass]="{ active: selectedItem8 == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}} 3 months + " id="5" #item5 [ngClass]="{ active: selectedItem8 == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}
diff --git a/src/app/view/home/graph-list/graph-list.component.ts b/src/app/view/home/graph-list/graph-list.component.ts index 88f3ac6..4843db2 100644 --- a/src/app/view/home/graph-list/graph-list.component.ts +++ b/src/app/view/home/graph-list/graph-list.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit, Input } from '@angular/core'; import { ChartService } from '../../../shared/services/chart.service'; import { HttpClient, HttpParams } from '@angular/common/http'; +import { TransServiceService } from '../../../shared/services/trans-service.service'; @Component({ selector: 'epic-explorer-graph-list', @@ -47,7 +48,7 @@ export class GraphListComponent implements OnInit { public tDate: any; public tHour: any; - constructor(private chartService: ChartService, private http: HttpClient) {} + constructor(private chartService: ChartService, private http: HttpClient,public translate: TransServiceService) {} ngOnInit() { /* Total Difficulty and blocks chart fetching */ diff --git a/src/app/view/home/home.module.ts b/src/app/view/home/home.module.ts index f2ded73..325be79 100644 --- a/src/app/view/home/home.module.ts +++ b/src/app/view/home/home.module.ts @@ -7,6 +7,15 @@ import { GraphListComponent } from './graph-list/graph-list.component'; import { BlockDetailListComponent } from './block-detail-list/block-detail-list.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { SharedModule } from '../../shared/shared.module'; + +import { HttpClientModule, HttpClient, HttpParams } from '@angular/common/http'; +import { CookieService } from 'ngx-cookie-service'; +import {TranslateModule, TranslateLoader} from '@ngx-translate/core'; +import { TransServiceService } from '../../shared/services/trans-service.service'; +import { ChartService} from '../../shared/services/chart.service'; +import { CustomLoader } from 'src/app/app.module'; + + @NgModule({ declarations: [ HomeWorksapceComponent, @@ -19,7 +28,11 @@ import { SharedModule } from '../../shared/shared.module'; HomeRoutingModule, FormsModule, ReactiveFormsModule, - SharedModule + SharedModule, + TranslateModule.forChild({ + loader: {provide: TranslateLoader, useClass: CustomLoader, deps : [HttpClient]}, + }) ], + providers: [TransServiceService,CookieService,ChartService], }) export class HomeModule {} diff --git a/src/app/view/home/latestblocks/latestblocks.component.html b/src/app/view/home/latestblocks/latestblocks.component.html index 2180e29..8313fd7 100644 --- a/src/app/view/home/latestblocks/latestblocks.component.html +++ b/src/app/view/home/latestblocks/latestblocks.component.html @@ -1,31 +1,31 @@
-

Latest Blocks

+

{{'home.LATEST_BLOCK' | translate}}

-
Height
+
{{'home.HEIGHT' | translate}}
-
Hash
+
{{'home.HASH' | translate}}
-
Age
+
{{'home.AGE' | translate}}
-
Difficulty
+
{{'home.DIFFICULTY' | translate}}
-
Pow Algo
+
{{'home.POW_ALGO' | translate}}
-
#Inputs
+
#{{'home.INPUTS' | translate}}
-
#Outputs
+
#{{'home.OUTPUTS' | translate}}
-
#Kernels
+
#{{'home.KERNALS' | translate}}
@@ -34,7 +34,7 @@
-
Height
{{ hashvalue.blockchain_block_height }}
+
{{'home.HEIGHT' | translate}}
{{ hashvalue.blockchain_block_height }}
Hash
{{ hashvalue.hashstart @@ -55,13 +55,13 @@
Pow Algo
{{ hashvalue.PoWAlgo }}
-
#Inputs
{{ hashvalue.input_count }}
+
#{{'home.INPUTS' | translate}}
{{ hashvalue.input_count }}
-
#Outputs
{{ hashvalue.output_count }}
+
#{{'home.OUTPUTS' | translate}}
{{ hashvalue.output_count }}
-
#Kernels
{{ hashvalue.kernal_count }}
+
#{{'home.KERNELS' | translate}}
{{ hashvalue.kernal_count }}