title: how to have dynamic translation in spartacus?
body: <p>I am using Spartacus 4.2 . I want to serve translations using my own custom endpoint. I am making the api call using APP_INITIALIZER token. My question is how will I set the result in provideConfig(). Or is there any other approach to serve translations dynamically?
  I want to update mytranslationsEN when I have response from the api.</p>
  <p><strong>spartacus-configuration.module.ts</strong></p>
  <pre><code>import { HttpClient } from '@angular/common/http';
  import { APP_INITIALIZER, NgModule } from '@angular/core';
  import { translationChunksConfig, translations } from '@spartacus/assets';
  import {
   FeaturesConfig,
   I18nConfig,
   OccConfig,
   provideConfig,
   SiteContextConfig,
   TranslationResources,
   } from '@spartacus/core';
  import {
   defaultCmsContentProviders,
   layoutConfig,
   mediaConfig,
  } from '@spartacus/storefront';
  import { Observable } from 'rxjs';
  import { tap } from 'rxjs/operators';
  
  import { mytranslationsfr } from 'src/assets/translations/fr/index.fr';
  
  export let mytranslationsEN: TranslationResources = {}; 
  
  
  
  function initializeAppFactory(httpClient: HttpClient): () =&gt; Observable&lt;any&gt; {
    return () =&gt; httpClient.get('http://localhost:3000/translations')
     .pipe(
       tap(translations =&gt; { 
        mytranslationsEN= {
                  product:{...translations}
                };
       })
      
      );
    }
  
  
  
   @NgModule({
     declarations: [],
     imports: [],
   providers: [
    {
      provide: APP_INITIALIZER,
      useFactory: initializeAppFactory,
      deps: [HttpClient],
      multi: true,
    },
   provideConfig(layoutConfig),
   provideConfig(mediaConfig),
   ...defaultCmsContentProviders,
   provideConfig(&lt;OccConfig&gt;{
    backend: {
      occ: {
        baseUrl: 'https://localhost:9002',
      },
    },
  }),
  provideConfig(&lt;SiteContextConfig&gt;{
    context: {
      urlParameters: ['baseSite', 'language', 'currency'],
      baseSite: ['apparel-uk-spa'],
    },
  }),
  provideConfig(&lt;SiteContextConfig&gt;{
    context: {
      currency: ['GBP'],
      language: ['en'],
    },
  }),
  provideConfig(&lt;I18nConfig&gt;{
    i18n: {
      resources: translations,
      chunks: translationChunksConfig,
      fallbackLang: 'en',
    },
  }),
  provideConfig(&lt;I18nConfig&gt;{
    i18n: {
      resources: {
        en: mytranslationsEN ,
        fr: mytranslationsfr,
      },
      fallbackLang: 'en',
    },
  }),
  provideConfig(&lt;FeaturesConfig&gt;{
    features: {
      level: '4.2',
      },
    }),
   ],
  })
  export class SpartacusConfigurationModule {}
  </code></pre>