Skip to content

fix(core)!: tighten TranslatePipe argument types - #1701

Open
JonataB wants to merge 1 commit into
ngx-translate:developfrom
JonataB:fix/1694-translate-pipe-types
Open

JonataB wants to merge 1 commit into
ngx-translate:developfrom
JonataB:fix/1694-translate-pipe-types

Conversation

@JonataB

@JonataB JonataB commented Nov 7, 2026 •

Copy link
Copy Markdown

#1694

Replace transform(query, ...args: any[]): any with an explicit signature:
transform(query, params?: TranslatePipeParams | null, lang?: Language | null).

▎ Out of scope: functions as parameter values
▎
▎ This PR narrows the shape of params, not the values inside it, which stay any via InterpolationParameters. So { name: name } (a signal without ()) still compiles. The default parser can't format a function, so the output is Hello {{name}} with no warning.
▎
▎ I left this out on purpose. Which values are valid depends on the configured parser, and custom parsers may accept functions. InterpolationParameters is also shared by the whole service API. A possible follow-up for the default parser is a dev-mode warning, or unwrapping signals, in a separate issue.

image

Replace `transform(query, ...args: any[]): any` with an explicit signature:
`transform(query, params?: TranslatePipeParams | null, lang?: Language | null)`.
@rbalet rbalet self-assigned this Nov 10, 2026
@rbalet rbalet added this to the v19 milestone Nov 10, 2026

This branch has not been deployed

No deployments
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.

2 participants