feature: localization's first implmentation
This commit is contained in:
14
backend/src/modules/auth/dto/update-language.dto.ts
Normal file
14
backend/src/modules/auth/dto/update-language.dto.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsIn, IsString } from 'class-validator';
|
||||
|
||||
export const SUPPORTED_USER_LANGUAGES = ['en', 'fa', 'nl'] as const;
|
||||
export type SupportedUserLanguage = (typeof SUPPORTED_USER_LANGUAGES)[number];
|
||||
|
||||
export class UpdateLanguageDto {
|
||||
@ApiProperty({ enum: SUPPORTED_USER_LANGUAGES, example: 'en' })
|
||||
@IsString()
|
||||
@IsIn(SUPPORTED_USER_LANGUAGES, {
|
||||
message: 'Language must be one of: en, fa, nl',
|
||||
})
|
||||
language: SupportedUserLanguage;
|
||||
}
|
||||
Reference in New Issue
Block a user