@jiotranslate/ngx-beta
v1.0.0-beta.1
Published
Angular integration of Jiotranslate localization tool
Downloads
67
Keywords
Readme
What's Jiotranslate for Angular?
Angular integration library of Jiotranslate. With this package. It's super simple to add i18n to your Angular app!
Installation
npm install @jiotranslate/ngx-beta
Then use the library in your app.module.ts
. You have to add NgxJiotranslateModule
to your imports section and
add factory provider for JIOTRANSLATE_INSTANCE
token returning your Jiotranslate instance.
...
import {
DevTools,
NgxJiotranslateModule,
JioTranslate,
JIOTRANSLATE_INSTANCE,
FormatSimple
} from '@jiotranslate/ngx-beta';
...
@NgModule({
declarations: [
...
],
imports: [
NgxJiotranslateModule,
...
],
providers: [
{
provide: JIOTRANSLATE_INSTANCE,
useFactory: () => {
return JioTranslate()
.use(DevTools())
.use(FormatSimple())
.init({
language: 'en'
// for development
apiUrl: environment.jiotranslateApiUrl,
apiKey: environment.jiotranslateApiKey,
// for production
staticData: {
...
}
});
},
},
],
bootstrap: [AppComponent],
})
export class AppModule {}
Usage
Translating using pipe:
<h1>{{'hello_world' | jiotms}}</h1>
Or using t attribute
<h1 jio-tms key="providing_default_values"></h1>
Prerequisites
- An existing Angular project
- An API key obtained from Jiotranslate Platform.
Why use Jiotranslate?
It saves you a significant amount of time on localization tasks. It also ensures your software is perfectly translated.
Features
- Comprehensive localization solution tailored for your JavaScript application 🙌
- Seamless localization right from the start 🎉
- Translation management system 🎈