Questions tagged [nestjs-i18n]
13 questions
11
votes
1 answer
How to modify HTTPException message in nestjs graphql exception filters?
I want to use localization in the class-validator error message in nestjs graphql. But I am unable to set the translated message in response and return that back. I have tried many solutions like response.status(400).json({....}) for sending…

Md. Moniruzzaman
- 637
- 6
- 21
3
votes
0 answers
How to use any of i18n packages in nestjs mvc?
I found this package nest-18n but that dudes thinks that nestjs is only used for api and not mvc.
So sure ?lang=en or ?lang=de works and it changes language but question is how to use that on view?
My first thought was that this is working out of…

pregmatch
- 2,629
- 6
- 31
- 68
2
votes
2 answers
No resolvers provided! nestjs-i18n won't workt properly
Package version: 10.2.1
Error:
[I18nService] No resolvers provided! nestjs-i18n won't workt properly, please follow the quick-start guide: https://nestjs-i18n.com/quick-start
Code:
@Module({
imports: [
ConfigModule.forRoot({ cache: true,…

Евгений
- 41
- 3
1
vote
0 answers
Use nestjs-i18n in a monorepo
I want to use nestjs-i18n in an monorepo project and share i18n assets between apps.
I tried with this configuration but the i18n assets are not copied to the dist directory:
"common": {
"type": "library",
"root":…

SaroVin
- 1,583
- 3
- 23
- 46
1
vote
0 answers
nestjs-i18n in DTO validation just throw bad request error
im using nestjs-i18n in my dto and it just throw bad request error instead of my error messsage.
this is my dto:
export class SignUpDto{
@ApiProperty()
@MinLength(5, {
message: i18nValidationMessage('i18n.MIN', {message: 'err'})
…

Omid Deldar
- 46
- 1
- 1
- 7
1
vote
3 answers
NestJS i18n how to inject service into I18nResolver
How can I inject a service into an nestjs-i18n I18nResolver?
The docs state that:
To implement your own resolver (or custom logic) use the I18nResolver interface. The resolvers are provided via the nestjs dependency injection, this way you can…

Code Spirit
- 3,992
- 4
- 23
- 34
1
vote
1 answer
How can I change the name of the template that is passed to the @Render decorator in the Interceptor?
How can I change the name of the template that is passed to the @Render decorator in the Interceptor? I need to add the desired locale to the template url, depending on the user's language. I'm trying to do this, but it doesn't work. How can I do…

Jenya7771
- 21
- 1
1
vote
1 answer
Nestjs and nestjs-i18n: Internationalization not working in Custom Exception Filter
I am trying to use an exception filter in my NestJS app. I have to translate my exception message into another language based on the request value. I have two languages file en and fr.
I have initialized i18N in my app.module.ts as per the…

Abhishek Chaniyara
- 429
- 3
- 13
1
vote
0 answers
nestjs-i18n blocks my local passport strategy
I am working with nestjs. I implemented i18n from the following tutorial available on the [nestjs-i18][1]n
To my surprise when I add the following configurations in the app module it messes up with my passport local strategy.
imports: [
…

Shani Mughal
- 105
- 13
1
vote
2 answers
Nest js : Use I18n service in Exception Filter
I have a nestjs-graphql project. I use class-validator and nestjs-i18n module.
I can use i18nService when injected in a service as intended. What I'm struggling to do however is to use i18n in my ExceptionFilter to return translated message from the…

Pierre_T
- 1,094
- 12
- 29
0
votes
1 answer
Global interceptor, response mapping and library specific responses in NestJS
I'm trying to use "library-specific" response objects alongside a global interceptor in NestJS, but it's not working and as I understand from the documentation, this is expected:
Response mapping:
The response mapping feature doesn't work with the…

Juan Delgado
- 2,030
- 15
- 18
0
votes
1 answer
How to setup the middleware Service in nestJs application in nestjs-i18n package to get accept-language header without error?
Hey In my nestjs application, I have installed the nestjs-i18n npm package of version 10.2.6 . I have configured this I18nModule in the appModule as below :
app.module.ts :
import { MiddlewareConsumer, Module, NestModule } from…

vijay s
- 147
- 1
- 4
- 15
0
votes
3 answers
Nest can't resolve dependencies of the I18nLanguageInterceptor
After upgrading nest to v8, I'm having problem making nestjs-i18n work.
Here's the Error I'm getting
Nest can't resolve dependencies of the I18nLanguageInterceptor (I18nOptions, I18nResolvers, I18nService, ?). Please make sure that the argument…

Wantedsystem
- 1
- 1