@ngx-translate/core#TranslateService TypeScript Examples
The following examples show how to use
@ngx-translate/core#TranslateService.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: side-bar.component.ts From Smersh with MIT License | 6 votes |
constructor(
changeDetectorRef: ChangeDetectorRef,
media: MediaMatcher,
private connection: ConnectionService,
public themeService: ThemeService,
public localeService: LocaleService,
private translate: TranslateService
) {
this.mobileQuery = media.matchMedia('(max-width: 600px)');
this._mobileQueryListener = () => changeDetectorRef.detectChanges();
this.mobileQuery.addListener(this._mobileQueryListener);
Object.entries({
Mission: MissionRouter.redirectToList(),
Vuln: VulnRouter.redirectToList(),
Host: HostRouter.redirectToList(),
User: UserRouter.redirectToList(),
Impact: ImpactRouter.redirectToList(),
Client: ClientRouter.redirectToList(),
})
.filter(([k]) => isGranted(`ROLE_${k.toUpperCase()}_GET_LIST`))
.map(([k, v]) => (this.fillerNav[`${k}s`] = v));
}
Example #2
Source File: app.component.ts From xBull-Wallet with GNU Affero General Public License v3.0 | 6 votes |
constructor(
@Inject(ENV)
private readonly env: typeof environment,
private readonly settingsService: SettingsService,
private readonly settingsQuery: SettingsQuery,
private readonly walletsAccountsService: WalletsAccountsService,
private readonly walletsAccountsQuery: WalletsAccountsQuery,
private readonly walletsOperationsQuery: WalletsOperationsQuery,
private readonly alertsLabelsService: AlertsLabelsService,
private readonly horizonApisQuery: HorizonApisQuery,
private readonly route: ActivatedRoute,
@Inject(DOCUMENT)
private readonly document: Document,
private readonly renderer2: Renderer2,
private readonly globalsService: GlobalsService,
private readonly ngZone: NgZone,
private readonly translateService: TranslateService,
) { }
Example #3
Source File: app.component.ts From rubic-app with GNU General Public License v3.0 | 6 votes |
constructor(
@Inject(DOCUMENT) private document: Document,
private readonly translateService: TranslateService,
private readonly cookieService: CookieService,
private readonly iframeService: IframeService,
private readonly gtmService: GoogleTagManagerService,
private readonly healthCheckService: HealthcheckService,
private readonly queryParamsService: QueryParamsService,
private readonly activatedRoute: ActivatedRoute,
private readonly errorService: ErrorsService
) {
this.printTimestamp();
this.initQueryParamsSubscription();
this.setupLanguage();
this.checkHealth();
}
Example #4
Source File: login.component.ts From ng-devui-admin with MIT License | 6 votes |
constructor(
private router: Router,
private route: ActivatedRoute,
private authService: AuthService,
private translate: TranslateService,
private i18n: I18nService,
private personalizeService: PersonalizeService
) {
this.language = this.translate.currentLang;
}
Example #5
Source File: layout.component.ts From dbm with Apache License 2.0 | 6 votes |
constructor(private translate: TranslateService,
private basicService: BasicService,
private messageService: NzMessageService,
private dataSourceService: DatasourceService) {
const basicConfig = this.basicService.get() === null ? new SystemBasicModel() : this.basicService.get();
this.translate.setDefaultLang(basicConfig.language);
TranslateUtils.init(translate);
this.initDataSources();
}
Example #6
Source File: translate-testing.module.ts From mylog14 with GNU General Public License v3.0 | 6 votes |
@NgModule({
declarations: [
TranslatePipeMock
],
providers: [
{ provide: TranslateService, useClass: TranslateServiceStub },
{ provide: TranslatePipe, useClass: TranslatePipeMock },
],
imports: [
TranslateModule.forRoot({
loader: { provide: TranslateLoader, useClass: FakeLoader },
})
],
exports: [
TranslatePipeMock,
TranslateModule
]
})
export class TranslateTestingModule {
}
Example #7
Source File: app.component.ts From msfs-community-downloader with GNU Affero General Public License v3.0 | 6 votes |
constructor(
private electronService: ElectronService,
private translate: TranslateService
) {
this.translate.setDefaultLang('en');
console.log('AppConfig', AppConfig);
if (electronService.isElectron) {
console.log(process.env);
console.log('Run in electron');
console.log('Electron ipcRenderer', this.electronService.ipcRenderer);
console.log('NodeJS childProcess', this.electronService.childProcess);
} else {
console.log('Run in browser');
}
}
Example #8
Source File: app.component.ts From ionic-doctor-online with MIT License | 6 votes |
constructor(public platform: Platform,
public statusBar: StatusBar,
public splashScreen: SplashScreen,
public app: App,
public translate: TranslateService) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
this.setStatusBar();
this.setBackbuttonEvent();
this.initializeTranslate();
splashScreen.hide();
});
}
Example #9
Source File: app.component.ts From VIR with MIT License | 6 votes |
constructor(
private electronService: ElectronService,
private translate: TranslateService
) {
this.translate.setDefaultLang('en');
console.log('AppConfig', AppConfig);
if (electronService.isElectron) {
console.log(process.env);
console.log('Run in electron');
console.log('Electron ipcRenderer', this.electronService.ipcRenderer);
console.log('NodeJS childProcess', this.electronService.childProcess);
} else {
console.log('Run in browser');
}
}
Example #10
Source File: addon-detail.component.ts From WowUp with GNU General Public License v3.0 | 6 votes |
public constructor(
@Inject(MAT_DIALOG_DATA) public model: AddonDetailModel,
private _dialogRef: MatDialogRef<AddonDetailComponent>,
private _addonService: AddonService,
private _addonProviderService: AddonProviderFactory,
private _cdRef: ChangeDetectorRef,
private _snackbarService: SnackbarService,
private _translateService: TranslateService,
private _sessionService: SessionService,
private _linkService: LinkService,
private _addonUiService: AddonUiService,
private _wowupService: WowUpService,
public gallery: Gallery
) {
this._dependencies = this.getDependencies();
this._addonService.addonInstalled$
.pipe(takeUntil(this._destroy$), filter(this.isSameAddon))
.subscribe(this.onAddonInstalledUpdate);
from(this.getChangelog())
.pipe(
takeUntil(this._destroy$),
tap(() => (this.fetchingChangelog = false))
)
.subscribe((changelog) => {
this.hasChangeLog = !!changelog;
this._changelogSrc.next(changelog);
});
from(this.getFullDescription())
.pipe(
takeUntil(this._destroy$),
tap(() => (this.fetchingFullDescription = false))
)
.subscribe((description) => this._descriptionSrc.next(description));
}
Example #11
Source File: sidebar-menu.component.ts From t3mpl-editor with MIT License | 6 votes |
public constructor(
private readonly stateService: StateService,
private readonly confirmPopupService: ConfirmPopupService,
private readonly exportPopupService: ExportPopupService,
private readonly importPopupService: ImportPopupService,
private readonly templateInfoPopupService: TemplateInfoPopupService,
private readonly uploaderPopupService: UploaderPopupService,
private readonly translateService: TranslateService) {
}
Example #12
Source File: app.component.ts From bitcoin-s-ts with MIT License | 6 votes |
constructor(private titleService: Title, private translate: TranslateService, public router: Router,
public messageService: MessageService, private snackBar: MatSnackBar, public authService: AuthService,
private oracleStateService: OracleStateService, private overlay: OverlayContainer) {
this.loggedIn$ = this.authService.loggedIn.subscribe(r => {
console.debug('loggedIn')
this.onLogin()
})
this.loggedOut$ = this.authService.loggedOut.subscribe(r => {
console.debug('loggedOut')
this.onLogout()
})
this.authService.initialize()
}
Example #13
Source File: options.component.ts From Elastos.Essentials.App with MIT License | 6 votes |
constructor(
public friendsService: FriendsService,
public didService: DidService,
private popover: PopoverController,
private navParams: NavParams,
public translate: TranslateService,
public theme: GlobalThemeService,
public events: Events,
) { }