Skip to content

Conversation

undsoft
Copy link
Contributor

@undsoft undsoft commented Mar 7, 2025

Changes

  • TranslatePipe now explicitly accepts null and undefined and returns Translation. The code already guards against falsy values and specifying it explicitly helps when used with strictNullChecks in tsconfig. Otherwise, you may get a bunch of errors when an optional or nullable field is passed to the pipe.
  • Replaced any with unknown in InterpolationParams.
  • Fixes a test on non-English machines.

@Christop406
Copy link

Would love this! Makes the pipe much easier to use in strict mode.

Copy link
Member

@CodeAndWeb CodeAndWeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
I am a fan of stricter checks anyways... :-)

@CodeAndWeb CodeAndWeb merged commit 64305da into ngx-translate:master May 16, 2025
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.

3 participants