dev #49

Merged
JoeKung merged 12 commits from dev into main 2026-03-21 18:57:57 +01:00
2 changed files with 8 additions and 4 deletions
Showing only changes of commit 41f36ed18a - Show all commits

View File

@@ -14,7 +14,10 @@ type SupportedLang = 'it' | 'en' | 'de' | 'fr';
const FALLBACK_LANG: SupportedLang = 'it'; const FALLBACK_LANG: SupportedLang = 'it';
const translationCache = new Map<SupportedLang, Promise<TranslationObject>>(); const translationCache = new Map<SupportedLang, Promise<TranslationObject>>();
const translationLoaders: Record<SupportedLang, () => Promise<TranslationObject>> = { const translationLoaders: Record<
SupportedLang,
() => Promise<TranslationObject>
> = {
it: () => it: () =>
import('../../../assets/i18n/it.json').then( import('../../../assets/i18n/it.json').then(
(module) => module.default as TranslationObject, (module) => module.default as TranslationObject,
@@ -51,8 +54,9 @@ export class StaticTranslateLoader implements TranslateLoader {
} }
private loadTranslation(lang: SupportedLang): Promise<TranslationObject> { private loadTranslation(lang: SupportedLang): Promise<TranslationObject> {
const transferStateKey = const transferStateKey = makeStateKey<TranslationObject>(
makeStateKey<TranslationObject>(`i18n:${lang.toLowerCase()}`); `i18n:${lang.toLowerCase()}`,
);
if ( if (
isPlatformBrowser(this.platformId) && isPlatformBrowser(this.platformId) &&
this.transferState.hasKey(transferStateKey) this.transferState.hasKey(transferStateKey)

View File

@@ -273,7 +273,7 @@ export class ProductDetailComponent {
this.shopService.resolveMediaUrl(image.hero) ?? this.shopService.resolveMediaUrl(image.hero) ??
this.shopService.resolveMediaUrl(image.card) ?? this.shopService.resolveMediaUrl(image.card) ??
this.shopService.resolveMediaUrl(image.thumb) this.shopService.resolveMediaUrl(image.thumb)
); );
} }
private scheduleCartWarmup(): void { private scheduleCartWarmup(): void {