File

src/app/core/translation.service.ts

Index

Methods

Constructor

constructor(translateService: TranslateService)
Parameters :
Name Type Optional
translateService TranslateService No

Methods

loadTranslations
loadTranslations(...args: any[])
Parameters :
Name Type Optional
args any[] No
Returns : void
import { Injectable } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';

@Injectable({
  providedIn: 'root',
})
export class TranslationService {
  constructor(private translateService: TranslateService) {}

  loadTranslations(...args): void {
    const locales = [...args];

    locales.forEach((locale) => {
      this.translateService.setTranslation(locale.lang, locale.data, true);
    });
  }
}

result-matching ""

    No results matching ""