@tenbox-dev/sura-nest-translation
v1.0.2
Published
<h1 align="center"> Translation</h1> <p align="center"> <b >Nest Translation module base i18n style.</b> </p>
Downloads
3
Readme
Installation
npm install @tenbox-dev/sura-nest-translation
yarn add @tenbox-dev/sura-nest-translation
- Import TranslationModule to AppModule
- Register TranslationModule with TypeormModule
import { TranslationEntity, TranslationModule } from '@tenbox-dev/sura-nest-translation';
@Module({
imports: [
TranslationModule.register(TypeOrmModule.forFeature([TranslationEntity])),
]
})
- Import Translation to AppController
- Setup init-translation route in AppController
import { TranslationService } from '@tenbox-dev/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');
}
}
xxxxx
is init param'xxxxx'
is default secret check withxxxxx
Usage
the usage of sura-nest-translation
Route
translation/create
translation/update
translation/delete/:key
translation/messages/:lang
translation/original-data
translation/baseI18nDataModelData