spartacus-storefront

Spartacus 5.2 OOTB Translation Issue


We are currently using OOTB Translations to display on our web application, but we're seeing some discrepancies between dev and staging compared to prod.

Instead of displaying the label in dev and staging, it will do the literal (i.e. [addressCard:addressCard.shipTo]).

While in prod, we are seeing: "Ship To".

I am relatively new to the team, and to Spartacus, so I'm not sure where I should look to try and resolve this (any ideas or suggestions would be great).

It's very strange because this and one other item are having similar issues in dev and staging, but not prod.

I did double-check our code base, and we are not overriding the values anywhere in our Angular application.

Sample Code:

getShippingAddressCard(deliveryAddress: Address, countryName?: string): Observable<Card> {
return combineLatest([
      this.translation.translate('addressCard.shipTo'),
    ]).pipe(
      map(([textTitle]) => {
          return {
          title: textTitle,
          textBold: deliveryAddress.firstName + ' ' + deliveryAddress.lastName,
          text: [
            deliveryAddress.line1,
            deliveryAddress.line2,
            deliveryAddress.town + ', ' + region + countryName,
            deliveryAddress.postalCode,
            this.maskService.applyMask(deliveryAddress.phone, '(000) 000-0000'),
            userEmail
          ],
        };
      })
    );
}

Solution

  • Ensure that you aren't exporting the TranslationChunksConfig with previously declared chunks - you may be essentially hiding OOTB or even your own translations if you are choosing the same names for the chunks.