Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

386
Views
Cambiar URL al usar ngx-translate

Estoy tratando de cambiar la URL cuando alguien hace clic en un idioma elegido usando ngx-translate. Supongo que debería hacerlo suscribiéndome a los eventos de cambio de idioma y luego modificando la URL actual para reflejar el idioma elegido. Como soy un novato, no estoy seguro si necesito un servicio para hacerlo, o puede ser otra forma de resolverlo. .

Quiero cambiar de esto:

https://amarello.cloud/es/

A esto:

https://amarello.cloud/en/

, dependiendo del idioma elegido.

Este es mi 'header.component.ts'

 import { Component, OnInit } from '@angular/core'; //For translate language import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-header', templateUrl: './header.component.html', styleUrls: ['./header.component.scss'] }) export class HeaderComponent implements OnInit { menu: boolean = false; submenu: boolean = false; submin: boolean = false; constructor(private translate: TranslateService) { translate.addLangs(['es','en']); translate.setDefaultLang('es'); } ngOnInit(): void { } open() { if (this.menu == false) { this.menu = true; } else { this.menu = false } if (this.submin == false) { this.submin = true; } else { this.submin = false } } openSub() { if (this.submenu == false) { this.submenu = true; } else { this.submenu = false } } useLanguage(language: string): void { this.translate.use(language); // this.translate.onLangChange().subscribe(trans => { // }) } }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!