diff --git a/package.json b/package.json index 9687570aa6..139d7817c6 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "planet", "license": "AGPL-3.0", - "version": "0.16.16", + "version": "0.16.17", "myplanet": { "latest": "v0.21.45", "min": "v0.20.45" diff --git a/src/app/courses/courses.service.ts b/src/app/courses/courses.service.ts index 78866f6d07..2c69e183be 100644 --- a/src/app/courses/courses.service.ts +++ b/src/app/courses/courses.service.ts @@ -227,7 +227,8 @@ export class CoursesService { courseAdmissionMany(courseIds, type) { return this.userService.changeShelf(courseIds, 'courseIds', type).pipe(map(({ shelf, countChanged }) => { const prefix = countChanged > 1 ? $localize`${countChanged} courses` : this.getCourseNameFromId(courseIds[courseIds.length - 1]); - const message = type === 'remove' ? $localize`${prefix} successfully removed from myCourses` : $localize`${prefix} added to your dashboard`; + const message = type === 'remove' ? $localize`${prefix} successfully removed from myCourses` : + $localize`${prefix} added to myCourses`; this.planetMessageService.showMessage(message); return shelf; })); diff --git a/src/app/resources/resources.service.ts b/src/app/resources/resources.service.ts index ea00aa17de..aac7f085eb 100644 --- a/src/app/resources/resources.service.ts +++ b/src/app/resources/resources.service.ts @@ -90,8 +90,13 @@ export class ResourcesService { libraryAddRemove(resourceIds, type) { return this.userService.changeShelf(resourceIds, 'resourceIds', type).pipe(map(({ shelf, countChanged }) => { + const resource = this.resources.local.find(r => r._id === resourceIds[0]); + const resourceTitle = resource ? resource.doc.title : ''; const message = type === 'remove' ? - countChanged + $localize` Resources successfully removed from myLibrary` : countChanged + $localize` Resources added to your dashboard`; + (countChanged === 1 ? $localize`${resourceTitle} successfully removed from myLibrary` : + `${countChanged} ${$localize`Resources`} successfully removed from myLibrary`) : + (countChanged === 1 ? $localize`${resourceTitle} added to myLibrary` : + `${countChanged} ${$localize`Resources`} added to myLibrary`); this.planetMessageService.showMessage(message); return shelf; }));