huridocs/uwazi

View on GitHub
app/api/i18n.v2/services/GetTranslationsService.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { TranslationsDataSource } from '../contracts/TranslationsDataSource';

export class GetTranslationsService {
  private translationsDS: TranslationsDataSource;

  constructor(translationsDS: TranslationsDataSource) {
    this.translationsDS = translationsDS;
  }

  getByLanguage(language: string) {
    return this.translationsDS.getByLanguage(language);
  }

  getByContext(context: string) {
    return this.translationsDS.getByContext(context);
  }

  getAll() {
    return this.translationsDS.getAll();
  }
}