All files / app/transloco transloco-loader.ts

75% Statements 6/8
75% Branches 6/8
100% Functions 1/1
60% Lines 3/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19            134x   134x   134x                
import { Injectable } from '@angular/core';
import { TranslocoLoader } from '@jsverse/transloco';
 
@Injectable({
  providedIn: 'root',
})
export class TranslocoAppLoader implements TranslocoLoader {
  async getTranslation(lang: string): Promise<Record<string, unknown>> {
    switch (lang) {
      case 'de':
        return (await import('../i18n/de')).default;
      case 'en':
        return (await import('../i18n/en')).default;
      default:
        return (await import('../i18n/de')).default;
    }
  }
}