NestJS is a robust framework for building server-side applications, particularly effective for large-scale projects. This guide introduces the `nestjs-i18n` library for simplifying localization in NestJS applications. Key steps include setting up `nestjs-i18n`, moving hard-coded strings to translation files, loading these files correctly, injecting i18n contexts and services, determining active locales, and adding type safety. The guide also covers translating database data, handling dynamic and plural values in translations, and localizing DTO validation messages.

33m read timeFrom phrase.com
Post cover image
Table of contents
Our demoHow do I localize my Nest app?How do I set up nestjs-i18n?How do I localize controllers and services?How do I load translation files?How do I resolve the active locale?How do I redirect while keeping the active locale?How do I make my message keys type-safe?How do I translate basic text?How do I include dynamic values in translations?How do I work with localized plurals?How do I localize the database?How do I localize DTO validation messages?Upgrade your Nest localization
1 Comment

Sort: