Skip to content

Conversation

maleetz
Copy link

@maleetz maleetz commented Aug 19, 2025

This allows developers using the TranslocoTestingModule to pass other options for missingHandler without duplicating the logMissingKey config already provided

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

If you try to pass { allowEmpty: true } as the missingHandler configuration for the testing module you will get the below typescript error, which requires developers to pass all properties of the missingHandler object. This type definition differs from older versions of transloco which only required a partial missingHandler object: https://github.com/jsverse/transloco/blob/transloco-3.2.0/libs/transloco/src/lib/transloco.config.ts#L14

Type '{ allowEmpty: true; }' is missing the following properties from type '{ logMissingKey: boolean; useFallbackTranslation: boolean; allowEmpty: boolean; }': logMissingKey, useFallbackTranslationts(2739)
transloco.config.ts(15, 3): The expected type comes from property 'missingHandler' which is declared here on type 'Partial<TranslocoConfig>'

What is the new behavior?

You can now pass a DeepPartial of the transloco configuration to the TranslocoTestingModule and default values will be applied by the library, which is consistent with the developer experience in the library API.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

This allows developers using the TranslocoTestingModule to pass other
options for missingHandler without duplicating the logMissingKey config
already provided
Copy link

pkg-pr-new bot commented Aug 19, 2025

Open in StackBlitz

@jsverse/transloco

npm i https://pkg.pr.new/@jsverse/transloco@865

@jsverse/transloco-locale

npm i https://pkg.pr.new/@jsverse/transloco-locale@865

@jsverse/transloco-messageformat

npm i https://pkg.pr.new/@jsverse/transloco-messageformat@865

@jsverse/transloco-optimize

npm i https://pkg.pr.new/@jsverse/transloco-optimize@865

@jsverse/transloco-persist-lang

npm i https://pkg.pr.new/@jsverse/transloco-persist-lang@865

@jsverse/transloco-persist-translations

npm i https://pkg.pr.new/@jsverse/transloco-persist-translations@865

@jsverse/transloco-preload-langs

npm i https://pkg.pr.new/@jsverse/transloco-preload-langs@865

@jsverse/transloco-scoped-libs

npm i https://pkg.pr.new/@jsverse/transloco-scoped-libs@865

@jsverse/transloco-utils

npm i https://pkg.pr.new/@jsverse/transloco-utils@865

@jsverse/transloco-validator

npm i https://pkg.pr.new/@jsverse/transloco-validator@865

commit: 6728ce4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant