diff --git a/package.json b/package.json index db63cc3..2cd3ae4 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,9 @@ "lint": "ng lint", "build:client-and-server-bundles": "ng build --prod && ng run explorer2-epic:server:production", "build:prerender": "npm run build:client-and-server-bundles && npm run compile:server && npm run generate:prerender", - "build:ssr": "npm run build:client-and-server-bundles && npm run compile:server", + "build:ssr": "npm run build:client-and-server-bundles && npm run compile:server && npm run move:build", "compile:server": "tsc -p server.tsconfig.json", + "move:build" : "(cp -r ./server/i18n/ dist/server)", "generate:prerender": "cd dist && node prerender", "serve:prerender": "cd dist/browser && http-server", "serve:ssr": "node dist/server" diff --git a/server/controllers/BlockchainKernel.ts b/server/controllers/BlockchainKernel.ts index d7d56ef..d36386d 100644 --- a/server/controllers/BlockchainKernel.ts +++ b/server/controllers/BlockchainKernel.ts @@ -2,6 +2,7 @@ import express from 'express'; import { Request, Response, NextFunction } from 'express'; import { getRepository, getConnection } from 'typeorm'; import { validationMiddleware } from '../middlewares'; +import * as path from 'path'; import { InternalServerErrorException, NoDataFoundException, @@ -455,19 +456,20 @@ export class BlockchainKernelController { next: NextFunction, ) => { try { - const lang = request.querylang; + const lang = request.query.lang; - response.status(200).json({ + /* response.status(200).json({ status: 200, timestamp: Date.now(), message: 'Transaction fee chart fetched successfully', response: { lang: lang }, - }); - - // res.header("Content-Type",'application/json'); - // res.sendFile(path.join(__dirname + '/../i18n/'+req.query.lang+'.json')); + }); */ + console.log(path.resolve(__dirname + '/../i18n/'+request.query.lang+'.json')); + console.log("Without :",path.resolve('/../i18n/'+request.query.lang+'.json')); + response.header("Content-Type",'application/json'); + response.sendFile(path.resolve(__dirname + '/../i18n/'+request.query.lang+'.json')); } catch (error) { next(new InternalServerErrorException(error)); diff --git a/server/i18n/de.json b/server/i18n/de.json new file mode 100644 index 0000000..60ceae0 --- /dev/null +++ b/server/i18n/de.json @@ -0,0 +1,41 @@ +{ + "home": { + "HEADER_TEXT": "Sie befinden sich in Testnet", + "COUNTDOWN": "Mainnet-Countdown", + "EXPLORE_IT": ", Entdecke es", + "VIEWALL": "Alle Diagramme anzeigen", + "BLOCKCHAIN_HEIGHT": "Blockchain Höhe", + "LATEST_BLOCK": "Letzter Block", + "LATEST_BLOCK1": "Neueste Block-Schwierigkeit & Erweiterungen", + "COIN_IN": "Münzen in Existenz", + "HEIGHT": "Höhe", + "HASH": "Hash", + "AGE": "Alter", + "FEE": "Gebühr", + "DIFFICULTY" : "Schwierigkeit", + "POW_ALGO" : "Pow Algo", + "INPUTS" : "Eingänge", + "OUTPUTS" : "Ausgänge", + "KERNELS" : "Kernel", + "EPIC" : "Epos", + "EXPLORE" : "Erkunden", + "AGO" : "vor", + "MINUTE" : "minute", + "TOTAL_DIFFICULTY" : "Gesamtschwierigkeit", + "TRANSACTIONS_BY_TIME" : "Transkationen nach Zeit", + "BLOCKS" : "Blöcke", + "BLOCK" : "Block", + "BLOCKS_MINED" : "Blöcke abgebaut", + "TRANSACTION_FEES" : "Transkationsgebühren", + "SUPPLY_GROWTH" : "Angebotswachstum", + "HASHRATE_GROWTH_CHART" : "HashRate-Wachstumstabelle", + "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" + + } +} diff --git a/server/i18n/en.json b/server/i18n/en.json index 33c5793..72f054d 100644 --- a/server/i18n/en.json +++ b/server/i18n/en.json @@ -1,226 +1,41 @@ { "home": { - "HEADER_TEXT": "Business Intelligence,
Insights & Analytics platform", - "INNER_HEADER": "Beyond just charts its ", - "INNER_HEADER1": ", intelligent data analytics", - "AVAILABLE_IN": "Available in", - "3_MONTH_FREE_TRAIL": "3 Months Free Trial", - "INTELY_FEATURES": "Intely Features", - "PLUGIN_N_EXTENSIONS": "Plugins & Extensions", - "SUPPORT_CONTEXT": "Need customizations & Enterprise support for your custom built ERP/eCommerce systems?", - "ENTERPRISE_CONTEXT": "Integrate inte.ly Dashboard in your custom ERP / e-Commerce Platforms.
Contact our sales team to discuss about inte.ly customization for your business.", - "ABOUT_TITLE": "About inte.ly Platform", - "ABOUT_CONTEXT": "intely (inte.ly) is a Business Intelligence, Insights & Analytics platform for retail & wholesale businesses. We offer BI extensions & plugins for eCommerce platforms such as Magento, Shopify & Etc. Intely also provides customizations and Enterprice Business Intelligence development services for custom built ERP / eCommerce systems.", - "DEMO_URL_HEADING" : "Enter your Details to Get Demo URL", - "FIRST_NAME_VALIDATION" : "First Name is required", - "LAST_NAME_VALIDATION" : "Last Name is required", - "PHONE_NUMBER_VALIDATION" : "Please enter the valid phone number", - "PHONE_NUMBER_VALIDATION1" : "Phone number is required", - "MESSAGE_VALIDATION" : "Message is required" - }, - "login" : { - "LOGIN" : "Login", - "WELCOME_MSG" : "Welcome back,
Please sign in to your account.", - "EMAIL_ERROR" : "Please enter a valid email address", - "EMAIL_VALIDATION" : "Email is required", - "PASSWORD_VALIDATION" : "Password is required", - "EMAIL_ALERT" : "Please verify your email!", - "LOGIN_IN" : "Log In", - "EMAIL_VERIFICATION" : "Resend verify email", - "REMEMBER_ME" : "Remember Me", - "SIGN_UP" : "Sign Up", - "FORGOT_PASSWORD" : "Forgot Password?" - }, - "register" : { - "REGISTER" : "Register", - "REGISTER_CONTEXT" : "Register 3 Months Free Trial Account
Credit card not required during trial period", - "NAME_VALIDATION" : "Name is required", - "EMAIL_ERROR1" : "Please enter a valid email address", - "PASSWORD_VALIDATION1" : "Password should contain atleast 6 characters.", - "CONFIRMPASSWORD_ERROR" : "Confirm password is required", - "CONFIRMPASSWORD_ALERT" : "Confirm Password does not match", - "ACCEPT" : "I accept inte.ly", - "TERMS_N_CONDITION" : "terms & conditions", - "REGISTER_TRIAL_ACCOUNT" : "Register Trial Account" - }, - "product" : { - "MAGNETO_V1" : "Magento v1.0+", - "MAGNETO_V2" : "Magento v2.0+", - "SHOPIFY_V1" : "Shopify v1.0+" - }, - "common": { - "READ_MORE": "Read more", - "ACTIVE_PLAN": "Active Plan", - "ENTERPRISE": "ENTERPRISE", - "CONTACT": "Contact", - "DOWNLOAD" : "Download", - "UPLOAD" : "Upload", - "DEMO" : "Demo", - "SUBMIT" : "Submit", - "CANCEL" : "Cancel", - "OK" : "Ok", - "PAY" : "Pay" - }, - "chart":{ - "ORDER_ANALYTICS_HEATMAP" : "Order Analytics Heatmap", - "ORDER_ANALYTICS_HEATMAP_DESC" : "This chart shows difference between total order count, customer, amount and quantity of every 1 hour for 24x7.", - "REVENUE_RATION_ANALYSIS" : "Revenue Ratio Analysis", - "REVENUE_RATION_ANALYSIS_DESC" : "This chart shows revenue details based on Products and Categories", - "DATA_BUBBLE_COMPARISON" : "Data Bubble Comparison", - "DATA_BUBBLE_COMPARISON_DESC" : "This chart shows Orders details based on products, categories, country, state and city", - "ORDER_PATTERN_ANALYSIS" : "Order Pattern Analysis", - "ORDER_PATTERN_ANALYSIS_DESC" : "Showing Top order products details, we can search the product orders by search component." - }, - "placeholder":{ - "EMAIL" : "Email", - "PASSWORD" : "Password", - "CONFIRM_PASSWORD" : "Confirm Password", - "FULL_NAME" : "Full Name", - "FIRST_NAME" : "First Name", - "LAST_NAME" : "Last Name", - "PHONE_NUMER" : "Phone Number", - "PHONE" : "Phone", - "MESSAGE" : "Message" - }, - "shopify_payment_dialog": { - "PAYMENT" : "Payment", - "PAYMENT_MSG" : "Sorry, You can't do any payment from here...", - "PAYMENT_MSG1" : "Please make payment through your store " - }, - "layout" : { - "COOKIE_MSG" : "This site uses cookies. We use cookies to ensure you get the better experience.", - "PRIVACY_LINK_MSG" : "Find Out More.", - "GOT_IT" : "Got It", - "TRY_INTERLY_WEB" : "Try Intely Web", - "PRODUCTS" : "Products", - "PRICING" : "Pricing", - "WELCOME" : "Welcome,", - "SETTINGS" : "Settings", - "LOGOUT" : "Logout", - "PROFILE" : "Profile", - "PLANS" : "Plans", - "ACCESS_CONTROLE" : "Access Control", - "TEMPLATE" : "Template", - "NOTIFICATIONS" : "Notifications", - "INTELY_HEADING" : "Inte.ly", - "ABOUT" : "About", - "SUPPORT" : "Support", - "FAQ" : "FAQ", - "COPYRIGHT_TEXT" : "Copyright © 2019 All rights reserved.
Magento & Magento Logo is a registered trademark of Magento Inc (owned by Adobe Systems Inc, USA).
Shopify & Shopify logo is a registered trademark of Shopify Inc - Canada.
We use their logos under fair usage policy for representative purposes only.", - "TERMS_&_SERVICES" : "Privacy Policy & Terms of service", - "RESOURCES" : "Resources", - "DEVELOPERS" : "Developers", - "COMMUNITY" : "Community", - "DOCUMENTATION" : "Documentation" - }, - "notification" : { - "SELECT_THE_PRODUCT" : "Please select the product.", - "FROM_DATE" : "Please select from date.", - "TO_DATE" : "Please select to date.", - "SELECT_THE_STATUS" : "Please select the status.", - "ACTIVE" : "Active", - "IN_ACTIVE" : "In Active", - "NOTIFICATION_VALIDATION" : "Notification Message is required", - "NOTIFICATION_MSG" : "Notification Message", - "FROM_DT" : "From Date", - "TO_DT" : "To Date", - "STATUS" : "Status", - "PRODUCT" : "Product", - "ACTIONS" : "Actions", - "NO_NOTIFICATION_MSG" : "No Notification Message Available." - }, - "pricing": { - "CREDIT_CARD_REQUIRED" : "Credit card not required during trial period" - }, - "products":{ - "SHOPIFY_TXT" : "Easy and fast set up of a very beautiful and responsive store.", - "MAGNETO1_TXT" : "Marketing, Promotions, and Conversion Tools. Catalog Management", - "MAGNETO2_TXT" : "Open and flexible architecture. Experience Commerce without Limits" - }, - "settings":{ - "SUBSCRIBED_PLAN" : "You are now Subscribed to plan {{selected_plan_name}} and Expiry Date is {{expiration_date}} ", - "ACTIVE_PLAN_EXPIRED" : "Your Active plan has been Expired.", - "RENEWAL_NOW" : "Renewal Now", - "API_KEY_VALIDATION" : "API key is required", - "SECRET_KEY_VALIDATION" : "Secret Key is required", - "REGENERATE" : "Regenerate", - "SUBSCRIBED_PLAN_N_EXPIRY_DATE" : "You are now Subscribed to plan {{selected_plan_name}} and Expiry Date is {{expiration_date}} ", - "FULL_NAME_VALIDATION" : "Full Name is required", - "ADDRESS" : "Address", - "API_KEY_PLACEHOLDER" : "Api key", - "SECRET_KEY_PLACEHOLDER" : "Secret Key", - "UPDATE" : "Update", - "API_KEY" : "API KEY", - "SECRET_KEY" : "SECRET KEY", - "OLD_PASSWORD" : "Old Password", - "OLD_PASSWORD_REQUIRED" : "Old Password is required", - "NEW_PASSWORD" : "New Password", - "NEW_PASSWORD_VALIDATION" : "New Password is required", - "NEW_PASSWORD_VALIDATION1" : "New Password must be at least 6 characters long.", - "PASSWORD_MATCHED" : "Old and New both passwords are same.", - "CONFIRM_NEW_PASSWORD" : "Confirm New Password", - "CONFIRM_NEW_PASSWORD_VALIDATION" : "Confirm Password is required", - "CONFIRM_NEW_PASSWORD_VALIDATION1" : "Confirm Password does not match", - "SUBSCRIBED_MODULE" : "Subscribed Module", - "EXPIRATION_ALERT" : "Your Active plan Expires on {{expiration_date}} ", - "SUBSCRIBED_PLAN_NAME" : "You are currently subscribed to Plan {{selected_plan_name}}", - "UPDATE_TO_PRO" : "Upgrade to pro", - "LAST_ACTIVATED" : "Last Activated:", - "EXPIRATION_MSG" : "Your Active Plan has been  Expired", - "NO_ACTIVE_INSTALLATIONS" : "No Active Installations Found" - }, - "templates" : { - "TEMPLATE" : "Templates", - "CREATIVE_AMAZING_AWESOME_N_UNIQUE" : "Creative, amazing, awesome and unique", - "TEMPLATE_VALIDATION" : "Template Content is required" - }, - "try":{ - "INTELY_DEMO" : "Intely Demo", - "bubble":{ - "Products", - "Categories", - "Country", - "States", - "Cities", - "Customers", - "Months", - "Weeks", - "Quarters", - "Orders", - "Quantity", - "Revenue", - "Returns", - "No Products" - }, - }, - - "termsnservices" : { - "INTELY_TERMS_OF_SERVICE" : "INTELY Terms of Service", - "1_TERMS" : "1. Terms", - "TERM_TXT1" : "By accessing the website at", - "TERM_TXT2" : ", you are agreeing to be bound by these terms of service, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from using or accessing this site. The materials contained in this website are protected by applicable copyright and trademark law.", - "2_LICENSE" : "2. Use License", - "LICENSE_TXT1" : "Permission is granted to temporarily download one copy of the materials (information or software) on INTELY’s website for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license, you may not:", - "LICENSE_TXT2" : "modify or copy the materials;", - "LICENSE_TXT3" : "use the materials for any commercial purpose, or for any public display (commercial or non-commercial);", - "LICENSE_TXT4" : "attempt to decompile or reverse engineer any software contained on INTELY’s website;", - "LICENSE_TXT5" : "remove any copyright or other proprietary notations from the materials; or", - "LICENSE_TXT6" : "transfer the materials to another person or “mirror” the materials on any other server.", - "LICENSE_TXT7" : "This license shall automatically terminate if you violate any of these restrictions and may be terminated by INTELY at any time. Upon terminating your viewing of these materials or upon the termination of this license, you must destroy any downloaded materials in your possession whether in electronic or printed format.", - "3_DISCLAIMER" : "3. Disclaimer", - "DISCLAIMER_TXT1" : "The materials on INTELY’s website are provided on an ‘as is’ basis. INTELY makes no warranties, expressed or implied, and hereby disclaims and negates all other warranties including, without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights.", - "DISCLAIMER_TXT2" : "Further, INTELY does not warrant or make any representations concerning the accuracy, likely results, or reliability of the use of the materials on its website or otherwise relating to such materials or on any sites linked to this site.", - "4_LIMITATIONS" : "4. Limitations", - "LIMITATIONS_TXT" : "In no event shall INTELY or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption) arising out of the use or inability to use the materials on INTELY’s website, even if INTELY or a INTELY authorized representative has been notified orally or in writing of the possibility of such damage. Because some jurisdictions do not allow limitations on implied warranties, or limitations of liability for consequential or incidental damages, these limitations may not apply to you.", - "5_ACCURACY_OF_MATERIALS" : "5. Accuracy of materials", - "MATERIALS_TXT" : "The materials appearing on INTELY’s website could include technical, typographical, or photographic errors. INTELY does not warrant that any of the materials on its website are accurate, complete or current. INTELY may make changes to the materials contained on its website at any time without notice. However INTELY does not make any commitment to update the materials.", - "6_LINKS" : "6. Links", - "LINKS_TEXT" : "INTELY has not reviewed all of the sites linked to its website and is not responsible for the contents of any such linked site. The inclusion of any link does not imply endorsement by INTELY of the site. Use of any such linked website is at the user’s own risk.", - "7_MODIFICATIONS" : "7. Modifications", - "MODIFICATIONS_TXT" : "INTELY may revise these terms of service for its website at any time without notice. By using this website you are agreeing to be bound by the then current version of these terms of service.", - "8_GOVERNING_LAW" : "8. Governing Law", - "GOVERNING_LAW_TXT" : "These terms and conditions are governed by and construed in accordance with the laws of TamilNadu, India, and you irrevocably submit to the exclusive jurisdiction of the courts in that State or location.", - "PRIVACY_POLICY" : "

Privacy Policy

Your privacy is important to us. It is our policy to respect your privacy regarding any data we may collect from you across our website (inte.ly), across other sites we own and operate, and throughout your engagement with us.

What we collect/request

When you visit our sites, we automatically collect analytics and log data from your web browser & ecommerce store. This data includes Product information, Product Categories, Order Values in your local currency, Unique ID of customers as per your platform. We do not collect or read or store your customers contact information or name or address. We may read your customer’s country, state/province information alone for analytical representation purposes only. your IP address, browser type and version, time and date, the pages you view, and other details about your visit.

When you contact us, we ask for some basic information about you, like your name and email address. This information is considered personally identifying. We ask for it specifically to know who we’re talking to.

When you work with us, we ask for information about your business, operations, customers and audience. While you make most of this information publicly available, we may also ask for confidential information to assist us with ensuring the best possible outcome for our work with you.

Our legal bases for processing

We process information lawfully, fairly and transparently. We only collect and process information about you only where we have legal bases for doing so. As a digital agency, this means we collect and use your information only where:

When you consent to our use of information about you for a specific purpose, you have the right to change your mind at any time, but this won’t affect any processing we’ve already done.

We retain information for our records and to facilitate subsequent dealings in future. If necessary, we may retain your personal information for our compliance with a legal obligation or in order to protect your vital interests or the vital interests of another natural person.

While we retain this information, we’ll protect it within commercially acceptable means to prevent loss and theft, as well as unauthorised access, disclosure, copying, use or modification. That said, we advise that no method of electronic transmission or storage is 100% secure and cannot guarantee absolute data security.

How we collect and use information

We collect, hold, use and disclose information for the following purposes:

We don’t publicly disclose any data specifics, but may compile and share aggregated and anonymised versions of this information, for example, in business performance reports.

If you are a (current or former) client or partner, we may use your details contact you via our newsletter, keeping you up-to-date on what’s happening at INTELY You are free to opt out of this correspondence at any time, using the “unsubscribe” link provided in the emails.

Disclosure of personal information to third parties

INTELY is supported by third-party providers to facilitate the provision of a transactional website. These include DNS management, web hosting, payment processing (Stripe) and Google Analytics.

We will comply with government and law enforcement requests for data, as required by law, in connection with any actual or prospective legal proceedings, or in order to establish, exercise or defend our legal rights.

We do not sell or rent your personal information to marketers or third parties.

International transfers of personal information

The data we retain is stored and processed in Australia, USA, Singapore, India and Malta, and/or where we and our third-party providers maintain facilities. By providing us with your personal information, you consent to the disclosure to these overseas third parties.

Your rights as our user

Choice and consent: By providing your information to us, you consent to us collecting, holding, using and disclosing it according to this privacy policy. You are free to refuse our request for information, on the understanding that we may be unable to provide you with some services as a result. If you’re under 16 years of age, you must supply evidence of your parent or legal guardian’s knowledge and permission of you providing us with information.

Information from third parties: If we receive information about you from a third party, we’ll protect it as set out in this privacy policy. If you are a third party providing information about somebody else (eg. an agency operating on behalf of a client), you represent and warrant that you have that person rsquo;s consent to provide their information to us.

Restrict: You may choose to restrict the collection or use of your personal information by contacting us via our website. If you ask us to restrict or limit how we process your personal information, we will let you know how the restriction affects your use of our website or products and services.

Access and data portability: You may request details or a copy of the personal information we hold about you. You may request that we erase the personal information we hold about you at any time. You may also request that we transfer this personal information to another third party.

Correction: If you believe that any information we hold about you is inaccurate, out of date, incomplete, irrelevant or misleading, please contact us via our website, and we will take reasonable steps to update our records.

Notification of data breaches: We will comply with laws applicable to us in respect of any data breach.

Complaints: If you believe that we have breached a relevant data protection law and wish to make a complaint, please contact us via our website, providing us with full details. We’ll investigate your complaint and respond to you, in writing, setting out the outcome of our investigation and the steps we’ll take to deal with your complaint. You also have the right to contact a regulatory body or data protection authority in relation to your complaint.

Unsubscribe: To unsubscribe from our email database, use the “unsubscribe” link provided in the emails we send you, or contact us via the details our website.

", - "COOKIES" : "

Cookies

A cookie is a small piece of data that our website stores on your computer, and accesses each time you visit, so we can perform certain functions and understand how you use our site. If you do not wish to accept cookies from us, you should instruct your browser to refuse cookies from inte.ly.

Business transfers

If we or our assets are acquired, or in the Bunlikely event that we go out of business or enter bankruptcy, we would include data among the assets transferred to any parties who acquire us. You acknowledge that such transfers may occur, and that any parties who acquire us may continue to use your personal information according to this policy.

About this policy

This privacy policy only covers our own collecting and handling of data. We only work with partners and third-party providers whose privacy policies align with ours, however we cannot accept responsibility or liability for their respective privacy practices.

Our website may link to external sites that are not operated by us. Please be aware that we have no control over the content and policies of those sites, and cannot accept responsibility or liability for their respective privacy practices.

At our discretion, we may update this policy to reflect current acceptable practices. We will take reasonable steps to let users know about significant changes via our website. Your continued use of this site after any changes to this policy will be regarded as acceptance of our practices around data and personal information.

If you have any concerns or questions about how we handle your data and personal information, feel free to contact us via our contact page.

This policy is effective as of 28 December 2018.

" + "HEADER_TEXT": "You are on Testnet", + "COUNTDOWN": "Mainnet Countdown", + "EXPLORE_IT": "Explore it", + "VIEWALL": "View All Charts", + "BLOCKCHAIN_HEIGHT": "Blockchain Height", + "LATEST_BLOCK": "Latest Block", + "LATEST_BLOCK1": "Latest Block Difficulty & Extensions", + "COIN_IN": "Coins in Existence", + "HEIGHT": "Height", + "HASH": "Hash", + "AGE": "Age", + "FEE": "Fee", + "DIFFICULTY" : "Difficulty", + "POW_ALGO" : "Pow Algo", + "INPUTS" : "Inputs", + "OUTPUTS" : "Outputs", + "KERNELS" : "Kernels", + "EPIC" : "Epic", + "EXPLORE" : "Explore", + "AGO" : "ago", + "MINUTE" : "minute", + "TOTAL_DIFFICULTY" : "Total Difficulty", + "TRANSACTIONS_BY_TIME" : "Transcations By Time", + "BLOCKS" : "Blocks", + "BLOCK" : "Block", + "BLOCKS_MINED" : "Blocks Mined", + "TRANSACTION_FEES" : "Transcation Fees", + "SUPPLY_GROWTH" : "Supply Growth", + "HASHRATE_GROWTH_CHART" : "HashRate Growth Chart", + "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" + } -} \ No newline at end of file +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6764e78..ace121b 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,30 +3,40 @@ import { NgModule } from '@angular/core'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; -import { HttpClientModule, HttpClient } from '@angular/common/http'; +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 { NotFoundComponent } from './view/home/not-found/not-found.component'; import { Observable, of } from 'rxjs'; import { map, catchError } from 'rxjs/operators'; -export class CustomLoader implements TranslateLoader { +export class CustomLoader extends ChartService implements TranslateLoader { apiHost: string; - constructor(private http: HttpClient ) { + constructor(public http: HttpClient ) { + super(http) } - public getTranslation(lang: String): Observable { + public getTranslation(lang): Observable { - return this.http.get(this.apiHost+'/Translation?lang='+lang).pipe( + // 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( map((res: any) => { console.log("Data got: "); console.log(res); return res; }) - ); - + ); } } @@ -49,7 +59,10 @@ export class CustomLoader implements TranslateLoader { } }) ], - providers: [TransServiceService,CookieService], + providers: [TransServiceService,CookieService,ChartService], bootstrap: [AppComponent] }) -export class AppModule { } +export class AppModule { + constructor( ) { + } +} diff --git a/src/app/shared/services/chart.service.ts b/src/app/shared/services/chart.service.ts index edc333f..8dfc86b 100644 --- a/src/app/shared/services/chart.service.ts +++ b/src/app/shared/services/chart.service.ts @@ -16,7 +16,7 @@ export class ChartService { private server = environment.domain; private socket; - constructor(private http: HttpClient) {} + constructor(public http: HttpClient) {} public createSocketConnection() { this.socket = io.connect(this.server); diff --git a/src/app/shared/services/trans-service.service.ts b/src/app/shared/services/trans-service.service.ts index 43a0eef..822303d 100644 --- a/src/app/shared/services/trans-service.service.ts +++ b/src/app/shared/services/trans-service.service.ts @@ -9,11 +9,11 @@ export class TransServiceService{ public langLabel: any = {}; constructor(public translate : TranslateService,private cookie: CookieService) { - translate.addLangs(['en', 'es']); + translate.addLangs(['en', 'de']); translate.setDefaultLang('en'); - this.langLabel = {en: 'English', es: 'Spanish'}; + this.langLabel = {en: 'English', es: 'German'}; // console.log('this.getCookie() ifconf',this.getCookie() != 'undefined' ? 1: 2); - console.log("(this.getCookie() && this.getCookie() != null) ? this.getCookie() : (this.getCurrentLang() && this.getCurrentLang() != null) ? this.getCurrentLang() : 'en'",(this.getCookie() && this.getCookie() != 'undefined') ? this.getCookie() : (this.getCurrentLang() && this.getCurrentLang() != 'undefined') ? this.getCurrentLang() : 'en'); + // console.log("(this.getCookie() && this.getCookie() != null) ? this.getCookie() : (this.getCurrentLang() && this.getCurrentLang() != null) ? this.getCurrentLang() : 'en'",(this.getCookie() && this.getCookie() != 'undefined') ? this.getCookie() : (this.getCurrentLang() && this.getCurrentLang() != 'undefined') ? this.getCurrentLang() : 'en'); translate.use((this.getCookie() && this.getCookie() != 'undefined') ? this.getCookie() : (this.getCurrentLang() && this.getCurrentLang() != 'undefined') ? this.getCurrentLang() : 'en'); this.setCookie(this.getCurrentLang());