From d2d635b94d22ba4f99789834f0b88ceaf4ae91b5 Mon Sep 17 00:00:00 2001 From: suzanadirla Date: Mon, 29 Jan 2018 00:55:39 +0200 Subject: [PATCH] [ADF-2000] Destination picker is not completely translated (#2883) --- .../content-node-dialog.service.ts | 13 ++++++++++--- .../content-node-selector-panel.component.html | 2 +- lib/content-services/i18n/en.json | 3 +++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/content-services/content-node-selector/content-node-dialog.service.ts b/lib/content-services/content-node-selector/content-node-dialog.service.ts index c6da1fe915..dbbfee6f86 100644 --- a/lib/content-services/content-node-selector/content-node-dialog.service.ts +++ b/lib/content-services/content-node-selector/content-node-dialog.service.ts @@ -22,7 +22,7 @@ import { Subject } from 'rxjs/Subject'; import { Observable } from 'rxjs/Observable'; import { ShareDataRow } from '../document-list/data/share-data-row.model'; import { MinimalNodeEntryEntity, SitePaging } from 'alfresco-js-api'; -import { DataColumn, SitesService } from '@alfresco/adf-core'; +import { DataColumn, SitesService, TranslationService } from '@alfresco/adf-core'; import { DocumentListService } from '../document-list/services/document-list.service'; import { ContentNodeSelectorComponent } from './content-node-selector.component'; import { ContentNodeSelectorComponentData } from './content-node-selector.component-data.interface'; @@ -33,7 +33,8 @@ export class ContentNodeDialogService { constructor(private dialog: MatDialog, private contentService: ContentService, private documentListService: DocumentListService, - private siteService: SitesService) { } + private siteService: SitesService, + private translation: TranslationService) { } openFileBrowseDialogByFolderId(folderNodeId: string): Observable { return Observable.fromPromise(this.documentListService.getFolderNode(folderNodeId)) @@ -69,8 +70,10 @@ export class ContentNodeDialogService { complete: this.close.bind(this) }); + const title = this.getTitleTranslation(action, contentEntry.name); + const data: ContentNodeSelectorComponentData = { - title: `${action} '${contentEntry.name}' to ...`, + title: title, actionName: action, currentFolderId: contentEntry.parentId, imageResolver: this.imageResolver.bind(this), @@ -88,6 +91,10 @@ export class ContentNodeDialogService { } } + getTitleTranslation(action: string, name: string): string { + return this.translation.instant(`NODE_SELECTOR.${action.toUpperCase()}_ITEM`, {name}); + } + openUploadFolderDialog(action: string, contentEntry: MinimalNodeEntryEntity): Observable { const select = new Subject(); select.subscribe({ diff --git a/lib/content-services/content-node-selector/content-node-selector-panel.component.html b/lib/content-services/content-node-selector/content-node-selector-panel.component.html index ef18759562..58c7a4a421 100644 --- a/lib/content-services/content-node-selector/content-node-selector-panel.component.html +++ b/lib/content-services/content-node-selector/content-node-selector-panel.component.html @@ -4,7 +4,7 @@ id="searchInput" [formControl]="searchInput" type="text" - placeholder="Search" + placeholder="{{'NODE_SELECTOR.SEARCH' | translate}}" [value]="searchTerm" data-automation-id="content-node-selector-search-input"> diff --git a/lib/content-services/i18n/en.json b/lib/content-services/i18n/en.json index 77b90fcd5a..22c4242b8b 100644 --- a/lib/content-services/i18n/en.json +++ b/lib/content-services/i18n/en.json @@ -40,8 +40,11 @@ "CANCEL": "Cancel", "CHOOSE": "Choose", "COPY": "Copy", + "COPY_ITEM": "Copy '{{ name }}' to ...", "MOVE": "Move", + "MOVE_ITEM": "Move '{{ name }}' to ...", "NO_RESULTS": "No results found", + "SEARCH": "Search", "SELECT_LOCATION": "Select Location" }, "OPERATION": {