Add i18n to search components

This commit is contained in:
Will Abson
2016-06-02 22:40:05 +01:00
parent 83f3963bbd
commit d989bf309f
5 changed files with 36 additions and 9 deletions

View File

@@ -19,6 +19,8 @@ import { Control, Validators } from 'angular2/common';
import { Component, Input, Output, EventEmitter } from 'angular2/core';
import { AlfrescoService } from './../services/alfresco.service';
import { AlfrescoPipeTranslate, AlfrescoTranslationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
declare let __moduleName: string;
declare var componentHandler: any;
@@ -28,7 +30,8 @@ declare var componentHandler: any;
styles: [
],
templateUrl: './alfresco-search-control.component.html',
providers: [AlfrescoService]
providers: [AlfrescoService],
pipes: [AlfrescoPipeTranslate]
})
export class AlfrescoSearchControlComponent {
@@ -49,13 +52,14 @@ export class AlfrescoSearchControlComponent {
searchControl: Control;
constructor() {
constructor(private translate: AlfrescoTranslationService) {
this.searchControl = new Control(
this.searchTerm,
Validators.compose([Validators.required, Validators.minLength(3)])
);
translate.addComponent('node_modules/ng2-alfresco-search');
}
ngAfterViewInit() {