Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

207
Vistas
How to get current language with ngx-translate in angular2

I want to get current language with this.translate.getBrowserLang(), but it always return 'en', whatever the current language is and what the supported languages is.

Here is the plnkr: https://plnkr.co/edit/JEXgj8WcISYGtDg75VoR?p=preview,


maybe plnkr has broken, you can try stackblitz: https://stackblitz.com/edit/github-kk1mud-a7gxbb

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

import translate service and add in constructor

constructor(private translate: TranslateService){
}

I find it use this.translate.currentLang to get the current language

over 4 years ago · Santiago Trujillo Denunciar

0

constructor(private translate: TranslateService){}

ngOnInit() {
    this.translate.currentLang;
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda