TypeScript @alfresco-adf-core.TranslationService类(方法)实例源码

下面列出了TypeScript @alfresco-adf-core.TranslationService 类(方法)源码代码实例,从而了解它的用法。

作者:Alfresc    项目:alfresco-ng2-component   
constructor(
        private peopleProcessService: PeopleProcessService,
        private logService: LogService,
        private translationService: TranslationService) {

        this.peopleIdChange = new EventEmitter();
        this.performSearch = this.searchUser.bind(this);
        this.defaultPlaceholder = this.translationService.instant(DEFAULT_ASSIGNEE_PLACEHOLDER);
    }

作者:Alfresc    项目:alfresco-ng2-component   
private initDefaultProperties(): any[] {
     return [
         new CardViewTextItemModel(
             {
                 label: 'ADF_PROCESS_LIST.PROPERTIES.STATUS',
                 value: this.getProcessStatus(),
                 key: 'status'
             }),
         new CardViewDateItemModel(
             {
                 label: 'ADF_PROCESS_LIST.PROPERTIES.END_DATE',
                 value: this.processInstance.ended,
                 format: 'MMM DD YYYY',
                 key: 'ended',
                 default: this.translationService.instant('ADF_PROCESS_LIST.PROPERTIES.END_DATE_DEFAULT')
             }),
         new CardViewTextItemModel(
             {
                 label: 'ADF_PROCESS_LIST.PROPERTIES.CATEGORY',
                 value: this.processInstance.processDefinitionCategory,
                 key: 'category',
                 default: this.translationService.instant('ADF_PROCESS_LIST.PROPERTIES.CATEGORY_DEFAULT')
             }),
         new CardViewTextItemModel(
             {
                 label: 'ADF_PROCESS_LIST.PROPERTIES.BUSINESS_KEY',
                 value: this.processInstance.businessKey,
                 key: 'businessKey',
                 default: this.translationService.instant('ADF_PROCESS_LIST.PROPERTIES.BUSINESS_KEY_DEFAULT')
             }),
         new CardViewTextItemModel(
             {
                 label: 'ADF_PROCESS_LIST.PROPERTIES.CREATED_BY',
                 value: this.getStartedByFullName(),
                 key: 'assignee',
                 default: this.translationService.instant('ADF_PROCESS_LIST.PROPERTIES.CREATED_BY_DEFAULT')
             }),
         new CardViewDateItemModel(
             {
                 label: 'ADF_PROCESS_LIST.PROPERTIES.CREATED',
                 value: this.processInstance.started,
                 format: 'MMM DD YYYY',
                 key: 'created'
             }),
         new CardViewTextItemModel(
             {label: 'ADF_PROCESS_LIST.PROPERTIES.ID',
             value: this.processInstance.id,
             key: 'id'
         }),
         new CardViewTextItemModel(
             {label: 'ADF_PROCESS_LIST.PROPERTIES.DESCRIPTION',
             value: this.processInstance.processDefinitionDescription,
             key: 'description',
             default: this.translationService.instant('ADF_PROCESS_LIST.PROPERTIES.DESCRIPTION_DEFAULT')
         })
     ];
 }

作者:Alfresc    项目:alfresco-ng2-component   
/**
     * Show undo notification bar.
     *
     * @param latestFilesAdded - files in the upload queue enriched with status flag and xhr object.
     */
    showUndoNotificationBar(latestFilesAdded: FileModel[]) {
        let messageTranslate: any, actionTranslate: any;
        messageTranslate = this.translationService.get('FILE_UPLOAD.MESSAGES.PROGRESS');
        actionTranslate = this.translationService.get('FILE_UPLOAD.ACTION.UNDO');

        this.notificationService.openSnackMessageAction(messageTranslate.value, actionTranslate.value, 3000).onAction().subscribe(() => {
            this.uploadService.cancelUpload(...latestFilesAdded);
        });
    }

作者:Alfresc    项目:alfresco-ng2-component   
transform(errorCode: number): string {
     return this.translation.instant(`FILE_UPLOAD.ERRORS.${errorCode || 'GENERIC'}`);
 }


问题


面经


文章

微信
公众号

扫码关注公众号