// core import { Component, OnInit } from '@angular/core'; import { LanguageService } from '@hdca/fe-angular-shared'; const langMappings = { // It's counter intuitive but in english should point to french and in french it should point to english en: 'Français', fr: 'English' }; @Component({ selector: 'global-footer-container', templateUrl: './global-footer.container.html' }) export class GlobalFooterContainer implements OnInit { constructor(private languageService: LanguageService) { } otherLanguageText: string; translatedURL: string; faqSectionCollapse = true; policySectionCollapse = true; hdcaSectionCollapse = true; hdcaLinks = { facebook: 'https://www.facebook.com/homedepotcanada', twitter: 'https://twitter.com/homedepotcanada', pinterest: 'https://www.pinterest.com/homedepotcanada/', youtube: 'https://www.youtube.com/homedepotcanada', mobile: 'https://www.homedepot.ca/en/home/mobile-app.html', linkedin: 'https://www.linkedin.com/company/1551117' }; ngOnInit() { const projectIdentifierTranlations = this.languageService.getProjectIdentifierTranlations(); this.otherLanguageText = langMappings[this.languageService.getLanguage()]; const projectIdentifier = this.languageService.getPath().split('/')[1]; const projectIdentifierTranslation = projectIdentifierTranlations[projectIdentifier]; this.translatedURL = this.languageService.getPath().replace(projectIdentifier, projectIdentifierTranslation); } toggleLanguage() { this.languageService.toggleLanguageForPageReload(); } }