Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h2 class="m-1">
<tbody>

<tr>
<td></td>
<th scope="col">{{ objectHeaderLabel }}</th>
<th scope="col"
*ngFor="let header of headers"
class="{{header}}-header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ export class StatisticsTableComponent implements OnInit {
*/
headers: string[];

/**
* Object header label
*/
objectHeaderLabel: string;

constructor(
protected dsoService: DSpaceObjectDataService,
protected nameService: DSONameService,
Expand All @@ -71,6 +76,7 @@ export class StatisticsTableComponent implements OnInit {
if (this.hasData) {
this.headers = Object.keys(this.report.points[0].values);
}
this.objectHeaderLabel = this.getObjectHeaderLabel(this.report.reportType);
}

/**
Expand All @@ -91,4 +97,12 @@ export class StatisticsTableComponent implements OnInit {
return of(point.label);
}
}

/**
* Defines a dynamic label for the object column
* @param reportType
*/
getObjectHeaderLabel(reportType: string): string {
return this.translateService.instant('statistics.table.header.' + reportType);
}
}
10 changes: 10 additions & 0 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -6781,4 +6781,14 @@
"live-region.ordering.dropped": "{{ itemName }}, dropped at position {{ index }} of {{ length }}.",

"dynamic-form-array.sortable-list.label": "Sortable list",

"statistics.table.header.TotalVisits": "Object",

"statistics.table.header.TotalVisitsMonth": "Month",

"statistics.table.header.TotalDownloads": "Downloads",

"statistics.table.header.TopCities": "Cities",

"statistics.table.header.topCountries": "Countries",
}
15 changes: 15 additions & 0 deletions src/assets/i18n/es.json5
Original file line number Diff line number Diff line change
Expand Up @@ -10194,4 +10194,19 @@

// "search-facet-option.update.announcement": "The page will be reloaded. Filter {{ filter }} is selected.",
"search-facet-option.update.announcement": "La página será recargada. Filtro {{ filter }} seleccionado.",

// "statistics.table.header.TotalVisits": "Object",
"statistics.table.header.TotalVisits": "Objeto",

// "statistics.table.header.TotalVisitsMonth": "Month",
"statistics.table.header.TotalVisitsMonth": "Mes",

// "statistics.table.header.TotalDownloads": "Downloads",
"statistics.table.header.TotalDownloads": "Descargas",

// "statistics.table.header.TopCities": "Cities",
"statistics.table.header.TopCities": "Ciudades",

// "statistics.table.header.topCountries": "Countries",
"statistics.table.header.topCountries": "Países",
}
15 changes: 15 additions & 0 deletions src/assets/i18n/pt-BR.json5
Original file line number Diff line number Diff line change
Expand Up @@ -10243,4 +10243,19 @@

// "search-facet-option.update.announcement": "The page will be reloaded. Filter {{ filter }} is selected.",
"search-facet-option.update.announcement": "A página será recarregada. O filtro {{ filter }} foi selecionado.",

// "statistics.table.header.TotalVisits": "Object",
"statistics.table.header.TotalVisits": "Objeto",

// "statistics.table.header.TotalVisitsMonth": "Month",
"statistics.table.header.TotalVisitsMonth": "Mês",

// "statistics.table.header.TotalDownloads": "Downloads",
"statistics.table.header.TotalDownloads": "Downloads",

// "statistics.table.header.TopCities": "Cities",
"statistics.table.header.TopCities": "Cidades",

// "statistics.table.header.topCountries": "Countries",
"statistics.table.header.topCountries": "Países",
}
Loading