<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/one-validator-to-rule-them-all-part-2-advanced-error-handling-with-multi-language-support--jn643soyi" -->

---
title: One Validator to Rule Them All — Part 2: Advanced Error...
description: A detailed follow-up tutorial builds multilingual, structured error handling on top of an Angular + Zod + NestJS validation setup. It introduces custom...
canonical: https://daily.dev/posts/one-validator-to-rule-them-all-part-2-advanced-error-handling-with-multi-language-support--jn643soyi
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: One Validator to Rule Them All — Part 2: Advanced Error Handling with multi-language support. | daily.dev
og:description: A detailed follow-up tutorial builds multilingual, structured error handling on top of an Angular + Zod + NestJS validation setup. It introduces custom...
og:url: https://daily.dev/posts/one-validator-to-rule-them-all-part-2-advanced-error-handling-with-multi-language-support--jn643soyi
og:image: https://api.daily.dev/og/posts/jN643SOyI.png
og:image:alt: One Validator to Rule Them All — Part 2: Advanced Error Handling with multi-language support.
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# One Validator to Rule Them All — Part 2: Advanced Error Handling with multi-language support.

**[Angular.love](https://daily.dev/sources/angularlove)** · 16 min read · 0 upvotes · 0 comments

## Summary

A detailed follow-up tutorial builds multilingual, structured error handling on top of an Angular + Zod + NestJS validation setup. It introduces custom errorCode metadata in Zod schemas, a framework-agnostic error-transformer that converts Zod issues into translatable {key, params} tokens, and two Angular pipes (zodTransformFirst, zodTransformAll) that bridge Signal Forms errors and Zod issues into a shared IssueLike shape. It also covers the challenge of Transloco's static key extraction with dynamic keys, solved via Transloco's marker() escape hatch, and notes the remaining limitation that Angular's standardSchema error kind doesn't expose which specific rule failed at the control level.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://angular.love/one-validator-to-rule-them-all-part-2-advanced-error-handling-with-multi-language-support>

## Questions this post answers

### How do I generate translation keys for Zod validation errors so Transloco's key extractor can find them when the keys are built dynamically at runtime?

Use Transloco's marker() function as a no-op escape hatch: list every possible key literal inside a marker() call assigned to a discarded variable, such as marker('login.password.need_number'). The extractor performs static analysis and picks up these literals, adding them to language files, while the actual template can keep using dynamic token.key values from the transformer without breaking at runtime.

_daily.dev surfaces practical i18n patterns like this for developers wiring up form validation._

### How can I show a stable, translatable error code for a custom Zod validator instead of relying on the generic 'custom' code?

Add an extra errorCode field inside ctx.addIssue alongside the existing code and message fields, for example errorCode: 'need_number'. The message stays for backend logs and API consumers, while errorCode becomes the frontend's stable identifier for building a namespaced translation key like login.password.need_number, decoupling translation from the shared validation schema.

_daily.dev helps developers compare validation patterns before locking in a schema design._

### Why do all error messages appear at once when I list separate hlm-field-error blocks for each Zod validator in an Angular signal form template?

Every schema-driven error returned by errors() shares the same kind: 'standardSchema', so Angular's validateStandardSchema funnels all failing rules through one opaque kind rather than giving each rule its own key to branch on. Writing static literal keys per validator makes the translation extractor happy but breaks the UX, since the template can't structurally distinguish which specific rule failed at the control level.

_daily.dev is a good place to track form-validation quirks like this before they hit production._

## Similar posts on daily.dev

- [Zod \+ TypeScript: Schema Validation Made Easy – Frontend Masters Blog](https://daily.dev/posts/zod-typescript-schema-validation-made-easy-frontend-masters-blog-yv5epna6v) · Frontend Masters · 0 upvotes · 0 comments
- [How to Build Type-Safe APIs with Hono and Zod](https://daily.dev/posts/how-to-build-type-safe-apis-with-hono-and-zod-0aku3long) · freeCodeCamp · 1 upvotes · 0 comments
- [Stop fighting forms: The schema-driven approach to validation](https://daily.dev/posts/stop-fighting-forms-the-schema-driven-approach-to-validation-8vq511w0o) · LogRocket · 1 upvotes · 0 comments
- [LLM Structured Output with JSON Schema in TypeScript](https://daily.dev/posts/llm-structured-output-with-json-schema-in-typescript-wj1wernyh) · SitePoint · 5 upvotes · 2 comments
- [Seven cool JavaScript libraries You should know about](https://daily.dev/posts/seven-cool-javascript-libraries-you-should-know-about-32pqekrej) · Neciu Dan · 25 upvotes · 3 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#angular](https://daily.dev/tags/angular), [#zod](https://daily.dev/tags/zod)

[View this post on daily.dev](https://daily.dev/posts/one-validator-to-rule-them-all-part-2-advanced-error-handling-with-multi-language-support--jn643soyi)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"One Validator to Rule Them All — Part 2: Advanced Error Handling with multi-language support.","url":"https://daily.dev/posts/one-validator-to-rule-them-all-part-2-advanced-error-handling-with-multi-language-support--jn643soyi","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/one-validator-to-rule-them-all-part-2-advanced-error-handling-with-multi-language-support--jn643soyi"},"datePublished":"2026-09-20T07:44:35.612Z","dateModified":"2026-09-20T07:50:36.091Z","description":"A detailed follow-up tutorial builds multilingual, structured error handling on top of an Angular + Zod + NestJS validation setup. It introduces custom...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/85ee85213d2ee1546ae9adc2eba8c36c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/85ee85213d2ee1546ae9adc2eba8c36c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Angular.love","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Angular.love","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/b638946cd9c74bf6a260e4e6a40212d7","url":"https://daily.dev/sources/angularlove"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/one-validator-to-rule-them-all-part-2-advanced-error-handling-with-multi-language-support--jn643soyi","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,angular,zod","timeRequired":"PT16M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Angular.love","item":"https://daily.dev/sources/angularlove"},{"@type":"ListItem","position":3,"name":"One Validator to Rule Them All — Part 2: Advanced Error Handling with multi-language support."}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/one-validator-to-rule-them-all-part-2-advanced-error-handling-with-multi-language-support--jn643soyi#faq","mainEntity":[{"@type":"Question","name":"How do I generate translation keys for Zod validation errors so Transloco's key extractor can find them when the keys are built dynamically at runtime?","acceptedAnswer":{"@type":"Answer","text":"Use Transloco's marker() function as a no-op escape hatch: list every possible key literal inside a marker() call assigned to a discarded variable, such as marker('login.password.need_number'). The extractor performs static analysis and picks up these literals, adding them to language files, while the actual template can keep using dynamic token.key values from the transformer without breaking at runtime. daily.dev surfaces practical i18n patterns like this for developers wiring up form validation."}},{"@type":"Question","name":"How can I show a stable, translatable error code for a custom Zod validator instead of relying on the generic 'custom' code?","acceptedAnswer":{"@type":"Answer","text":"Add an extra errorCode field inside ctx.addIssue alongside the existing code and message fields, for example errorCode: 'need_number'. The message stays for backend logs and API consumers, while errorCode becomes the frontend's stable identifier for building a namespaced translation key like login.password.need_number, decoupling translation from the shared validation schema. daily.dev helps developers compare validation patterns before locking in a schema design."}},{"@type":"Question","name":"Why do all error messages appear at once when I list separate hlm-field-error blocks for each Zod validator in an Angular signal form template?","acceptedAnswer":{"@type":"Answer","text":"Every schema-driven error returned by errors() shares the same kind: 'standardSchema', so Angular's validateStandardSchema funnels all failing rules through one opaque kind rather than giving each rule its own key to branch on. Writing static literal keys per validator makes the translation extractor happy but breaks the UX, since the template can't structurally distinguish which specific rule failed at the control level. daily.dev is a good place to track form-validation quirks like this before they hit production."}}]}
```

