title: Failed to initialize Translation Service Error - Angular
body: <p>I am trying to run test cases for my application. I have used i18n service which I have used for my component for translation purpose. When trying to run the code it gives <code>ERROR: Failed to initialize translation service</code>. </p>
  
  <p>Here is my code for <code>model.ts file</code></p>
  
  <pre><code>export class Model {
  
    constructor() {}
  
    public get tableModel(): TableModel {
      return this._tableModel;
    }
  
    public async initTranslationService(): Promise&lt;boolean&gt; {
      return await this.initTranslation();
    }
  
  
    public initTranslation(): Promise&lt;boolean&gt; {
      return new Promise((resolve, reject) =&gt; {
        labelsArr.forEach((labelVal) =&gt; {
          promiseArr.push(this.translateService.stream(labelVal[9]));
        });
  
        Run(promiseArr).subscribe((results) =&gt; {
          if (this.translateService.getData().length &gt;= 1) {
            results.forEach((labelTranslation, i) =&gt; {
            //some logic
            });
            resolve(true);
          } else {
            console.error('Failed to initialise translation service');
            resolve(false);
          }
        });
      });
    }
  
  
  }
  </code></pre>
  
  <p>I need help trying to solve this error. I have tried to look into and try to solve this error by making changes in <code>initTranslation  function</code>. But I am not sure what is the issue. Any suggestions are appreciated. Thanks</p>