Skip to content

Commit 2f12e71

Browse files
committed
fix: 🐛 predavetranslation should always be flat
Closes: #145
1 parent e963ae3 commit 2f12e71

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

projects/ngneat/transloco/src/lib/transloco.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,10 @@ export class TranslocoService implements OnDestroy {
311311
...flattenScopeOrTranslation
312312
};
313313

314-
const withHook = this.interceptor.preSaveTranslation(mergedTranslation, currentLang);
315-
const flattenTranslation = this.mergedConfig.flatten.aot ? withHook : flatten(withHook);
314+
const flattenTranslation = this.mergedConfig.flatten.aot ? mergedTranslation : flatten(mergedTranslation);
315+
const withHook = this.interceptor.preSaveTranslation(flattenTranslation, currentLang);
316316

317-
this.translations.set(currentLang, flattenTranslation);
317+
this.translations.set(currentLang, withHook);
318318
mergedOptions.emitChange && this.setActiveLang(this.getActiveLang());
319319
}
320320

0 commit comments

Comments
 (0)