Skip to content

Commit 16c0662

Browse files
authored
Merge pull request DSpace#2930 from alexandrevryghem/fix-sync-i18n-script_contribute-main
Fix sync-i18n script throwing a compile error & added some missing translation keys
2 parents 1861166 + 59f913b commit 16c0662

6 files changed

Lines changed: 33 additions & 15 deletions

File tree

scripts/sync-i18n-files.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ function readFileIfExists(pathToFile) {
275275
try {
276276
return fs.readFileSync(pathToFile, 'utf8');
277277
} catch (e) {
278-
console.error('Error:', e.stack);
278+
if (e instanceof Error) {
279+
console.error('Error:', e.stack);
280+
}
279281
}
280282
}
281283
return null;

src/app/item-page/edit-item-page/item-move/item-move.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h1>{{'item.edit.move.head' | translate: {id: (itemRD$ | async)?.payload?.handle
66
<div class="row">
77
<div class="col-12">
88
<div class="card mb-3">
9-
<div class="card-header">{{'dso-selector.placeholder' | translate: { type: 'collection' } }}</div>
9+
<div class="card-header">{{'dso-selector.placeholder' | translate: { type: 'dso-selector.placeholder.type.collection' | translate } }}</div>
1010
<div class="card-body">
1111
<ds-authorized-collection-selector [types]="COLLECTIONS"
1212
[currentDSOId]="selectedCollection ? selectedCollection.id : originalCollection.id"

src/app/shared/dso-selector/dso-selector/dso-selector.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class DSOSelectorComponent implements OnInit, OnDestroy {
190190
* The search will always start with the initial currentDSOId value
191191
*/
192192
ngOnInit(): void {
193-
this.typesString = this.types.map((type: string) => type.toString().toLowerCase()).join(', ');
193+
this.typesString = this.types.map((type: string) => this.translate.instant(`dso-selector.placeholder.type.${type.toString().toLowerCase()}`)).join(', ');
194194

195195
// Create an observable searching for the current DSO (return empty list if there's no current DSO)
196196
let currentDSOResult$: Observable<PaginatedList<SearchResult<DSpaceObject>>>;

src/assets/i18n/en.json5

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,6 +1726,12 @@
17261726

17271727
"dso-selector.placeholder": "Search for a {{ type }}",
17281728

1729+
"dso-selector.placeholder.type.community": "community",
1730+
1731+
"dso-selector.placeholder.type.collection": "collection",
1732+
1733+
"dso-selector.placeholder.type.item": "item",
1734+
17291735
"dso-selector.select.collection.head": "Select a collection",
17301736

17311737
"dso-selector.set-scope.community.head": "Select a search scope",

src/assets/i18n/fr.json5

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@
176176

177177
// "admin.registries.bitstream-formats.table.name": "Name",
178178
"admin.registries.bitstream-formats.table.name": "Nom",
179-
// TODO New key - Add a translation
179+
180+
// "admin.registries.bitstream-formats.table.id": "ID",
180181
"admin.registries.bitstream-formats.table.id": "ID",
181182

182183
// "admin.registries.bitstream-formats.table.return": "Back",
@@ -253,7 +254,8 @@
253254

254255
// "admin.registries.schema.fields.table.field": "Field",
255256
"admin.registries.schema.fields.table.field": "Champ",
256-
// TODO New key - Add a translation
257+
258+
// "admin.registries.schema.fields.table.id": "ID",
257259
"admin.registries.schema.fields.table.id": "ID",
258260

259261
// "admin.registries.schema.fields.table.scopenote": "Scope Note",
@@ -776,9 +778,6 @@
776778
"admin.reports.collections.match_all_selected_filters": "Correspondant à tous les filtres sélectionnés",
777779

778780

779-
//"admin.reports.items.title": "Metadata Query Report",
780-
"admin.reports.items.title": "Rapport de requête de métadonnées",
781-
782781
//"admin.reports.items.breadcrumbs": "Metadata Query Report",
783782
"admin.reports.items.breadcrumbs": "Requête de métadonnées",
784783

@@ -2248,6 +2247,15 @@
22482247
// "dso-selector.placeholder": "Search for a {{ type }}",
22492248
"dso-selector.placeholder": "Rechercher un(e) {{ type }}",
22502249

2250+
// "dso-selector.placeholder.type.community": "community",
2251+
"dso-selector.placeholder.type.community": "communauté",
2252+
2253+
// "dso-selector.placeholder.type.collection": "collection",
2254+
"dso-selector.placeholder.type.collection": "collection",
2255+
2256+
// "dso-selector.placeholder.type.item": "item",
2257+
"dso-selector.placeholder.type.item": "item",
2258+
22512259
// "dso-selector.select.collection.head": "Select a collection",
22522260
"dso-selector.select.collection.head": "Sélectionner une collection",
22532261

@@ -6463,9 +6471,6 @@
64636471
//"workspace.search.results.head": "Your submissions",
64646472
"workspace.search.results.head": "Vos dépôts",
64656473

6466-
// "workspace.search.results.head": "Your submissions",
6467-
"workspace.search.results.head": "Vos dépôts",
6468-
64696474
// "workflowAdmin.search.results.head": "Administer Workflow",
64706475
"workflowAdmin.search.results.head": "Workflow Administrateur",
64716476

src/assets/i18n/nl.json5

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,6 @@
839839
"admin.reports.collections.match_all_selected_filters": "Matching all selected filters",
840840

841841

842-
//"admin.reports.items.title": "Metadata Query Report",
843-
// TODO New key - Add a translation
844-
"admin.reports.items.title": "Metadata Query Report",
845-
846842
//"admin.reports.items.breadcrumbs": "Metadata Query Report",
847843
// TODO New key - Add a translation
848844
"admin.reports.items.breadcrumbs": "Metadata Query Report",
@@ -2377,6 +2373,15 @@
23772373
// "dso-selector.placeholder": "Search for a {{ type }}",
23782374
"dso-selector.placeholder": "Zoek een {{ type }}",
23792375

2376+
// "dso-selector.placeholder.type.community": "community",
2377+
"dso-selector.placeholder.type.community": "community",
2378+
2379+
// "dso-selector.placeholder.type.collection": "collection",
2380+
"dso-selector.placeholder.type.collection": "collectie",
2381+
2382+
// "dso-selector.placeholder.type.item": "item",
2383+
"dso-selector.placeholder.type.item": "item",
2384+
23802385

23812386

23822387
// "confirmation-modal.export-metadata.header": "Export metadata for {{ dsoName }}",

0 commit comments

Comments
 (0)