@asurraa/sura-nest-translation
v1.0.18
Published
sura-nest-translation
Downloads
36
Keywords
Readme
Installation
npm install @asurraa/sura-nest-translation
yarn add @asurraa/sura-nest-translation
- Import TranslationModule to AppModule
- Register TranslationModule with TypeormModule
import { TranslationEntity, TranslationModule } from '@asurraa/sura-nest-translation';
@Module({
imports: [
TranslationModule.register(TypeOrmModule.forFeature([TranslationEntity])),
]
})
- Import Translation to AppController
- Setup init-translation route in AppController
import { TranslationService } from '@asurraa/sura-nest-translation';
@Controller()
export class AppController {
constructor(
private readonly translationService: TranslationService,
) {}
@Post('init-translation/:secret')
initTranslation(@Param('secret') secret: string) {
return this.translationService.getInitExecution(secret, 'asurraa');
}
}
secret
is init param'asurraa'
is default secret check withsecret
Usage
the usage of sura-nest-translation
Route
translation/create
translation/update
translation/delete/:key
translation/messages/:lang
translation/original-data
translation/baseI18nDataModelData