From c96084b26d87a0db24a768105ce1ec613f64c66b Mon Sep 17 00:00:00 2001
From: Laxman Maharjan
Date: Mon, 18 Apr 2022 21:48:03 +0545
Subject: [PATCH] version 0.13.10 (#7080)
Co-authored-by: Laxman Maharjan
Co-authored-by: Rhea Malviya <94139372+rheam97@users.noreply.github.com>
---
.github/workflows/planet-db.yml | 2 +
.github/workflows/planet.yml | 2 +
angular.json | 3 +-
package.json | 2 +-
.../community-link-dialog.component.ts | 4 +-
src/app/community/community.component.ts | 22 +-
.../configuration/configuration.component.ts | 10 +-
.../configuration/configuration.service.ts | 2 +-
src/app/configuration/migration.component.ts | 6 +-
.../add-courses/courses-add.component.ts | 4 +-
src/app/courses/courses.component.ts | 20 +-
src/app/courses/courses.service.ts | 8 +-
.../courses-progress-leader.component.html | 2 +-
.../courses-progress-leader.component.ts | 8 +-
.../courses-step-view.component.html | 2 +-
.../dashboard/dashboard-tile.component.html | 2 +-
src/app/dashboard/dashboard-tile.component.ts | 6 +-
src/app/dashboard/dashboard.component.html | 8 +-
src/app/dashboard/dashboard.component.ts | 10 +-
src/app/exams/exams-add.component.ts | 4 +-
src/app/exams/exams-view.component.ts | 2 +-
src/app/feedback/feedback-view.component.ts | 10 +-
src/app/feedback/feedback.component.ts | 6 +-
src/app/feedback/feedback.directive.ts | 14 +-
src/app/feedback/feedback.service.ts | 4 +-
src/app/health/health-event.component.ts | 4 +-
src/app/health/health.constants.ts | 42 +-
src/app/home/home.component.html | 2 +-
src/app/login/login-form.component.ts | 18 +-
.../logs-myplanet/logs-myplanet.component.ts | 4 +-
.../certifications-add.component.ts | 2 +-
.../certifications/certifications.service.ts | 4 +-
.../manager-dashboard.component.ts | 12 +-
.../manager-fetch.component.ts | 2 +-
.../reports/pending-table.component.ts | 2 +-
.../reports/reports-detail.component.ts | 28 +-
.../reports/reports-myplanet.component.ts | 2 +-
.../reports/reports-pending.component.ts | 2 +-
.../reports/reports.component.ts | 2 +-
.../reports/reports.service.ts | 4 +-
.../reports/reports.utils.ts | 10 +-
.../requests/requests-table.component.ts | 12 +-
.../requests/requests.component.ts | 16 +-
src/app/manager-dashboard/sync.directive.ts | 2 +-
.../add-meetups/meetups-add.component.ts | 6 +-
src/app/meetups/meetups.component.ts | 16 +-
src/app/meetups/meetups.service.ts | 6 +-
.../view-meetups/meetups-view.component.ts | 8 +-
src/app/news/news-list-item.component.ts | 12 +-
src/app/news/news-list.component.ts | 8 +-
src/app/news/news.service.ts | 6 +-
.../notifications.component.html | 2 +-
.../notifications/notifications.service.ts | 2 +-
src/app/resources/resources-add.component.ts | 4 +-
src/app/resources/resources-constants.ts | 94 +-
src/app/resources/resources.component.ts | 16 +-
src/app/resources/resources.service.ts | 4 +-
.../resources-view.component.ts | 2 +-
src/app/shared/calendar.component.ts | 4 +-
src/app/shared/couchdb.service.ts | 2 +-
src/app/shared/csv.service.ts | 20 +-
.../dialogs/change-password.directive.ts | 14 +-
.../dialogs/dialogs-form.component.html | 4 +-
.../forms/form-error-messages.component.ts | 2 +-
.../planet-markdown-textbox.component.ts | 2 +-
.../shared/forms/planet-rating.component.ts | 16 +-
.../planet-tag-input-dialog.component.ts | 12 +-
.../planet-tag-selected-input.component.ts | 2 +-
.../planet-filtered-amount.component.ts | 4 +-
src/app/shared/sync.service.ts | 10 +-
src/app/submissions/submissions.component.ts | 6 +-
src/app/submissions/submissions.service.ts | 4 +-
src/app/surveys/surveys.component.ts | 16 +-
src/app/tasks/tasks.component.ts | 10 +-
src/app/tasks/tasks.service.ts | 8 +-
src/app/teams/teams-reports.component.ts | 20 +-
.../teams/teams-view-finances.component.ts | 18 +-
src/app/teams/teams-view.component.ts | 42 +-
src/app/teams/teams.component.ts | 12 +-
src/app/teams/teams.service.ts | 32 +-
src/app/upgrade/upgrade.component.html | 2 +-
src/app/upgrade/upgrade.component.ts | 20 +-
.../users-achievements-update.component.ts | 24 +-
.../users-achievements.component.ts | 2 +-
src/app/users/users-table.component.ts | 14 +-
.../users-update/users-update.component.ts | 2 +-
src/app/users/users.component.html | 2 +-
src/app/users/users.component.ts | 4 +-
src/app/users/users.service.ts | 2 +-
src/app/validators/custom-validators.ts | 2 +-
src/i18n/messages.afr.xlf | 2465 ++++++++++++----
src/i18n/messages.ara.xlf | 2465 ++++++++++++----
src/i18n/messages.deu.xlf | 2465 ++++++++++++----
src/i18n/messages.eng.xlf | 2471 ++++++++++++----
src/i18n/messages.fra.xlf | 2465 ++++++++++++----
src/i18n/messages.hin.xlf | 2465 ++++++++++++----
src/i18n/messages.ind.xlf | 2465 ++++++++++++----
src/i18n/messages.ita.xlf | 2465 ++++++++++++----
src/i18n/messages.mlg.xlf | 2465 ++++++++++++----
src/i18n/messages.nep.xlf | 2465 ++++++++++++----
src/i18n/messages.por.xlf | 2465 ++++++++++++----
src/i18n/messages.rus.xlf | 2465 ++++++++++++----
src/i18n/messages.som.xlf | 2467 ++++++++++++----
src/i18n/messages.spa.xlf | 2508 +++++++++++++----
src/i18n/messages.swa.xlf | 2465 ++++++++++++----
src/i18n/messages.tam.xlf | 2465 ++++++++++++----
src/i18n/messages.tur.xlf | 2465 ++++++++++++----
src/i18n/messages.ukr.xlf | 2469 ++++++++++++----
src/i18n/messages.vie.xlf | 2465 ++++++++++++----
src/i18n/messages.xlf | 2123 ++++++++++----
src/i18n/messages.zho.xlf | 2465 ++++++++++++----
src/i18n/messages.zul.xlf | 2465 ++++++++++++----
tsconfig.json | 1 +
113 files changed, 41551 insertions(+), 13246 deletions(-)
diff --git a/.github/workflows/planet-db.yml b/.github/workflows/planet-db.yml
index 856e2091d0..030ee2560c 100644
--- a/.github/workflows/planet-db.yml
+++ b/.github/workflows/planet-db.yml
@@ -2,6 +2,8 @@ name: Planet DB-Init Builder
on:
push:
+ branches-ignore:
+ - l10n_i18n
release:
types:
- created
diff --git a/.github/workflows/planet.yml b/.github/workflows/planet.yml
index 1d3f1686a4..0f23996feb 100644
--- a/.github/workflows/planet.yml
+++ b/.github/workflows/planet.yml
@@ -2,6 +2,8 @@ name: Planet Builder
on:
push:
+ branches-ignore:
+ - l10n_i18n
release:
types: [published]
workflow_dispatch:
diff --git a/angular.json b/angular.json
index b9c246252f..26605ad655 100644
--- a/angular.json
+++ b/angular.json
@@ -198,7 +198,8 @@
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "planet-app:build"
- }
+ },
+ "ivy":true
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
diff --git a/package.json b/package.json
index db5cd15aee..90e2d34299 100755
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "planet-app",
- "version": "0.13.9",
+ "version": "0.13.10",
"license": "AGPL-3.0",
"scripts": {
"ng": "ng",
diff --git a/src/app/community/community-link-dialog.component.ts b/src/app/community/community-link-dialog.component.ts
index bf0381c760..049f839c23 100644
--- a/src/app/community/community-link-dialog.component.ts
+++ b/src/app/community/community-link-dialog.component.ts
@@ -15,8 +15,8 @@ export class CommunityLinkDialogComponent {
@ViewChild('linkStepper') linkStepper: MatStepper;
selectedLink: { db, title, selector? };
links: { db, title, selector? }[] = [
- { db: 'teams', title: 'Teams', selector: { type: 'team' } },
- { db: 'teams', title: 'Enterprises', selector: { type: 'enterprise' } }
+ { db: 'teams', title: $localize`Teams`, selector: { type: 'team' } },
+ { db: 'teams', title: $localize`Enterprises`, selector: { type: 'enterprise' } }
];
linkForm: FormGroup;
diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts
index abeb60a59f..d9003f2759 100644
--- a/src/app/community/community.component.ts
+++ b/src/app/community/community.component.ts
@@ -136,7 +136,7 @@ export class CommunityComponent implements OnInit, OnDestroy {
openAddMessageDialog(message = '') {
this.dialogsFormService.openDialogsForm(
'Add Story',
- [ { name: 'message', placeholder: 'Your Story', type: 'markdown', required: true, imageGroup: 'community' } ],
+ [ { name: 'message', placeholder: $localize`Your Story`, type: 'markdown', required: true, imageGroup: 'community' } ],
{ message: [ message, CustomValidators.requiredMarkdown ] },
{ autoFocus: true, onSubmit: this.postMessage.bind(this) }
);
@@ -148,7 +148,7 @@ export class CommunityComponent implements OnInit, OnDestroy {
messageType: 'sync',
messagePlanetCode: this.configuration.code,
...message
- }, 'Message has been posted successfully').pipe(
+ }, $localize`Message has been posted successfully`).pipe(
switchMap(() => forkJoin([
this.usersService.getAllUsers(),
this.couchService.findAll('notifications', findDocuments({ status: 'unread', type: 'communityMessage' }))
@@ -168,7 +168,7 @@ export class CommunityComponent implements OnInit, OnDestroy {
sendNotifications(user, currentUser) {
return {
'user': user,
- 'message': `${currentUser.split(':')[1]} posted a new story.`,
+ 'message': $localize`${currentUser.split(':')[1]} posted a new story.`,
'link': '/',
'type': 'communityMessage',
'priority': 1,
@@ -240,10 +240,10 @@ export class CommunityComponent implements OnInit, OnDestroy {
request: this.couchService.updateDocument('teams', { ...link, _deleted: true }).pipe(switchMap(() => this.getLinks())),
onNext: (res) => {
this.setLinksAndFinances(res);
- this.planetMessageService.showMessage(`${link.title} deleted`);
+ this.planetMessageService.showMessage($localize`${link.title} deleted`);
deleteDialog.close();
},
- onError: () => this.planetMessageService.showAlert(`There was an error deleting ${link.title}`)
+ onError: () => this.planetMessageService.showAlert($localize`There was an error deleting ${link.title}`)
},
changeType: 'delete',
type: 'link',
@@ -262,7 +262,7 @@ export class CommunityComponent implements OnInit, OnDestroy {
openChangeTitleDialog({ member: councillor }) {
this.dialogsFormService.openDialogsForm(
- councillor.doc.leadershipTitle ? 'Change Leader Title' : 'Add Leader Title',
+ councillor.doc.leadershipTitle ? $localize`Change Leader Title` : $localize`Add Leader Title`,
[ { name: 'leadershipTitle', placeholder: 'Title', type: 'textbox' } ],
{ leadershipTitle: councillor.doc.leadershipTitle || '' },
{ autoFocus: true, onSubmit: this.updateTitle(councillor).bind(this) }
@@ -280,10 +280,10 @@ export class CommunityComponent implements OnInit, OnDestroy {
finalize(() => this.dialogsLoadingService.stop())
).subscribe(() => {
const msg = !leadershipTitle ?
- 'Title deleted' :
+ $localize`Title deleted` :
!councillor.doc.leadershipTitle ?
- 'Title added' :
- 'Title updated';
+ $localize`Title added` :
+ $localize`Title updated`;
this.dialogsFormService.closeDialogsForm();
this.planetMessageService.showMessage(msg);
this.usersService.requestUsers();
@@ -302,8 +302,8 @@ export class CommunityComponent implements OnInit, OnDestroy {
this.dialogsFormService.closeDialogsForm();
};
this.dialogsFormService.openDialogsForm(
- this.team.description ? 'Edit Description' : 'Add Description',
- [ { name: 'description', placeholder: 'Description', type: 'markdown', required: true, imageGroup: 'community' } ],
+ this.team.description ? $localize`Edit Description` : $localize`Add Description`,
+ [ { name: 'description', placeholder: $localize`Description`, type: 'markdown', required: true, imageGroup: 'community' } ],
{ description: { text: this.team.description || '', images: this.team.images || [] } },
{ onSubmit: submitDescription }
);
diff --git a/src/app/configuration/configuration.component.ts b/src/app/configuration/configuration.component.ts
index c2e6acc363..f256de8bf4 100644
--- a/src/app/configuration/configuration.component.ts
+++ b/src/app/configuration/configuration.component.ts
@@ -189,7 +189,7 @@ export class ConfigurationComponent implements OnInit {
{ domain: environment.centerAddress, protocol: environment.centerProtocol })
.subscribe((data) => {
this.nations = data.docs;
- }, (error) => this.planetMessageService.showAlert('There is a problem getting the list of nations'));
+ }, (error) => this.planetMessageService.showAlert($localize`There is a problem getting the list of nations`));
}
onChange(selectedValue: string) {
@@ -251,18 +251,18 @@ export class ConfigurationComponent implements OnInit {
this.configurationService.updateConfiguration(configuration).pipe(finalize(spinnerOff)).subscribe(
() => this.stateService.requestData('configurations', 'local'),
err => {
- this.planetMessageService.showAlert('There was an error updating the configuration');
+ this.planetMessageService.showAlert($localize`There was an error updating the configuration`);
}, () => {
this.router.navigate([ '/manager' ]);
- this.planetMessageService.showMessage('Configuration Updated Successfully');
+ this.planetMessageService.showMessage($localize`Configuration Updated Successfully`);
}
);
} else {
const admin = Object.assign(credentials, this.contactFormGroup.value);
this.configurationService.createPlanet(admin, configuration, credentials).pipe(finalize(spinnerOff)).subscribe((data) => {
- this.planetMessageService.showMessage('Admin created: ' + credentials.name);
+ this.planetMessageService.showMessage($localize`Admin created: ${credentials.name}`);
this.router.navigate([ '/login' ]);
- }, (error) => this.planetMessageService.showAlert('There was an error creating planet'));
+ }, (error) => this.planetMessageService.showAlert($localize`There was an error creating planet`));
}
}
diff --git a/src/app/configuration/configuration.service.ts b/src/app/configuration/configuration.service.ts
index 5b6b6a08ac..76b45b69ad 100644
--- a/src/app/configuration/configuration.service.ts
+++ b/src/app/configuration/configuration.service.ts
@@ -27,7 +27,7 @@ export class ConfigurationService {
return mergeMap(data => {
const requestNotification = {
'user': 'SYSTEM',
- 'message': `New ${configuration.planetType} "${configuration.name}" has requested to connect.`,
+ 'message': $localize`New ${configuration.planetType} "${configuration.name}" has requested to connect.`,
'link': '/manager/requests/',
'linkParams': { 'search': configuration.code },
'type': 'request',
diff --git a/src/app/configuration/migration.component.ts b/src/app/configuration/migration.component.ts
index da3607463d..0e1b927c00 100755
--- a/src/app/configuration/migration.component.ts
+++ b/src/app/configuration/migration.component.ts
@@ -76,7 +76,7 @@ export class MigrationComponent implements OnInit {
.subscribe(() => {
this.stepper.selected.completed = true;
this.stepper.next();
- }, error => this.planetMessageService.showMessage('Configuration is not valid. Please check again.'));
+ }, error => this.planetMessageService.showMessage($localize`Configuration is not valid. Please check again.`));
}
clonePlanet() {
@@ -94,7 +94,7 @@ export class MigrationComponent implements OnInit {
switchMap(() => this.getDatabaseNames()),
switchMap((syncDatabases: string[]) => forkJoin(syncDatabases.map(db => this.syncService.sync(this.syncDoc(db), this.credential))))
).subscribe(() => {
- this.planetMessageService.showMessage(`Planet is being synced with domain "${this.cloneDomain}". Please hold on.`);
+ this.planetMessageService.showMessage($localize`Planet is being synced with domain "${this.cloneDomain}". Please hold on.`);
this.dialogsLoadingService.start();
this.replicationCompletionCheck(() => this.cloneUserDbs());
});
@@ -124,7 +124,7 @@ export class MigrationComponent implements OnInit {
completeMigration() {
this.router.navigate([ '/' ]);
this.dialogsLoadingService.stop();
- this.planetMessageService.showMessage(`Cloning "${this.cloneDomain}" complete.`);
+ this.planetMessageService.showMessage($localize`Cloning "${this.cloneDomain}" complete.`);
}
syncDoc(db: string) {
diff --git a/src/app/courses/add-courses/courses-add.component.ts b/src/app/courses/add-courses/courses-add.component.ts
index 373096d785..e50741d9e0 100644
--- a/src/app/courses/add-courses/courses-add.component.ts
+++ b/src/app/courses/add-courses/courses-add.component.ts
@@ -57,7 +57,7 @@ export class CoursesAddComponent implements OnInit, OnDestroy {
// from the languages import
languageNames = languages.map(list => list.name);
- mockStep = { stepTitle: 'Add title', description: '!!!' };
+ mockStep = { stepTitle: $localize`Add title`, description: '!!!' };
constructor(
private router: Router,
@@ -198,7 +198,7 @@ export class CoursesAddComponent implements OnInit, OnDestroy {
)
])
)).subscribe(([ courseRes, tagsRes ]) => {
- const message = courseInfo.courseTitle + (this.pageType === 'Update' ? ' Updated Successfully' : ' Added');
+ const message = courseInfo.courseTitle + (this.pageType === 'Update' ? $localize` Updated Successfully` : $localize` Added`);
this.courseChangeComplete(message, courseRes, shouldNavigate);
}, (err) => {
// Connect to an error display component to show user that an error has occurred
diff --git a/src/app/courses/courses.component.ts b/src/app/courses/courses.component.ts
index f6731586d5..00d9f2f845 100644
--- a/src/app/courses/courses.component.ts
+++ b/src/app/courses/courses.component.ts
@@ -269,9 +269,9 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
// It's safer to remove the item from the array based on its id than to splice based on the index
this.courses.data = this.courses.data.filter((c: any) => data.id !== c._id);
this.deleteDialog.close();
- this.planetMessageService.showMessage('Course deleted: ' + course.courseTitle);
+ this.planetMessageService.showMessage($localize`Course deleted: ${course.courseTitle}`);
},
- onError: (error) => this.planetMessageService.showAlert('There was a problem deleting this course.')
+ onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this course.`)
};
}
@@ -283,9 +283,9 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
this.getCourses();
this.selection.clear();
this.deleteDialog.close();
- this.planetMessageService.showMessage('You have deleted ' + deleteArray.length + ' courses');
+ this.planetMessageService.showMessage($localize`You have deleted ${deleteArray.length} courses`);
},
- onError: (error) => this.planetMessageService.showAlert('There was a problem deleting courses.')
+ onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting courses.`)
};
}
@@ -374,7 +374,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
newShelf._rev = res.rev;
this.userService.shelf = newShelf;
this.setupList(this.courses.data, this.userShelf.courseIds);
- this.planetMessageService.showMessage(message + ' myCourses');
+ this.planetMessageService.showMessage($localize`${message} myCourses`);
}, (error) => (error));
}
@@ -383,7 +383,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
const courseIds = courses.map((data) => {
return data._id;
}).concat(currentShelf.courseIds).reduce(dedupeShelfReduce, []);
- const message = courses.length === 1 ? courses[0].courseTitle + ' have been added to' : courses.length + ' courses have been added to';
+ const message = courses.length === 1 ? $localize`${courses[0].courseTitle} have been added to` : $localize`${courses.length} courses have been added to`;
this.updateShelf(Object.assign({}, currentShelf, { courseIds }), message);
}
@@ -409,7 +409,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
this.syncService.replicatorsArrayWithTags(courses, type, parentType).pipe(switchMap(replicators =>
this.syncService.confirmPasswordAndRunReplicators(replicators)
)).subscribe(() => {
- this.planetMessageService.showMessage(courses.length + ' ' + this.dbName + ' ' + 'queued to ' + msg);
+ this.planetMessageService.showMessage($localize`${courses.length} ${this.dbName} queued to ${msg}`);
}, () => error => this.planetMessageService.showMessage(error));
}
@@ -435,9 +435,9 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
center: selected.length > 1 ? 'nations' : 'nation',
nation: selected.length > 1 ? 'communities' : 'community'
}[this.planetType];
- this.planetMessageService.showMessage(`Courses queued to push to ${childType}.`);
+ this.planetMessageService.showMessage($localize`Courses queued to push to ${childType}.`);
this.dialogRef.close();
- }, () => this.planetMessageService.showAlert('There was an error sending these courses'));
+ }, () => this.planetMessageService.showAlert($localize`There was an error sending these courses`));
};
}
@@ -446,7 +446,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
this.courses.data, this.dbName, { selectedIds: this.selection.selected, tagIds: selected, indeterminateIds: indeterminate }
).subscribe(() => {
this.getCourses();
- this.planetMessageService.showMessage('Collections updated');
+ this.planetMessageService.showMessage($localize`Collections updated`);
});
}
diff --git a/src/app/courses/courses.service.ts b/src/app/courses/courses.service.ts
index 5a3ed0cf71..4ce647f08f 100644
--- a/src/app/courses/courses.service.ts
+++ b/src/app/courses/courses.service.ts
@@ -211,8 +211,8 @@ export class CoursesService {
courseIds.push(courseId);
}
return this.userService.updateShelf(courseIds, 'courseIds').pipe(map((res) => {
- const admissionMessage = type === 'resign' ? title + ' successfully removed from myCourses' :
- title + ' added to your dashboard';
+ const admissionMessage = type === 'resign' ? $localize`${title} successfully removed from myCourses` :
+ $localize`${title} added to your dashboard`;
this.planetMessageService.showMessage(admissionMessage);
return res;
}));
@@ -224,8 +224,8 @@ export class CoursesService {
courseAdmissionMany(courseIds, type) {
return this.userService.changeShelf(courseIds, 'courseIds', type).pipe(map(({ shelf, countChanged }) => {
- const prefix = countChanged > 1 ? countChanged + ' courses' : this.getCourseNameFromId(courseIds[courseIds.length - 1]);
- const message = type === 'remove' ? prefix + ' successfully removed from myCourses' : prefix + ' added to your dashboard';
+ 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`;
this.planetMessageService.showMessage(message);
return shelf;
}));
diff --git a/src/app/courses/progress-courses/courses-progress-leader.component.html b/src/app/courses/progress-courses/courses-progress-leader.component.html
index 3b8c7e7e1b..c7fb37a2a0 100644
--- a/src/app/courses/progress-courses/courses-progress-leader.component.html
+++ b/src/app/courses/progress-courses/courses-progress-leader.component.html
@@ -21,7 +21,7 @@
-
+
No Progress record available
diff --git a/src/app/courses/progress-courses/courses-progress-leader.component.ts b/src/app/courses/progress-courses/courses-progress-leader.component.ts
index 8876940071..b700197533 100644
--- a/src/app/courses/progress-courses/courses-progress-leader.component.ts
+++ b/src/app/courses/progress-courses/courses-progress-leader.component.ts
@@ -19,7 +19,7 @@ export class CoursesProgressLeaderComponent implements OnInit, OnDestroy {
course: any;
// Need to define this variable for template which is shared with CoursesProgressLearner
headingStart = '';
- chartLabel = 'Steps';
+ chartLabel = $localize`Steps`;
selectedStep: any;
allChartData: any[] = [];
chartData: any[];
@@ -77,7 +77,7 @@ export class CoursesProgressLeaderComponent implements OnInit, OnDestroy {
onStepChange(value: any) {
this.selectedStep = value;
this.setSingleStep(this.submissions);
- this.chartLabel = 'Quest.';
+ this.chartLabel = $localize`Quest.`;
}
setSubmissions() {
@@ -163,12 +163,12 @@ export class CoursesProgressLeaderComponent implements OnInit, OnDestroy {
this.selectedStep = this.course.steps[courseIndex];
this.setSingleStep(this.submissions);
}
- this.chartLabel = 'Quest.';
+ this.chartLabel = $localize`Quest.`;
}
resetToFullCourse() {
this.setFullCourse(this.submissions);
- this.chartLabel = 'Steps';
+ this.chartLabel = $localize`Steps`;
}
userProgress(user) {
diff --git a/src/app/courses/step-view-courses/courses-step-view.component.html b/src/app/courses/step-view-courses/courses-step-view.component.html
index 1e2b3f723e..2ef0d58f33 100644
--- a/src/app/courses/step-view-courses/courses-step-view.component.html
+++ b/src/app/courses/step-view-courses/courses-step-view.component.html
@@ -64,7 +64,7 @@ Step {{
- {{stepNum}}/{{maxStep}}
+ {{stepNum}}/{{maxStep}}
diff --git a/src/app/dashboard/dashboard-tile.component.html b/src/app/dashboard/dashboard-tile.component.html
index 5adcb2645a..c1b91a9098 100644
--- a/src/app/dashboard/dashboard-tile.component.html
+++ b/src/app/dashboard/dashboard-tile.component.html
@@ -18,7 +18,7 @@
class="dashboard-item"
[ngClass]="{'bg-grey': even, 'cursor-pointer': item.link}"
[routerLink]="item.link"
- i18n-matTooltip [matTooltip]="item.tooltip"
+ [matTooltip]="item.tooltip"
cdkDrag
[cdkDragDisabled]="cardTitle==='myLife'"
#dashboardTile
diff --git a/src/app/dashboard/dashboard-tile.component.ts b/src/app/dashboard/dashboard-tile.component.ts
index 28c5628c8a..dbe54ab674 100644
--- a/src/app/dashboard/dashboard-tile.component.ts
+++ b/src/app/dashboard/dashboard-tile.component.ts
@@ -68,7 +68,7 @@ export class DashboardTileComponent implements AfterViewChecked {
this.dialogPrompt.close();
this.removeMessage(item);
},
- onError: () => this.planetMessageService.showMessage('There was an error removing ' + item.title)
+ onError: () => this.planetMessageService.showMessage($localize`There was an error removing ${item.title}`)
},
changeType: 'leave',
type: 'team',
@@ -78,7 +78,7 @@ export class DashboardTileComponent implements AfterViewChecked {
}
removeMessage(item) {
- this.planetMessageService.showMessage(item.title + ' removed from ' + this.cardTitle);
+ this.planetMessageService.showMessage($localize`${item.title} removed from ${this.cardTitle}`);
}
drop(event: CdkDragDrop) {
@@ -88,7 +88,7 @@ export class DashboardTileComponent implements AfterViewChecked {
this.userService.updateShelf(ids, this.shelfName).subscribe(
() => {},
() => {
- this.planetMessageService.showAlert('There was an error reordering ' + this.cardTitle);
+ this.planetMessageService.showAlert($localize`There was an error reordering ${this.cardTitle}`);
moveItemInArray(this.itemData, event.currentIndex, event.previousIndex);
}
);
diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html
index bb2635e2d6..d082e7e946 100644
--- a/src/app/dashboard/dashboard.component.html
+++ b/src/app/dashboard/dashboard.component.html
@@ -22,7 +22,7 @@ {{visits | number}} Visits
{{visits | number}} Visits
{{visits | number}} Visits
{{visits | number}} Visits
diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts
index 81955e2b73..a9fa17a335 100644
--- a/src/app/dashboard/dashboard.component.ts
+++ b/src/app/dashboard/dashboard.component.ts
@@ -39,11 +39,11 @@ export class DashboardComponent implements OnInit, OnDestroy {
onDestroy$ = new Subject();
myLifeItems: any[] = [
- { firstLine: 'my', title: 'Submissions', link: 'submissions', authorization: 'leader,manager', badge: this.examsCount },
- { firstLine: 'my', title: 'Personals', link: 'myPersonals' },
- { firstLine: 'my', title: 'Achievements', link: 'myAchievements' },
- { firstLine: 'my', title: 'Surveys', link: 'mySurveys', badge: this.surveysCount },
- { firstLine: 'my', title: 'Health', link: 'myHealth' }
+ { firstLine: 'my', title: $localize`Submissions`, link: 'submissions', authorization: 'leader,manager', badge: this.examsCount },
+ { firstLine: 'my', title: $localize`Personals`, link: 'myPersonals' },
+ { firstLine: 'my', title: $localize`Achievements`, link: 'myAchievements' },
+ { firstLine: 'my', title: $localize`Surveys`, link: 'mySurveys', badge: this.surveysCount },
+ { firstLine: 'my', title: $localize`Health`, link: 'myHealth' }
];
constructor(
diff --git a/src/app/exams/exams-add.component.ts b/src/app/exams/exams-add.component.ts
index 286017ae5c..5015c30652 100644
--- a/src/app/exams/exams-add.component.ts
+++ b/src/app/exams/exams-add.component.ts
@@ -37,7 +37,7 @@ export class ExamsAddComponent implements OnInit {
pageType: 'Add' | 'Update' | 'Copy' = 'Add';
courseName = '';
examType: 'exam' | 'survey' = <'exam' | 'survey'>this.route.snapshot.paramMap.get('type') || 'exam';
- successMessage = this.examType === 'survey' ? 'New survey added' : 'New test added';
+ successMessage = this.examType === 'survey' ? $localize`New survey added` : $localize`New test added`;
steps = [];
showFormError = false;
showPreviewError = false;
@@ -97,7 +97,7 @@ export class ExamsAddComponent implements OnInit {
if (this.route.snapshot.url[0].path !== 'update') {
return;
}
- this.successMessage = this.examType === 'survey' ? 'Survey updated successfully' : 'Test updated successfully';
+ this.successMessage = this.examType === 'survey' ? $localize`Survey updated successfully` : $localize`Test updated successfully`;
forkJoin([
this.couchService.get(this.dbName + '/' + this.route.snapshot.paramMap.get('id')),
this.examType === 'survey' ?
diff --git a/src/app/exams/exams-view.component.ts b/src/app/exams/exams-view.component.ts
index d1d40ca326..54e3a67e75 100644
--- a/src/app/exams/exams-view.component.ts
+++ b/src/app/exams/exams-view.component.ts
@@ -70,7 +70,7 @@ export class ExamsViewComponent implements OnInit, OnDestroy {
this.setExamPreview();
},
(err) => {
- this.planetMessageService.showAlert('Preview is not available for this test');
+ this.planetMessageService.showAlert($localize`Preview is not available for this test`);
this.goBack();
}
);
diff --git a/src/app/feedback/feedback-view.component.ts b/src/app/feedback/feedback-view.component.ts
index 0fbcbc9408..e845efd3fe 100644
--- a/src/app/feedback/feedback-view.component.ts
+++ b/src/app/feedback/feedback-view.component.ts
@@ -95,7 +95,7 @@ export class FeedbackViewComponent implements OnInit, OnDestroy {
})
).subscribe(
([ feedback, notificationRes ]) => { this.setFeedback(feedback); },
- error => this.planetMessageService.showAlert('There was an error adding your message')
+ error => this.planetMessageService.showAlert($localize`There was an error adding your message`)
);
}
@@ -108,7 +108,7 @@ export class FeedbackViewComponent implements OnInit, OnDestroy {
));
const notificationDoc = ({ user, userPlanetCode }) => ({
user,
- 'message': 'You have unread messages in feedback',
+ 'message': $localize`You have unread messages in feedback`,
link,
'type': 'feedbackReply',
'priority': 1,
@@ -135,7 +135,7 @@ export class FeedbackViewComponent implements OnInit, OnDestroy {
this.editTitleMode = false;
this.feedback._rev = res.rev;
},
- () => this.planetMessageService.showAlert('There was an error changing title')
+ () => this.planetMessageService.showAlert($localize`There was an error changing title`)
);
}
@@ -158,7 +158,7 @@ export class FeedbackViewComponent implements OnInit, OnDestroy {
closeFeedback(feedback) {
this.feedbackServive.closeFeedback(feedback).subscribe(
() => this.router.navigate([ '/feedback' ]),
- () => this.planetMessageService.showAlert('There was an error closing this feedback.')
+ () => this.planetMessageService.showAlert($localize`There was an error closing this feedback.`)
);
}
@@ -168,7 +168,7 @@ export class FeedbackViewComponent implements OnInit, OnDestroy {
.pipe(switchMap(() => this.getFeedback(feedback.id)), finalize(() => this.dialogsLoadingService.stop()))
.subscribe(
res => this.setFeedback(res),
- error => this.planetMessageService.showAlert('There has been an error opening the feedback.')
+ error => this.planetMessageService.showAlert($localize`There has been an error opening the feedback.`)
);
}
diff --git a/src/app/feedback/feedback.component.ts b/src/app/feedback/feedback.component.ts
index eaa48f54a4..d9c7aaa8d5 100644
--- a/src/app/feedback/feedback.component.ts
+++ b/src/app/feedback/feedback.component.ts
@@ -106,7 +106,7 @@ export class FeedbackComponent implements OnInit, AfterViewInit, OnDestroy {
this.feedback.data = feedbackData.map(feedback => ({ ...feedback, user: this.users.find(u => u.doc.name === feedback.owner) }));
this.emptyData = !this.feedback.data.length;
this.dialogsLoadingService.stop();
- }, (error) => this.message = 'There is a problem of getting data.');
+ }, (error) => this.message = $localize`There is a problem of getting data.`);
}
deleteClick(feedback) {
@@ -132,9 +132,9 @@ export class FeedbackComponent implements OnInit, AfterViewInit, OnDestroy {
// It's safer to remove the item from the array based on its id than to splice based on the index
this.feedback.data = this.feedback.data.filter((fback: any) => data.id !== fback._id);
this.deleteDialog.close();
- this.planetMessageService.showMessage('You have deleted feedback.');
+ this.planetMessageService.showMessage($localize`You have deleted feedback.`);
},
- onError: (error) => this.planetMessageService.showAlert('There is a problem deleting this feedback.')
+ onError: (error) => this.planetMessageService.showAlert($localize`There is a problem deleting this feedback.`)
};
}
diff --git a/src/app/feedback/feedback.directive.ts b/src/app/feedback/feedback.directive.ts
index 4bb443d350..e62e1f87ff 100644
--- a/src/app/feedback/feedback.directive.ts
+++ b/src/app/feedback/feedback.directive.ts
@@ -30,7 +30,7 @@ export class Feedback {
const dialogFieldOptions = [
{
- 'label': 'Is your feedback Urgent?',
+ 'label': $localize`Is your feedback Urgent?`,
'type': 'radio',
'name': 'priority',
'options': [
@@ -40,7 +40,7 @@ const dialogFieldOptions = [
'required': true
},
{
- 'label': 'Feedback Type:',
+ 'label': $localize`Feedback Type:`,
'type': 'radio',
'name': 'type',
'options': [
@@ -53,7 +53,7 @@ const dialogFieldOptions = [
{
'type': 'textarea',
'name': 'message',
- 'placeholder': 'Your Feedback',
+ 'placeholder': $localize`Your Feedback`,
'required': true
}
];
@@ -95,19 +95,19 @@ export class FeedbackDirective {
};
const feedbackUrl = newFeedback.url.substring(0, newFeedback.url.indexOf(';')) || newFeedback.url;
this.couchService.updateDocument('feedback', {
- ...newFeedback, title: newFeedback.type + ' regarding ' + feedbackUrl })
+ ...newFeedback, title: $localize`${newFeedback.type} regarding ${feedbackUrl}` })
.subscribe((data) => {
this.feedbackService.setFeedback();
- this.planetMessageService.showMessage('Thank you, your feedback is submitted!');
+ this.planetMessageService.showMessage($localize`Thank you, your feedback is submitted!`);
},
(error) => {
- this.planetMessageService.showAlert('Error, your feedback cannot be submitted');
+ this.planetMessageService.showAlert($localize`Error, your feedback cannot be submitted`);
});
}
@HostListener('click')
openFeedback() {
- const title = 'Feedback';
+ const title = $localize`Feedback`;
const type = 'feedback';
const fields = dialogFieldOptions;
const formGroup = {
diff --git a/src/app/feedback/feedback.service.ts b/src/app/feedback/feedback.service.ts
index 935098e4e4..f424a54ea5 100644
--- a/src/app/feedback/feedback.service.ts
+++ b/src/app/feedback/feedback.service.ts
@@ -24,7 +24,7 @@ export class FeedbackService {
openFeedback(feedback: any) {
return this.modifyFeedback(
{ ...feedback, closeTime: '', status: 'Reopened' },
- 'You re-opened this feedback.'
+ $localize`You re-opened this feedback.`
);
}
@@ -32,7 +32,7 @@ export class FeedbackService {
closeFeedback(feedback: any) {
return this.modifyFeedback(
{ ...feedback, 'closeTime': this.couchService.datePlaceholder, 'status': 'Closed' },
- 'You closed this feedback.'
+ $localize`You closed this feedback.`
);
}
diff --git a/src/app/health/health-event.component.ts b/src/app/health/health-event.component.ts
index 8ee2f1a998..a6b813a2d2 100644
--- a/src/app/health/health-event.component.ts
+++ b/src/app/health/health-event.component.ts
@@ -68,7 +68,7 @@ export class HealthEventComponent implements OnInit {
]);
})).subscribe(([ [ event ], time ]: [ any[], number ]) => {
if (event !== 'new' && (time - event.updatedDate) > 300000) {
- this.planetMessageService.showAlert('This examination can no longer be changed.');
+ this.planetMessageService.showAlert($localize`This examination can no longer be changed.`);
this.goBack();
return;
}
@@ -117,7 +117,7 @@ export class HealthEventComponent implements OnInit {
}
},
showMainParagraph: false,
- extraMessage: 'The following measurement(s) may be incorrect. Click Cancel to fix or click OK to submit.',
+ extraMessage: $localize`The following measurement(s) may be incorrect. Click Cancel to fix or click OK to submit.`,
showLabels: invalidFields
}
});
diff --git a/src/app/health/health.constants.ts b/src/app/health/health.constants.ts
index ac700bd9e6..1f37311ee3 100644
--- a/src/app/health/health.constants.ts
+++ b/src/app/health/health.constants.ts
@@ -1,25 +1,25 @@
export const conditions = [
- 'Cancer',
- 'Cardiovascular disorders',
- 'Cirrhosis of the liver',
- 'COVID-19',
- 'Diabetes',
- 'Diarrhoea diseases',
- 'Ebola',
- 'Epilepsy',
- 'FGM',
- 'HIV/AIDS',
- 'Influenza',
- 'Ischaemic heat disease',
- 'Malaria',
- 'Malnutrition',
- 'Measles',
- 'Meningitis',
- 'Neonatal sepsis and infections',
- 'Pneumonia',
- 'Stroke',
- 'Trauma',
- 'Tuberculosis'
+ $localize`Cancer`,
+ $localize`Cardiovascular disorders`,
+ $localize`Cirrhosis of the liver`,
+ $localize`COVID-19`,
+ $localize`Diabetes`,
+ $localize`Diarrhoea diseases`,
+ $localize`Ebola`,
+ $localize`Epilepsy`,
+ $localize`FGM`,
+ $localize`HIV/AIDS`,
+ $localize`Influenza`,
+ $localize`Ischaemic heat disease`,
+ $localize`Malaria`,
+ $localize`Malnutrition`,
+ $localize`Measles`,
+ $localize`Meningitis`,
+ $localize`Neonatal sepsis and infections`,
+ $localize`Pneumonia`,
+ $localize`Stroke`,
+ $localize`Trauma`,
+ $localize`Tuberculosis`
];
export const conditionAndTreatmentFields = [
diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html
index 0a41070e51..5ea7e3934f 100644
--- a/src/app/home/home.component.html
+++ b/src/app/home/home.component.html
@@ -3,7 +3,7 @@
- Planet {{planetName}}
+ Planet {{planetName}}
diff --git a/src/app/login/login-form.component.ts b/src/app/login/login-form.component.ts
index 24ef4e1383..7c2d998731 100644
--- a/src/app/login/login-form.component.ts
+++ b/src/app/login/login-form.component.ts
@@ -96,7 +96,7 @@ export class LoginFormComponent {
welcomeNotification(userId) {
const data = {
'user': userId,
- 'message': `Welcome ${userId.replace('org.couchdb.user:', '')} to the Planet Learning`,
+ 'message': $localize`Welcome ${userId.replace('org.couchdb.user:', '')} to the Planet Learning`,
'link': '',
'type': 'register',
'priority': 1,
@@ -127,11 +127,11 @@ export class LoginFormComponent {
switchMap(() => this.couchService.put('shelf/org.couchdb.user:' + name, {}))
).subscribe(
res => {
- this.planetMessageService.showMessage('Welcome to Planet Learning, ' + res.id.replace('org.couchdb.user:', '') + '!');
+ this.planetMessageService.showMessage($localize`Welcome to Planet Learning, ${res.id.replace('org.couchdb.user:', '')}!`);
this.welcomeNotification(res.id);
this.login(this.userForm.value, true);
},
- this.errorHandler('An error occurred please try again')
+ this.errorHandler($localize`An error occurred please try again`)
);
}
@@ -166,12 +166,12 @@ export class LoginFormComponent {
loginError() {
this.couchService.get('_users/org.couchdb.user:' + this.userForm.value.name).subscribe((data: any) => {
- this.errorHandler('Username and/or password do not match')();
+ this.errorHandler($localize`Username and/or password do not match`)();
}, (err) => {
if (err.error.reason === 'missing') {
- this.errorHandler('Member ' + this.userForm.value.name + ' is not registered')();
+ this.errorHandler($localize`Member ${this.userForm.value.name} is not registered`)();
} else {
- this.errorHandler('There was an error connecting to Planet')();
+ this.errorHandler($localize`There was an error connecting to Planet`)();
}
});
}
@@ -186,7 +186,7 @@ export class LoginFormComponent {
sendNotifications(userName, addedMember) {
const data = {
'user': 'org.couchdb.user:' + userName,
- 'message': `New member ${addedMember} has joined.`,
+ 'message': $localize`New member ${addedMember} has joined.`,
'link': '/manager/users/profile/' + addedMember,
'type': 'new user',
'priority': 1,
@@ -204,9 +204,9 @@ export class LoginFormComponent {
return forkJoin(obsArr).pipe(catchError(error => {
// 401 is for Unauthorized
if (error.status === 401) {
- this.planetMessageService.showMessage('Can not login to ' + msg + ' planet.');
+ this.planetMessageService.showMessage($localize`Can not login to ${msg} planet.`);
} else {
- this.planetMessageService.showMessage('Error connecting to ' + msg + '.');
+ this.planetMessageService.showMessage($localize`Error connecting to ${msg}.`);
}
return of(error);
}));
diff --git a/src/app/logs-myplanet/logs-myplanet.component.ts b/src/app/logs-myplanet/logs-myplanet.component.ts
index 0971b7493b..c71a58706a 100644
--- a/src/app/logs-myplanet/logs-myplanet.component.ts
+++ b/src/app/logs-myplanet/logs-myplanet.component.ts
@@ -19,7 +19,7 @@ export class LogsMyPlanetComponent implements OnInit {
searchValue = '';
planetType = this.stateService.configuration.planetType;
get childType() {
- return this.planetType === 'center' ? 'Community' : 'Nation';
+ return this.planetType === 'center' ? $localize`Community` : $localize`Nation`;
}
constructor(
@@ -61,7 +61,7 @@ export class LogsMyPlanetComponent implements OnInit {
);
this.apklogs = this.allPlanets;
this.isEmpty = areNoChildren(this.apklogs);
- }, (error) => this.planetMessageService.showAlert('There was a problem getting myPlanet activity.'));
+ }, (error) => this.planetMessageService.showAlert($localize`There was a problem getting myPlanet activity.`));
}
}
diff --git a/src/app/manager-dashboard/certifications/certifications-add.component.ts b/src/app/manager-dashboard/certifications/certifications-add.component.ts
index 180f0b65a3..cf6200b1f0 100644
--- a/src/app/manager-dashboard/certifications/certifications-add.component.ts
+++ b/src/app/manager-dashboard/certifications/certifications-add.component.ts
@@ -80,7 +80,7 @@ export class CertificationsAddComponent implements OnInit, AfterViewChecked {
...this.certificateInfo, ...this.certificateForm.value, courseIds: this.courseIds
}).subscribe((res) => {
this.certificateInfo = { _id: res.id, _rev: res.rev };
- this.planetMessageService.showMessage(this.pageType === 'Add' ? 'New certification added' : 'Certification updated');
+ this.planetMessageService.showMessage(this.pageType === 'Add' ? $localize`New certification added` : $localize`Certification updated`);
if (reroute) {
this.goBack();
}
diff --git a/src/app/manager-dashboard/certifications/certifications.service.ts b/src/app/manager-dashboard/certifications/certifications.service.ts
index 8ad0304fe7..0c6827995d 100644
--- a/src/app/manager-dashboard/certifications/certifications.service.ts
+++ b/src/app/manager-dashboard/certifications/certifications.service.ts
@@ -45,9 +45,9 @@ export class CertificationsService {
onNext: (data) => {
callback(data.res);
this.deleteDialog.close();
- this.planetMessageService.showMessage(`You have deleted the ${displayName} certification`);
+ this.planetMessageService.showMessage($localize`You have deleted the ${displayName} certification`);
},
- onError: (error) => this.planetMessageService.showAlert('There was a problem deleting this certification')
+ onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this certification`)
};
}
diff --git a/src/app/manager-dashboard/manager-dashboard.component.ts b/src/app/manager-dashboard/manager-dashboard.component.ts
index 21b9c1ad53..1660f4073a 100644
--- a/src/app/manager-dashboard/manager-dashboard.component.ts
+++ b/src/app/manager-dashboard/manager-dashboard.component.ts
@@ -99,9 +99,9 @@ export class ManagerDashboardComponent implements OnInit, OnDestroy {
resendConfig() {
const configuration = this.planetConfiguration;
this.configurationService.updateConfiguration({ ...configuration, registrationRequest: 'pending' }).subscribe(null,
- error => this.planetMessageService.showAlert('An error occurred please try again.'),
+ error => this.planetMessageService.showAlert($localize`An error occurred please try again.`),
() => {
- this.planetMessageService.showMessage('Registration request has been sent successfully.');
+ this.planetMessageService.showMessage($localize`Registration request has been sent successfully.`);
this.showResendConfiguration = false;
}
);
@@ -164,7 +164,7 @@ export class ManagerDashboardComponent implements OnInit, OnDestroy {
this.deleteCommunityDialog.close();
this.router.navigate([ '/login/configuration' ]);
},
- onError: error => this.planetMessageService.showAlert('An error occurred please try again.')
+ onError: error => this.planetMessageService.showAlert($localize`An error occurred please try again.`)
};
}
@@ -226,7 +226,7 @@ export class ManagerDashboardComponent implements OnInit, OnDestroy {
break;
}
this.couchService.post(db + '/_bulk_docs', { docs: dataUpdate }).subscribe(res => {
- this.planetMessageService.showMessage('Send on accept list updated');
+ this.planetMessageService.showMessage($localize`Send on accept list updated`);
});
this.dialogRef.close();
};
@@ -261,8 +261,8 @@ export class ManagerDashboardComponent implements OnInit, OnDestroy {
]);
})).subscribe((res) => {
this.getSatellitePin();
- this.planetMessageService.showMessage('Pin reset successfully');
- }, (error) => this.planetMessageService.showAlert('Error to reset pin'));
+ this.planetMessageService.showMessage($localize`Pin reset successfully`);
+ }, (error) => this.planetMessageService.showAlert($localize`Error to reset pin`));
}
setVersions() {
diff --git a/src/app/manager-dashboard/manager-fetch.component.ts b/src/app/manager-dashboard/manager-fetch.component.ts
index cd4d53e68f..18ac0b8462 100644
--- a/src/app/manager-dashboard/manager-fetch.component.ts
+++ b/src/app/manager-dashboard/manager-fetch.component.ts
@@ -91,7 +91,7 @@ export class ManagerFetchComponent implements OnInit, AfterViewInit {
res !== 'no replicators' ?
this.couchService.post('send_items/_bulk_docs', { docs: deleteItems }, { domain: this.planetConfiguration.parentDomain }) :
of({})
- )).subscribe(() => this.planetMessageService.showMessage('Resources/Courses are being fetched'));
+ )).subscribe(() => this.planetMessageService.showMessage($localize`Resources/Courses are being fetched`));
}
diff --git a/src/app/manager-dashboard/reports/pending-table.component.ts b/src/app/manager-dashboard/reports/pending-table.component.ts
index c23ba84eaa..665bf878d3 100644
--- a/src/app/manager-dashboard/reports/pending-table.component.ts
+++ b/src/app/manager-dashboard/reports/pending-table.component.ts
@@ -42,7 +42,7 @@ export class PendingTableComponent implements OnChanges, AfterViewInit {
const { _id: id, _rev: rev } = item;
this.couchService.delete(`send_items/${id}?rev=${rev}`).subscribe(
() => this.requestUpdate.emit(),
- () => this.planetMessageService.showAlert('There was a problem deleting item')
+ () => this.planetMessageService.showAlert($localize`There was a problem deleting item`)
);
}
}
diff --git a/src/app/manager-dashboard/reports/reports-detail.component.ts b/src/app/manager-dashboard/reports/reports-detail.component.ts
index bc85dc6e12..77792daa88 100644
--- a/src/app/manager-dashboard/reports/reports-detail.component.ts
+++ b/src/app/manager-dashboard/reports/reports-detail.component.ts
@@ -314,10 +314,10 @@ export class ReportsDetailComponent implements OnInit, OnDestroy {
return ({
data: {
datasets: [
- datasetObject('Male', xyChartData(genderFilter('male'), unique), styleVariables.primaryLighter),
- datasetObject('Female', xyChartData(genderFilter('female'), unique), styleVariables.accentLighter),
- datasetObject('Did not specify', xyChartData(genderFilter(undefined), unique), styleVariables.grey),
- datasetObject('Total', xyChartData(totals(), unique), styleVariables.primary)
+ datasetObject($localize`Male`, xyChartData(genderFilter('male'), unique), styleVariables.primaryLighter),
+ datasetObject($localize`Female`, xyChartData(genderFilter('female'), unique), styleVariables.accentLighter),
+ datasetObject($localize`Did not specify`, xyChartData(genderFilter(undefined), unique), styleVariables.grey),
+ datasetObject($localize`Total`, xyChartData(totals(), unique), styleVariables.primary)
]
},
labels: months.map(month => monthDataLabels(month))
@@ -353,22 +353,22 @@ export class ReportsDetailComponent implements OnInit, OnDestroy {
const minDate = new Date(this.activityService.minTime(this.loginActivities.data, 'loginTime')).setHours(0, 0, 0, 0);
const commonProps = { 'type': 'date', 'required': true, 'min': new Date(minDate), 'max': new Date(this.today) };
const teamOptions = [
- { name: 'All Members', value: 'All' },
+ { name: $localize`All Members`, value: 'All' },
...this.teams.team.map(t => ({ name: t.name, value: t })),
...this.teams.enterprise.map(t => ({ name: t.name, value: t }))
];
const commonFields = [
- { 'placeholder': 'From', 'name': 'startDate', ...commonProps },
- { 'placeholder': 'To', 'name': 'endDate', ...commonProps }
+ { 'placeholder': $localize`From`, 'name': 'startDate', ...commonProps },
+ { 'placeholder': $localize`To`, 'name': 'endDate', ...commonProps }
];
- const teamField = { 'placeholder': 'Team', 'name': 'team', 'options': teamOptions, 'type': 'selectbox' };
+ const teamField = { 'placeholder': $localize`Team`, 'name': 'team', 'options': teamOptions, 'type': 'selectbox' };
const fields = [ ...commonFields, ...(reportType === 'health' ? [] : [ teamField ]) ];
const formGroup = {
startDate: this.dateFilterForm.controls.startDate.value,
endDate: [ this.dateFilterForm.controls.endDate.value, CustomValidators.endDateValidator() ],
team: reportType === 'health' ? 'All' : this.selectedTeam
};
- this.dialogsFormService.openDialogsForm('Select Date Range for Data Export', fields, formGroup, {
+ this.dialogsFormService.openDialogsForm($localize`Select Date Range for Data Export`, fields, formGroup, {
onSubmit: (formValue: any) => {
this.getTeamMembers(formValue.team).subscribe(members => {
this.exportCSV(reportType, { startDate: formValue.startDate, endDate: formValue.endDate }, members);
@@ -383,7 +383,7 @@ export class ReportsDetailComponent implements OnInit, OnDestroy {
this.csvService.exportCSV({
data: filterByMember(filterByDate(this.loginActivities.data, 'loginTime', dateRange), members)
.map(activity => ({ ...activity, androidId: activity.androidId || '' })),
- title: 'Member Visits'
+ title: $localize`Member Visits`
});
break;
case 'resourceViews':
@@ -427,10 +427,10 @@ export class ReportsDetailComponent implements OnInit, OnDestroy {
'health': this.healthComponent && this.healthComponent.examinations
}[reportType];
const title = {
- 'resourceViews': 'Resource Views',
- 'courseViews': 'Course Views',
- 'health': 'Community Health',
- 'stepCompletions': 'Courses Progress' }[reportType];
+ 'resourceViews': $localize`Resource Views`,
+ 'courseViews': $localize`Course Views`,
+ 'health': $localize`Community Health`,
+ 'stepCompletions': $localize`Courses Progress` }[reportType];
this.csvService.exportCSV({
data: filterByMember(filterByDate(data, reportType === 'health' ? 'date' : 'time', dateRange), members)
.map(activity => ({ ...activity, androidId: activity.androidId || '', deviceName: activity.deviceName || '' })),
diff --git a/src/app/manager-dashboard/reports/reports-myplanet.component.ts b/src/app/manager-dashboard/reports/reports-myplanet.component.ts
index c45147253e..3d5669ca23 100755
--- a/src/app/manager-dashboard/reports/reports-myplanet.component.ts
+++ b/src/app/manager-dashboard/reports/reports-myplanet.component.ts
@@ -75,7 +75,7 @@ export class ReportsMyPlanetComponent implements OnInit {
);
this.planets = this.allPlanets;
this.isEmpty = areNoChildren(this.planets);
- }, (error) => this.planetMessageService.showAlert('There was a problem getting myPlanet activity.'));
+ }, (error) => this.planetMessageService.showAlert($localize`There was a problem getting myPlanet activity.`));
}
myPlanetRequest(hubId) {
diff --git a/src/app/manager-dashboard/reports/reports-pending.component.ts b/src/app/manager-dashboard/reports/reports-pending.component.ts
index af8bc0b04c..d6f4b10204 100644
--- a/src/app/manager-dashboard/reports/reports-pending.component.ts
+++ b/src/app/manager-dashboard/reports/reports-pending.component.ts
@@ -49,7 +49,7 @@ export class ReportsPendingComponent implements OnInit {
this.planets = attachNamesToPlanets(planets).filter((planet: any) => planet.doc.docType !== 'parentName');
this.data = data;
this.filterData();
- }, (error) => this.planetMessageService.showAlert('There was a problem getting ' + this.childType));
+ }, (error) => this.planetMessageService.showAlert($localize`There was a problem getting ${this.childType}`));
}
}
diff --git a/src/app/manager-dashboard/reports/reports.component.ts b/src/app/manager-dashboard/reports/reports.component.ts
index 0232907dd5..2a4acaae90 100644
--- a/src/app/manager-dashboard/reports/reports.component.ts
+++ b/src/app/manager-dashboard/reports/reports.component.ts
@@ -74,7 +74,7 @@ export class ReportsComponent implements OnInit, OnDestroy {
userVisits: this.findByPlanet(loginActivities, planet.code),
...this.activityService.mostRecentAdminActivities(planet, [], adminActivities)
})), this.hubs);
- }, (error) => this.planetMessageService.showAlert('There was a problem getting Activity Logs'));
+ }, (error) => this.planetMessageService.showAlert($localize`There was a problem getting Activity Logs`));
}
arrangePlanetData(planetDocs, hubData) {
diff --git a/src/app/manager-dashboard/reports/reports.service.ts b/src/app/manager-dashboard/reports/reports.service.ts
index ab5c598b03..c0d4718779 100644
--- a/src/app/manager-dashboard/reports/reports.service.ts
+++ b/src/app/manager-dashboard/reports/reports.service.ts
@@ -210,7 +210,7 @@ export class ReportsService {
}
planetTypeText(planetType) {
- return planetType === 'nation' ? 'Nation' : 'Community';
+ return planetType === 'nation' ? $localize`Nation` : $localize`Community`;
}
viewPlanetDetails(planet) {
@@ -219,7 +219,7 @@ export class ReportsService {
autoFocus: false,
data: {
allData: planet,
- title: `${this.planetTypeText(planet.planetType)} Details`
+ title: $localize`${this.planetTypeText(planet.planetType)} Details`
}
});
}
diff --git a/src/app/manager-dashboard/reports/reports.utils.ts b/src/app/manager-dashboard/reports/reports.utils.ts
index 52dc0fe55a..beefd9b174 100644
--- a/src/app/manager-dashboard/reports/reports.utils.ts
+++ b/src/app/manager-dashboard/reports/reports.utils.ts
@@ -79,11 +79,11 @@ export const datasetObject = (label, data, backgroundColor) => ({ label, data, b
export const titleOfChartName = (chartName: string) => {
const chartNames = {
- resourceViewChart: 'Resource Views by Month',
- courseViewChart: 'Course Views by Month',
- visitChart: 'Total Member Visits by Month',
- uniqueVisitChart: 'Unique Member Visits by Month',
- stepCompletedChart: 'Steps Completed by Month'
+ resourceViewChart: $localize`Resource Views by Month`,
+ courseViewChart: $localize`Course Views by Month`,
+ visitChart: $localize`Total Member Visits by Month`,
+ uniqueVisitChart: $localize`Unique Member Visits by Month`,
+ stepCompletedChart: $localize`Steps Completed by Month`
};
return chartNames[chartName];
};
diff --git a/src/app/manager-dashboard/requests/requests-table.component.ts b/src/app/manager-dashboard/requests/requests-table.component.ts
index aef3c5aa6e..0d5bcf7b0c 100644
--- a/src/app/manager-dashboard/requests/requests-table.component.ts
+++ b/src/app/manager-dashboard/requests/requests-table.component.ts
@@ -108,7 +108,7 @@ export class RequestsTableComponent implements OnChanges, AfterViewInit, OnDestr
this.requestUpdate.emit();
this.editDialog.close();
},
- onError: (error) => this.planetMessageService.showAlert('Planet was not accepted')
+ onError: (error) => this.planetMessageService.showAlert($localize`Planet was not accepted`)
};
}
}
@@ -131,7 +131,7 @@ export class RequestsTableComponent implements OnChanges, AfterViewInit, OnDestr
this.requestUpdate.emit();
this.editDialog.close();
},
- onError: (error) => this.planetMessageService.showAlert('There was a problem deleting this community')
+ onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this community`)
};
}
@@ -208,8 +208,8 @@ export class RequestsTableComponent implements OnChanges, AfterViewInit, OnDestr
openEditChildNameDialog(planet) {
const exceptions = [ planet.nameDoc ? planet.nameDoc.name : planet.doc.name ];
this.dialogsFormService.openDialogsForm(
- `Edit ${this.reportsService.planetTypeText(planet.doc.planetType)} Name`,
- [ { 'label': 'Name', 'type': 'textbox', 'name': 'name', 'placeholder': 'Name', 'required': true } ],
+ $localize`Edit ${this.reportsService.planetTypeText(planet.doc.planetType)} Name`,
+ [ { 'label': $localize`Name`, 'type': 'textbox', 'name': 'name', 'placeholder': $localize`Name`, 'required': true } ],
this.fb.group({ name: [
planet.nameDoc ? planet.nameDoc.name : planet.doc.name,
CustomValidators.required,
@@ -229,10 +229,10 @@ export class RequestsTableComponent implements OnChanges, AfterViewInit, OnDestr
finalize(() => this.dialogsLoadingService.stop())
).subscribe(() => {
this.dialogsFormService.closeDialogsForm();
- this.planetMessageService.showMessage(`${this.reportsService.planetTypeText(doc.planetType)} name updated.`);
+ this.planetMessageService.showMessage($localize`${this.reportsService.planetTypeText(doc.planetType)} name updated.`);
this.requestUpdate.emit();
},
- () => this.planetMessageService.showAlert(`There was an error updating ${this.reportsService.planetTypeText(doc.planetType)} name`));
+ () => this.planetMessageService.showAlert($localize`There was an error updating ${this.reportsService.planetTypeText(doc.planetType)} name`));
};
}
diff --git a/src/app/manager-dashboard/requests/requests.component.ts b/src/app/manager-dashboard/requests/requests.component.ts
index ec6cca30ee..0ac6e8fdbb 100644
--- a/src/app/manager-dashboard/requests/requests.component.ts
+++ b/src/app/manager-dashboard/requests/requests.component.ts
@@ -32,7 +32,7 @@ export class RequestsComponent implements OnInit, OnDestroy {
onDestroy$ = new Subject();
planetType = this.stateService.configuration.planetType;
get childType() {
- return this.planetType === 'nation' ? 'Network' : 'Region';
+ return this.planetType === 'nation' ? $localize`Network` : $localize`Region`;
}
constructor(
@@ -90,18 +90,18 @@ export class RequestsComponent implements OnInit, OnDestroy {
this.hubs = hubs;
this.data = attachNamesToPlanets(data);
this.filterData(search);
- }, (error) => this.planetMessageService.showAlert('There was a problem getting ' + this.childType));
+ }, (error) => this.planetMessageService.showAlert($localize`There was a problem getting ${this.childType}`));
}
addHubClick() {
const type = this.childType;
this.dialogsFormService.confirm(
- 'Add ' + type,
+ $localize`Add ${type}`,
[
- { placeholder: 'Name', name: 'name', required: true, type: 'textbox' },
- { type: 'selectbox', name: 'planetId', placeholder: 'Planet', required: false,
+ { placeholder: $localize`Name`, name: 'name', required: true, type: 'textbox' },
+ { type: 'selectbox', name: 'planetId', placeholder: $localize`Planet`, required: false,
'options': [
- { name: 'Select Planet', value: '' },
+ { name: $localize`Select Planet`, value: '' },
...this.sandboxPlanets.map(p => ({ name: p.nameDoc ? p.nameDoc.name : p.doc.name, value: p.doc._id }))
]
}
@@ -113,10 +113,10 @@ export class RequestsComponent implements OnInit, OnDestroy {
).pipe(switchMap((response: any) => response !== undefined ? this.couchService.post('hubs', { ...response, spokes: [] }) : of())
).subscribe(
() => {
- this.planetMessageService.showMessage(type + ' Added');
+ this.planetMessageService.showMessage($localize`${type} Added`);
this.getCommunityList();
},
- () => this.planetMessageService.showAlert('There was an error adding ' + type)
+ () => this.planetMessageService.showAlert($localize`There was an error adding ${type}`)
);
}
diff --git a/src/app/manager-dashboard/sync.directive.ts b/src/app/manager-dashboard/sync.directive.ts
index bd03f324cd..711c4963ba 100755
--- a/src/app/manager-dashboard/sync.directive.ts
+++ b/src/app/manager-dashboard/sync.directive.ts
@@ -59,7 +59,7 @@ export class SyncDirective {
}),
switchMap(res => this.managerService.addAdminLog('sync'))
).subscribe(data => {
- this.planetMessageService.showMessage('Syncing started');
+ this.planetMessageService.showMessage($localize`Syncing started`);
this.syncComplete.emit();
}, error => this.planetMessageService.showMessage(error.error ? error.error.reason : error));
}
diff --git a/src/app/meetups/add-meetups/meetups-add.component.ts b/src/app/meetups/add-meetups/meetups-add.component.ts
index c6880f0955..2ee34814f8 100644
--- a/src/app/meetups/add-meetups/meetups-add.component.ts
+++ b/src/app/meetups/add-meetups/meetups-add.component.ts
@@ -142,7 +142,7 @@ export class MeetupsAddComponent implements OnInit {
})
).subscribe((res) => {
this.goBack(res);
- this.planetMessageService.showMessage(meetupInfo.title + ' Updated Successfully');
+ this.planetMessageService.showMessage($localize`${meetupInfo.title} Updated Successfully`);
}, (err) => {
// Connect to an error display component to show user that an error has occurred
console.log(err);
@@ -156,7 +156,7 @@ export class MeetupsAddComponent implements OnInit {
'endDate': Date.parse(meetupInfo.endDate),
}).subscribe((res) => {
this.goBack(res);
- this.planetMessageService.showMessage(meetupInfo.title + ' Added');
+ this.planetMessageService.showMessage($localize`${meetupInfo.title} Added`);
}, (err) => console.log(err));
}
@@ -205,7 +205,7 @@ export class MeetupsAddComponent implements OnInit {
meetupChangeNotifications(users, meetupInfo, meetupId) {
return { docs: users.map((user) => ({
'user': user._id,
- 'message': `"${meetupInfo.title}" has been updated.`,
+ 'message': $localize`"${meetupInfo.title}" has been updated.`,
'link': '/meetups/view/' + meetupId,
'item': meetupId,
'type': 'meetup',
diff --git a/src/app/meetups/meetups.component.ts b/src/app/meetups/meetups.component.ts
index 8616b8b66a..e42f05bfd2 100644
--- a/src/app/meetups/meetups.component.ts
+++ b/src/app/meetups/meetups.component.ts
@@ -1,8 +1,8 @@
import { Component, OnInit, ViewChild, AfterViewInit, OnDestroy } from '@angular/core';
import { CouchService } from '../shared/couchdb.service';
-import { MatDialog } from '@angular/material/dialog';
-import { MatPaginator, PageEvent } from '@angular/material/paginator';
-import { MatSort } from '@angular/material/sort';
+import { MatDialog } from '@angular/material/dialog';
+import { MatPaginator, PageEvent } from '@angular/material/paginator';
+import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { DialogsPromptComponent } from '../shared/dialogs/dialogs-prompt.component';
import { PlanetMessageService } from '../shared/planet-message.service';
@@ -145,9 +145,9 @@ export class MeetupsComponent implements OnInit, AfterViewInit, OnDestroy {
this.meetupService.updateMeetups();
this.selection.clear();
this.deleteDialog.close();
- this.planetMessageService.showMessage('You have deleted selected meetups');
+ this.planetMessageService.showMessage($localize`You have deleted selected meetups`);
},
- onError: (error) => this.planetMessageService.showAlert('There was a problem deleting these meetups.')
+ onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting these meetups.`)
};
}
@@ -180,13 +180,13 @@ export class MeetupsComponent implements OnInit, AfterViewInit, OnDestroy {
const meetupDate = (meetup.endDate || meetup.startDate);
if ((meetupDate < this.dateNow && meetup.participate) || (meetupDate > this.dateNow)) {
this.meetupService.attendMeetup(meetup._id, meetup.participate).subscribe((res) => {
- const msg = res.participate ? 'left' : 'joined';
+ const msg = res.participate ? $localize`left` : $localize`joined`;
meetup.participate = !res.participate;
this.countSelectedShelf(this.selection.selected);
- this.planetMessageService.showMessage('You have ' + msg + ' meetup.');
+ this.planetMessageService.showMessage($localize`You have ${msg} meetup.`);
});
} else {
- this.planetMessageService.showMessage('You cannot join an old meetup.');
+ this.planetMessageService.showMessage($localize`You cannot join an old meetup.`);
}
}
diff --git a/src/app/meetups/meetups.service.ts b/src/app/meetups/meetups.service.ts
index 12350d18bf..91bc1b54ed 100644
--- a/src/app/meetups/meetups.service.ts
+++ b/src/app/meetups/meetups.service.ts
@@ -78,7 +78,7 @@ export class MeetupService {
attendMeetups(meetupIds, type) {
return this.userService.changeShelf(meetupIds, 'meetupIds', type).pipe(map(({ shelf, countChanged }) => {
const message = type === 'remove' ?
- 'You have left ' + countChanged + ' meetups' : 'You have joined ' + countChanged + ' meetups';
+ $localize`You have left ${countChanged} meetups` : $localize`You have joined ${countChanged} meetups`;
this.planetMessageService.showMessage(message);
return shelf;
}));
@@ -115,9 +115,9 @@ export class MeetupService {
onNext: (data) => {
callback(data.res);
this.deleteDialog.close();
- this.planetMessageService.showMessage(`You have deleted the ${displayName ? `${displayName} event` : 'selected events'}`);
+ this.planetMessageService.showMessage($localize`You have deleted the ${displayName ? `${displayName} event` : 'selected events'}`);
},
- onError: (error) => this.planetMessageService.showAlert('There was a problem deleting this meetup')
+ onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this meetup`)
};
}
diff --git a/src/app/meetups/view-meetups/meetups-view.component.ts b/src/app/meetups/view-meetups/meetups-view.component.ts
index 84c6e1b435..fe35629c6a 100644
--- a/src/app/meetups/view-meetups/meetups-view.component.ts
+++ b/src/app/meetups/view-meetups/meetups-view.component.ts
@@ -96,9 +96,9 @@ export class MeetupsViewComponent implements OnInit, OnDestroy {
joinMeetup() {
this.meetupService.attendMeetup(this.meetupDetail._id, this.meetupDetail.participate).subscribe((res) => {
- const msg = res.participate ? 'left' : 'joined';
+ const msg = res.participate ? $localize`left` : $localize`joined`;
this.meetupDetail.participate = !res.participate;
- this.planetMessageService.showMessage('You have ' + msg + ' meetup.');
+ this.planetMessageService.showMessage($localize`You have ${msg} meetup.`);
this.fixEnrolledList(res.participate, this.userService.get().name);
});
}
@@ -129,14 +129,14 @@ export class MeetupsViewComponent implements OnInit, OnDestroy {
});
this.couchService.updateDocument('notifications/_bulk_docs', { docs: invites }).subscribe(res => {
this.listDialogRef.close();
- this.planetMessageService.showMessage('Invitation' + (invites.length > 1 ? 's' : '') + ' sent successfully');
+ this.planetMessageService.showMessage($localize`Invitation${(invites.length > 1 ? 's' : '')} sent successfully`);
});
}
inviteNotification(userId, meetupDetail) {
return {
'user': userId,
- 'message': `${this.userService.get().name} would like you to join "${meetupDetail.title}" meetup
+ 'message': $localize`${this.userService.get().name} would like you to join "${meetupDetail.title}" meetup
${(meetupDetail.meetupLocation ? ' at ' + meetupDetail.meetupLocation : '')}`,
'link': this.router.url,
'item': meetupDetail._id,
diff --git a/src/app/news/news-list-item.component.ts b/src/app/news/news-list-item.component.ts
index 02409054d2..b60ef0efec 100644
--- a/src/app/news/news-list-item.component.ts
+++ b/src/app/news/news-list-item.component.ts
@@ -69,8 +69,8 @@ export class NewsListItemComponent implements OnChanges, AfterViewChecked {
addReply(news) {
const label = this.formLabel(news);
this.updateNews.emit({
- title: `Reply to ${label}`,
- placeholder: `Your ${label}`,
+ title: $localize`Reply to ${label}`,
+ placeholder: $localize`Your ${label}`,
initialValue: '',
news: {
replyTo: news._id,
@@ -91,7 +91,7 @@ export class NewsListItemComponent implements OnChanges, AfterViewChecked {
const link = this.router.url;
const notification = {
user: userId,
- 'message': `${replyBy} replied to your ${news.viewableBy === 'community' ? 'community ' : ''}message.`,
+ 'message': $localize`${replyBy} replied to your ${news.viewableBy === 'community' ? 'community ' : ''}message.`,
link,
'priority': 1,
'type': 'replyMessage',
@@ -105,15 +105,15 @@ export class NewsListItemComponent implements OnChanges, AfterViewChecked {
editNews(news) {
const label = this.formLabel(news);
this.updateNews.emit({
- title: `Edit ${label}`,
- placeholder: `Your ${label}`,
+ title: $localize`Edit ${label}`,
+ placeholder: $localize`Your ${label}`,
initialValue: news.message,
news
});
}
formLabel(news) {
- return news.viewableBy === 'teams' ? 'Message' : 'Story';
+ return news.viewableBy === 'teams' ? $localize`Message` : $localize`Story`;
}
showReplies(news) {
diff --git a/src/app/news/news-list.component.ts b/src/app/news/news-list.component.ts
index b62e6f185b..4f01e30643 100644
--- a/src/app/news/news-list.component.ts
+++ b/src/app/news/news-list.component.ts
@@ -22,7 +22,7 @@ import { dedupeShelfReduce } from '../shared/utils';
export class NewsListComponent implements OnChanges {
@Input() items: any[] = [];
- @Input() editSuccessMessage = 'News has been updated successfully.';
+ @Input() editSuccessMessage = $localize`News has been updated successfully.`;
@Input() viewableBy = 'community';
@Input() viewableId: string;
@Input() editable = true;
@@ -98,7 +98,7 @@ export class NewsListComponent implements OnChanges {
postNews(oldNews, newNews) {
this.newsService.postNews(
{ ...oldNews, ...newNews },
- oldNews._id ? this.editSuccessMessage : 'Reply has been posted successfully.'
+ oldNews._id ? this.editSuccessMessage : $localize`Reply has been posted successfully.`
).subscribe(() => {
this.dialogsFormService.closeDialogsForm();
this.dialogsLoadingService.stop();
@@ -129,7 +129,7 @@ export class NewsListComponent implements OnChanges {
this.deleteDialog.close();
},
onError: (error) => {
- this.planetMessageService.showAlert('There was a problem deleting this news.');
+ this.planetMessageService.showAlert($localize`There was a problem deleting this news.`);
}
};
}
@@ -155,7 +155,7 @@ export class NewsListComponent implements OnChanges {
const labels = action === 'remove' ?
news.labels.filter(existingLabel => existingLabel !== label) :
[ ...(news.labels || []), label ].reduce(dedupeShelfReduce, []);
- this.newsService.postNews({ ...news, labels }, `Label ${action === 'remove' ? 'removed' : 'added'}`).subscribe();
+ this.newsService.postNews({ ...news, labels }, $localize`Label ${action === 'remove' ? 'removed' : 'added'}`).subscribe();
}
trackById(index, item) {
diff --git a/src/app/news/news.service.ts b/src/app/news/news.service.ts
index 7b4f577d2b..af6a20d0ad 100644
--- a/src/app/news/news.service.ts
+++ b/src/app/news/news.service.ts
@@ -54,7 +54,7 @@ export class NewsService {
return ((item.viewIn || []).find(view => view._id === viewId) || {}).sharedDate;
}
- postNews(post, successMessage = 'Thank you for submitting your news', isMessageEdit = true) {
+ postNews(post, successMessage = $localize`Thank you for submitting your news`, isMessageEdit = true) {
const configuration = this.stateService.configuration;
const message = typeof post.message === 'string' ? post.message : post.message.text;
const images = this.createImagesArray(post, message);
@@ -76,7 +76,7 @@ export class NewsService {
}
deleteNews(post) {
- return this.postNews({ ...post, _deleted: true }, 'Post deleted');
+ return this.postNews({ ...post, _deleted: true }, $localize`Post deleted`);
}
createImagesArray(post, message) {
@@ -108,7 +108,7 @@ export class NewsService {
...newPlanets
]
},
- 'News has been successfully shared',
+ $localize`News has been successfully shared`,
false
);
}
diff --git a/src/app/notifications/notifications.component.html b/src/app/notifications/notifications.component.html
index 86086b2ed2..ea8e32ab06 100644
--- a/src/app/notifications/notifications.component.html
+++ b/src/app/notifications/notifications.component.html
@@ -4,7 +4,7 @@
-
+
{{option}}
diff --git a/src/app/notifications/notifications.service.ts b/src/app/notifications/notifications.service.ts
index 91b0c9c58e..8c636c93d9 100644
--- a/src/app/notifications/notifications.service.ts
+++ b/src/app/notifications/notifications.service.ts
@@ -22,7 +22,7 @@ export class NotificationsService {
.map(notification => ({ ...notification, status: 'read' }));
this.couchService.bulkDocs('notifications', unreadArray).subscribe(() => {
this.userService.setNotificationStateChange();
- }, (err) => this.planetMessageService.showAlert('There was a problem marking all as read'));
+ }, (err) => this.planetMessageService.showAlert($localize`There was a problem marking all as read`));
}
sendNotificationToUser(notifications: any): Observable {
diff --git a/src/app/resources/resources-add.component.ts b/src/app/resources/resources-add.component.ts
index cbe4b82412..48e6cecfab 100644
--- a/src/app/resources/resources-add.component.ts
+++ b/src/app/resources/resources-add.component.ts
@@ -182,12 +182,12 @@ export class ResourcesAddComponent implements OnInit {
// Start with empty object so this.resourceForm.value does not change
const newResource = Object.assign({}, existingData, this.resourceForm.value, resource);
const message = newResource.title +
- (this.pageType === 'Update' || this.existingResource.doc ? ' Updated Successfully' : ' Added');
+ (this.pageType === 'Update' || this.existingResource.doc ? $localize` Updated Successfully` : $localize` Added`);
const currentTags = (this.existingResource.tags || []).map(tag => tag._id);
if (JSON.stringify(existingData) !== JSON.stringify(newResource) || !deepEqual(currentTags, this.tags.value)) {
this.updateResource(newResource, file).subscribe(
(resourceRes) => this.afterResourceUpdate(message, resourceRes),
- (err) => this.planetMessageService.showAlert('There was an error with this resource')
+ (err) => this.planetMessageService.showAlert($localize`There was an error with this resource`)
);
} else {
this.afterResourceUpdate(message);
diff --git a/src/app/resources/resources-constants.ts b/src/app/resources/resources-constants.ts
index 103fb14ca6..c15ca1718b 100644
--- a/src/app/resources/resources-constants.ts
+++ b/src/app/resources/resources-constants.ts
@@ -1,62 +1,62 @@
export const subjectList = [
- 'Agriculture',
- 'Arts',
- 'Business and Finance',
- 'Environment',
- 'Food and Nutrition',
- 'Geography',
- 'Health and Medicine',
- 'History',
- 'Human Development',
- 'Languages',
- 'Law',
- 'Learning',
- 'Literature',
- 'Math',
- 'Music',
- 'Politics and Government',
- 'Reference',
- 'Religion',
- 'Science',
- 'Social Sciences',
- 'Sports',
- 'Technology'
+ $localize`Agriculture`,
+ $localize`Arts`,
+ $localize`Business and Finance`,
+ $localize`Environment`,
+ $localize`Food and Nutrition`,
+ $localize`Geography`,
+ $localize`Health and Medicine`,
+ $localize`History`,
+ $localize`Human Development`,
+ $localize`Languages`,
+ $localize`Law`,
+ $localize`Learning`,
+ $localize`Literature`,
+ $localize`Math`,
+ $localize`Music`,
+ $localize`Politics and Government`,
+ $localize`Reference`,
+ $localize`Religion`,
+ $localize`Science`,
+ $localize`Social Sciences`,
+ $localize`Sports`,
+ $localize`Technology`
];
export const levelList = [
- 'Early Education',
- 'Lower Primary',
- 'Upper Primary',
- 'Lower Secondary',
- 'Upper Secondary',
- 'Undergraduate',
- 'Graduate',
- 'Professional'
+ $localize`Early Education`,
+ $localize`Lower Primary`,
+ $localize`Upper Primary`,
+ $localize`Lower Secondary`,
+ $localize`Upper Secondary`,
+ $localize`Undergraduate`,
+ $localize`Graduate`,
+ $localize`Professional`
];
export const media = [
- 'Text',
- 'Graphic/Pictures',
- 'Audio/Music/Book',
- 'Video'
+ $localize`Text`,
+ $localize`Graphic/Pictures`,
+ $localize`Audio/Music/Book`,
+ $localize`Video`
];
export const openWith = [
- 'Just download',
- 'HTML',
- 'PDF.js',
- 'Bell-Reader',
- 'MP3',
- 'Flow Video Player',
- 'BeLL Video Book Player',
- 'Native Video'
+ $localize`Just download`,
+ $localize`HTML`,
+ $localize`PDF.js`,
+ $localize`Bell-Reader`,
+ $localize`MP3`,
+ $localize`Flow Video Player`,
+ $localize`BeLL Video Book Player`,
+ $localize`Native Video`
];
export const resourceType = [
- 'Textbook',
- 'Lesson Plan',
- 'Activities',
- 'Exercises',
- 'Discussion Questions'
+ $localize`Textbook`,
+ $localize`Lesson Plan`,
+ $localize`Activities`,
+ $localize`Exercises`,
+ $localize`Discussion Questions`
];
diff --git a/src/app/resources/resources.component.ts b/src/app/resources/resources.component.ts
index b8838f9b17..70f47f12c1 100644
--- a/src/app/resources/resources.component.ts
+++ b/src/app/resources/resources.component.ts
@@ -244,9 +244,9 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy {
this.selection.deselect(resourceId);
this.resources.data = this.resources.data.filter((res: any) => data.id !== res._id);
this.deleteDialog.close();
- this.planetMessageService.showMessage('You have deleted resource: ' + resource.doc.title);
+ this.planetMessageService.showMessage($localize`You have deleted resource: ${resource.doc.title}`);
},
- onError: (error) => this.planetMessageService.showAlert('There was a problem deleting this resource.')
+ onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this resource.`)
};
}
@@ -258,9 +258,9 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy {
this.resourcesService.requestResourcesUpdate(this.parent);
this.selection.clear();
this.deleteDialog.close();
- this.planetMessageService.showMessage('You have deleted ' + deleteArray.length + ' resources');
+ this.planetMessageService.showMessage($localize`You have deleted ${deleteArray.length} resources`);
},
- onError: (error) => this.planetMessageService.showAlert('There was a problem deleting this resource.')
+ onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this resource.`)
};
}
@@ -280,13 +280,13 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy {
items = resources.map(id => ({ item: this.resources.data.find((resource: any) => resource._id === id), db: this.dbName }));
this.syncService.confirmPasswordAndRunReplicators(this.syncService.createReplicatorsArray(items, type) )
.subscribe((response: any) => {
- this.planetMessageService.showMessage(resources.length + ' ' + this.dbName + ' ' + 'queued to ' + msg);
+ this.planetMessageService.showMessage($localize`${resources.length} ${this.dbName} queued to ${msg}`);
}, () => error => this.planetMessageService.showMessage(error));
}
addTagsToSelected({ selected, indeterminate }) {
this.resourcesService.updateResourceTags(this.selection.selected, selected, indeterminate).subscribe(() => {
- this.planetMessageService.showMessage('Collections updated');
+ this.planetMessageService.showMessage($localize`Collections updated`);
});
}
@@ -356,9 +356,9 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy {
center: selectedPlanets.length > 1 ? 'nations' : 'nation',
nation: selectedPlanets.length > 1 ? 'communities' : 'community'
}[this.planetType];
- this.planetMessageService.showMessage(`Resources queued to push to ${childType}.`);
+ this.planetMessageService.showMessage($localize`Resources queued to push to ${childType}.`);
this.dialogRef.close();
- }, () => this.planetMessageService.showAlert('There was an error sending these resources'));
+ }, () => this.planetMessageService.showAlert($localize`There was an error sending these resources`));
};
}
diff --git a/src/app/resources/resources.service.ts b/src/app/resources/resources.service.ts
index 2451283c7c..e8d72eaf09 100644
--- a/src/app/resources/resources.service.ts
+++ b/src/app/resources/resources.service.ts
@@ -92,7 +92,7 @@ export class ResourcesService {
libraryAddRemove(resourceIds, type) {
return this.userService.changeShelf(resourceIds, 'resourceIds', type).pipe(map(({ shelf, countChanged }) => {
const message = type === 'remove' ?
- countChanged + ' Resources successfully removed from myLibrary' : countChanged + ' Resources added to your dashboard';
+ countChanged + $localize` Resources successfully removed from myLibrary` : countChanged + $localize` Resources added to your dashboard`;
this.planetMessageService.showMessage(message);
return shelf;
}));
@@ -149,7 +149,7 @@ export class ResourcesService {
newResourceNotification(user) {
return {
'user': user._id,
- 'message': 'There are new resources in the Library. Click to see them!',
+ 'message': $localize`There are new resources in the Library. Click to see them!`,
'link' : '/resources',
'linkParams': { sort: 'createdDate' },
'type': 'newResource',
diff --git a/src/app/resources/view-resources/resources-view.component.ts b/src/app/resources/view-resources/resources-view.component.ts
index 0dd43a636f..3c0743eda7 100644
--- a/src/app/resources/view-resources/resources-view.component.ts
+++ b/src/app/resources/view-resources/resources-view.component.ts
@@ -67,7 +67,7 @@ export class ResourcesViewComponent implements OnInit, OnDestroy {
if (this.resourcesService.isActiveResourceFetch) {
return;
}
- this.planetMessageService.showAlert('Resource does not exist in Library');
+ this.planetMessageService.showAlert($localize`Resource does not exist in Library`);
this.router.navigate([ '/resources' ]);
}
this.dialogsLoadingService.stop();
diff --git a/src/app/shared/calendar.component.ts b/src/app/shared/calendar.component.ts
index 33cdfcce74..335ffca08c 100644
--- a/src/app/shared/calendar.component.ts
+++ b/src/app/shared/calendar.component.ts
@@ -27,7 +27,7 @@ export class PlanetCalendarComponent implements OnInit {
right: 'addEventButton today prev,next'
};
buttonText = {
- today: 'Today'
+ today: $localize`Today`
};
buttons = {};
eventTimeFormat = {
@@ -62,7 +62,7 @@ export class PlanetCalendarComponent implements OnInit {
this.buttons = this.editable ?
{
addEventButton: {
- text: 'Add Event',
+ text: $localize`Add Event`,
click: this.openAddEventDialog.bind(this)
}
} :
diff --git a/src/app/shared/couchdb.service.ts b/src/app/shared/couchdb.service.ts
index 438db47342..2feeb18b1b 100644
--- a/src/app/shared/couchdb.service.ts
+++ b/src/app/shared/couchdb.service.ts
@@ -37,7 +37,7 @@ export class CouchService {
.pipe(debug('Http ' + type + ' ' + this.reqNum + ' request'))
.pipe(catchError(err => {
if (err.status === 403) {
- this.planetMessageService.showAlert('You are not authorized. Please contact administrator.');
+ this.planetMessageService.showAlert($localize`You are not authorized. Please contact administrator.`);
}
return throwError(err);
}));
diff --git a/src/app/shared/csv.service.ts b/src/app/shared/csv.service.ts
index 43691b47ec..06b75bb060 100644
--- a/src/app/shared/csv.service.ts
+++ b/src/app/shared/csv.service.ts
@@ -27,7 +27,7 @@ export class CsvService {
}
exportCSV({ data, title }: { data: any[], title: string }) {
- const options = { title, filename: `Report of ${title} on ${new Date().toDateString()}`, showTitle: true };
+ const options = { title, filename: $localize`Report of ${title} on ${new Date().toDateString()}`, showTitle: true };
const formattedData = data.map(({ _id, _rev, resourceId, type, createdOn, parentCode, data: d, hasInfo, ...dataToDisplay }) => {
return Object.entries(dataToDisplay).reduce(
(object, [ key, value ]: [ string, any ]) => ({ ...object, [markdownToPlainText(key)]: this.formatValue(key, value) }),
@@ -35,7 +35,7 @@ export class CsvService {
);
});
if (formattedData.length === 0) {
- this.planetMessageService.showAlert('There was no data during that period to export');
+ this.planetMessageService.showAlert($localize`There was no data during that period to export`);
return;
}
this.generate(formattedData, options);
@@ -43,8 +43,8 @@ export class CsvService {
exportSummaryCSV(logins: any[], resourceViews: any[], courseViews: any[], stepCompletions: any[], planetName: string) {
const options = {
- title: `Summary report for ${planetName}`,
- filename: `Report of ${planetName} on ${new Date().toDateString()}`,
+ title: $localize`Summary report for ${planetName}`,
+ filename: $localize`Report of ${planetName} on ${new Date().toDateString()}`,
showTitle: true,
showLabels: false,
useKeysAsHeaders: false
@@ -68,19 +68,19 @@ export class CsvService {
const blankRow = monthLabels(groupedLogins, false);
const headerRow = monthLabels(groupedLogins, true);
return [
- { label: 'Unique Member Visits by Month', ...headerRow },
+ { label: $localize`Unique Member Visits by Month`, ...headerRow },
...this.fillRows(this.summaryDataToTable(groupedLogins, true), headerRow),
{ label: '', ...blankRow },
- { label: 'Total Member Visits by Month', ...headerRow },
+ { label: $localize`Total Member Visits by Month`, ...headerRow },
...this.fillRows(this.summaryDataToTable(groupedLogins), headerRow),
{ label: '', ...blankRow },
- { label: 'Resource Views by Month', ...headerRow },
+ { label: $localize`Resource Views by Month`, ...headerRow },
...this.fillRows(this.summaryDataToTable(groupedResourceViews), headerRow),
{ label: '', ...blankRow },
- { label: 'Course Views by Month', ...headerRow },
+ { label: $localize`Course Views by Month`, ...headerRow },
...this.fillRows(this.summaryDataToTable(groupedCourseViews), headerRow),
{ label: '', ...blankRow },
- { label: 'Steps Completed by Month', ...headerRow },
+ { label: $localize`Steps Completed by Month`, ...headerRow },
...this.fillRows(this.summaryDataToTable(groupedStepCompletions), headerRow)
];
}
@@ -94,7 +94,7 @@ export class CsvService {
table[itemIndex] = { ...table[itemIndex], [dateLabel]: value };
table[3] = { ...table[3], [dateLabel]: (table[3][dateLabel] || 0) + value };
return table;
- }, [ { label: 'Male' }, { label: 'Female' }, { label: 'Did not specify' }, { label: 'Total' } ]);
+ }, [ { label: $localize`Male` }, { label: $localize`Female` }, { label: $localize`Did not specify` }, { label: $localize`Total` } ]);
}
fillRows(data: any[], headerRow: any, fillValue = 0) {
diff --git a/src/app/shared/dialogs/change-password.directive.ts b/src/app/shared/dialogs/change-password.directive.ts
index 1849d8452d..1c196eb7d4 100644
--- a/src/app/shared/dialogs/change-password.directive.ts
+++ b/src/app/shared/dialogs/change-password.directive.ts
@@ -14,26 +14,26 @@ import { ManagerService } from '../../manager-dashboard/manager.service';
const changePasswordFields = [
{
- 'label': 'Old Password',
+ 'label': $localize`Old Password`,
'type': 'password',
'name': 'oldPassword',
- 'placeholder': 'Old Password',
+ 'placeholder': $localize`Old Password`,
'required': true
}
];
const resetPasswordFields = [
{
- 'label': 'Password',
+ 'label': $localize`Password`,
'type': 'password',
'name': 'password',
- 'placeholder': 'Password',
+ 'placeholder': $localize`Password`,
'required': true
},
{
- 'label': 'Confirm Password',
+ 'label': $localize`Confirm Password`,
'type': 'password',
'name': 'confirmPassword',
- 'placeholder': 'Confirm Password',
+ 'placeholder': $localize`Confirm Password`,
'required': true
}
];
@@ -108,7 +108,7 @@ export class ChangePasswordDirective implements OnChanges {
const formFields = this.isLoggedInUser ? [ ...changePasswordFields, ...resetPasswordFields ] : resetPasswordFields;
const formGroups = this.isLoggedInUser ? this.changePasswordFormGroup : this.resetPasswordFormGroup;
this.dialogsFormService.openDialogsForm(
- 'Change Password',
+ $localize`Change Password`,
formFields,
formGroups,
{ onSubmit: this.onPasswordSubmit.bind(this) }
diff --git a/src/app/shared/dialogs/dialogs-form.component.html b/src/app/shared/dialogs/dialogs-form.component.html
index e0b4927c11..b2e5bc0856 100644
--- a/src/app/shared/dialogs/dialogs-form.component.html
+++ b/src/app/shared/dialogs/dialogs-form.component.html
@@ -59,7 +59,7 @@ create{{title}}
-
+
@@ -77,7 +77,7 @@ create{{title}}
- {{errorMessage}}
+ {{errorMessage}}
diff --git a/src/app/shared/forms/form-error-messages.component.ts b/src/app/shared/forms/form-error-messages.component.ts
index 0e66d02d74..5d829db97d 100644
--- a/src/app/shared/forms/form-error-messages.component.ts
+++ b/src/app/shared/forms/form-error-messages.component.ts
@@ -92,7 +92,7 @@ export class FormErrorMessagesComponent implements OnInit {
tooltipText() {
switch (this.error) {
case 'pattern':
- return 'Letters, numbers and _ . - allowed.';
+ return $localize`Letters, numbers and _ . - allowed.`;
default:
return '';
}
diff --git a/src/app/shared/forms/planet-markdown-textbox.component.ts b/src/app/shared/forms/planet-markdown-textbox.component.ts
index f78eff0be7..9bbb78ac63 100644
--- a/src/app/shared/forms/planet-markdown-textbox.component.ts
+++ b/src/app/shared/forms/planet-markdown-textbox.component.ts
@@ -106,7 +106,7 @@ export class PlanetMarkdownTextboxComponent implements ControlValueAccessor, DoC
name: 'custom',
action: this.addImage.bind(this),
className: 'fa fa-picture-o',
- title: 'Add Image'
+ title: $localize`Add Image`
};
this.options = {
...this.options,
diff --git a/src/app/shared/forms/planet-rating.component.ts b/src/app/shared/forms/planet-rating.component.ts
index 6d78e5dfd1..eaaa7b2109 100644
--- a/src/app/shared/forms/planet-rating.component.ts
+++ b/src/app/shared/forms/planet-rating.component.ts
@@ -11,17 +11,17 @@ import { StateService } from '../state.service';
const popupFormFields = [
{
- 'label': 'Rate',
+ 'label': $localize`Rate`,
'type': 'rating',
'name': 'rate',
- 'placeholder': 'Your Rating',
+ 'placeholder': $localize`Your Rating`,
'required': false
},
{
- 'label': 'Comment',
+ 'label': $localize`Comment`,
'type': 'textarea',
'name': 'comment',
- 'placeholder': 'Would you like to leave a comment?',
+ 'placeholder': $localize`Would you like to leave a comment?`,
'required': false
}
];
@@ -90,12 +90,12 @@ export class PlanetRatingComponent implements OnChanges {
this.updateRating(form).subscribe(res => {
if (!this.isPopupOpen) {
this.openDialog();
- this.planetMessage.showMessage('Thank you, your rating is submitted!');
+ this.planetMessage.showMessage($localize`Thank you, your rating is submitted!`);
} else {
this.rateForm.setValue({ rate: this.popupForm.controls.rate.value });
this.isPopupOpen = false;
if (this.popupForm.controls.comment.dirty && this.popupForm.controls.comment.value !== '') {
- this.planetMessage.showMessage('Thank you for your additional comments');
+ this.planetMessage.showMessage($localize`Thank you for your additional comments`);
}
}
}, (err) => {
@@ -132,7 +132,7 @@ export class PlanetRatingComponent implements OnChanges {
this.popupForm.patchValue(this.rateForm.value);
this.isPopupOpen = true;
this.dialogsForm
- .confirm('Rating', popupFormFields, this.popupForm)
+ .confirm($localize`Rating`, popupFormFields, this.popupForm)
.pipe(debug('Dialog confirm'))
.subscribe((res) => {
if (res) {
@@ -142,7 +142,7 @@ export class PlanetRatingComponent implements OnChanges {
}
ratingError() {
- this.planetMessage.showAlert('There was an issue updating your rating');
+ this.planetMessage.showAlert($localize`There was an issue updating your rating`);
this.rateForm.patchValue({ rate: this.rating.userRating.rate || 0 });
// If the dialog is open, then there will also be a comment control to reset
if (this.rateForm.controls.comment) {
diff --git a/src/app/shared/forms/planet-tag-input-dialog.component.ts b/src/app/shared/forms/planet-tag-input-dialog.component.ts
index dccd936d11..6c335053c1 100644
--- a/src/app/shared/forms/planet-tag-input-dialog.component.ts
+++ b/src/app/shared/forms/planet-tag-input-dialog.component.ts
@@ -139,7 +139,7 @@ export class PlanetTagInputDialogComponent {
if (this.addTagForm.valid) {
this.tagsService.updateTag({ ...this.addTagForm.value, db: this.data.db, docType: 'definition' }).subscribe((res) => {
this.newTagInfo = { id: res[0].id, parentId: this.addTagForm.controls.attachedTo.value };
- this.planetMessageService.showMessage('New collection added');
+ this.planetMessageService.showMessage($localize`New collection added`);
onAllFormControls(([ key, value ]) => value.updateValueAndValidity());
this.data.initTags();
this.addTagForm.get('name').reset('');
@@ -154,7 +154,7 @@ export class PlanetTagInputDialogComponent {
const onSubmit = ((newTag) => {
this.tagsService.updateTag({ ...tag, ...newTag }).subscribe((res) => {
const newTagId = res[0].id;
- this.planetMessageService.showMessage('Collection updated');
+ this.planetMessageService.showMessage($localize`Collection updated`);
this.selected.set(newTagId, this.selected.get(tag._id));
this.indeterminate.set(newTagId, this.indeterminate.get(tag._id));
this.data.initTags(this.mode === 'add' ? newTagId : undefined);
@@ -165,12 +165,12 @@ export class PlanetTagInputDialogComponent {
event.stopPropagation();
const subcollectionField = tag.subTags && tag.subTags.length > 0 ? [] : [
{
- placeholder: 'Subcollection of...', name: 'attachedTo', type: 'selectbox',
+ placeholder: $localize`Subcollection of...`, name: 'attachedTo', type: 'selectbox',
options: this.subcollectionOfOptions(tag, this.tags), required: false, reset: true
}
];
this.dialogsFormService.openDialogsForm('Edit Collection', [
- { placeholder: 'Name', name: 'name', required: true, type: 'textbox' },
+ { placeholder: $localize`Name`, name: 'name', required: true, type: 'textbox' },
...subcollectionField
], this.tagForm(tag), { onSubmit });
}
@@ -202,9 +202,9 @@ export class PlanetTagInputDialogComponent {
onNext: (data) => {
this.data.initTags();
this.deleteDialog.close();
- this.planetMessageService.showMessage('Tag deleted: ' + tag.name);
+ this.planetMessageService.showMessage($localize`Tag deleted: ${tag.name}`);
},
- onError: (error) => this.planetMessageService.showAlert('There was a problem deleting this tag.')
+ onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this tag.`)
};
}
diff --git a/src/app/shared/forms/planet-tag-selected-input.component.ts b/src/app/shared/forms/planet-tag-selected-input.component.ts
index 72e0a9e2b9..11f37d8f21 100644
--- a/src/app/shared/forms/planet-tag-selected-input.component.ts
+++ b/src/app/shared/forms/planet-tag-selected-input.component.ts
@@ -6,7 +6,7 @@ import { TagsService } from './tags.service';
No collections selected
Selected:{{' ' + tooltipLabels}}
- Hover to see selected collections
+ Hover to see selected collections
`,
selector: 'planet-tag-selected-input'
diff --git a/src/app/shared/planet-filtered-amount.component.ts b/src/app/shared/planet-filtered-amount.component.ts
index 5c7bb3368e..98f1ca8485 100644
--- a/src/app/shared/planet-filtered-amount.component.ts
+++ b/src/app/shared/planet-filtered-amount.component.ts
@@ -2,8 +2,8 @@ import { Component, Input } from '@angular/core';
import { MatTableDataSource } from '@angular/material/table';
@Component({
- template: `
- Showing {{table.filteredData.length}} of {{table.data.length}}
+ template: `
+ Showing {{table.filteredData.length}} of {{table.data.length}}
{labelFor, select,
resources {{table.data.length, plural, =0 {resources} =1 {resource} other {resources}}}
courses {{table.data.length, plural, =0 {courses} =1 {course} other {courses}}}
diff --git a/src/app/shared/sync.service.ts b/src/app/shared/sync.service.ts
index 192a8e7d00..3f5e7aa2dc 100644
--- a/src/app/shared/sync.service.ts
+++ b/src/app/shared/sync.service.ts
@@ -12,10 +12,10 @@ import { UserService } from './user.service';
const passwordFormFields = [
{
- 'label': 'Password',
+ 'label': $localize`Password`,
'type': 'password',
'name': 'password',
- 'placeholder': 'Password',
+ 'placeholder': $localize`Password`,
'required': true
}
];
@@ -46,7 +46,7 @@ export class SyncService {
}
openPasswordConfirmation() {
- const title = 'Admin Confirmation';
+ const title = $localize`Admin Confirmation`;
const formGroup = {
password: [ '', Validators.required, ac => this.validatorService.checkPassword$(ac) ]
};
@@ -62,7 +62,7 @@ export class SyncService {
takeWhile((value) => value.cancelled !== true),
catchError((err) => {
const errorMessage = err.error.reason;
- return throwError(errorMessage === 'Name or password is incorrect.' ? 'Password is incorrect.' : errorMessage);
+ return throwError(errorMessage === 'Name or password is incorrect.' ? $localize`Password is incorrect.` : errorMessage);
})
);
}
@@ -75,7 +75,7 @@ export class SyncService {
{ withCredentials: true, domain: this.stateService.configuration.parentDomain })
]).pipe(switchMap(([ localSession, parentSession ]) => {
if (!localSession.ok || !parentSession.ok) {
- return throwError('Invalid password');
+ return throwError($localize`Invalid password`);
}
return of({ name: this.userService.get().name, password });
}));
diff --git a/src/app/submissions/submissions.component.ts b/src/app/submissions/submissions.component.ts
index dc404a17f8..8afe594efb 100644
--- a/src/app/submissions/submissions.component.ts
+++ b/src/app/submissions/submissions.component.ts
@@ -47,9 +47,9 @@ export class SubmissionsComponent implements OnInit, AfterViewChecked, OnDestroy
@ViewChild(MatSort) sort: MatSort;
initTable = true;
statusOptions: any = [
- { text: 'Pending', value: 'pending' },
- { text: 'Not Graded', value: 'requires grading' },
- { text: 'Completed', value: 'complete' }
+ { text: $localize`Pending`, value: 'pending' },
+ { text: $localize`Not Graded`, value: 'requires grading' },
+ { text: $localize`Completed`, value: 'complete' }
];
mode = 'grade';
emptyData = false;
diff --git a/src/app/submissions/submissions.service.ts b/src/app/submissions/submissions.service.ts
index a7d99470c0..3dcf8ffa54 100644
--- a/src/app/submissions/submissions.service.ts
+++ b/src/app/submissions/submissions.service.ts
@@ -240,7 +240,7 @@ export class SubmissionsService {
sendSubmissionNotification(isRecorded: boolean, isUpdated: boolean = false) {
const data = {
- 'message': `${this.userService.get().name} has
+ 'message': $localize`${this.userService.get().name} has
${isUpdated ? 'updated' : isRecorded ? 'recorded' : 'completed'} the survey ${this.submission.parent.name}`,
'link': '/myDashboard/submissions/exam',
'linkParams': { submissionId: this.submission._id, questionNum: 1, status: 'complete', mode: 'view' },
@@ -307,7 +307,7 @@ export class SubmissionsService {
]).subscribe(([ [ submissions, time, questionTexts ], planets ]: [ [ any[], number, string[] ], any[] ]) => {
if (!submissions.length) {
this.dialogsLoadingService.stop();
- this.planetMessageService.showMessage('There is no survey response');
+ this.planetMessageService.showMessage($localize`There is no survey response`);
return;
}
const planetsWithName = attachNamesToPlanets(planets);
diff --git a/src/app/surveys/surveys.component.ts b/src/app/surveys/surveys.component.ts
index 283f5dcd40..5b585ac7e9 100644
--- a/src/app/surveys/surveys.component.ts
+++ b/src/app/surveys/surveys.component.ts
@@ -190,9 +190,9 @@ export class SurveysComponent implements OnInit, AfterViewInit, OnDestroy {
this.surveys.data = this.surveys.data.filter((survey: any) => findByIdInArray(deleteArray, survey._id) === undefined);
this.selection.clear();
this.deleteDialog.close();
- this.planetMessageService.showMessage('You have deleted ' + deleteArray.length + ' surveys');
+ this.planetMessageService.showMessage($localize`You have deleted ${deleteArray.length} surveys`);
},
- onError: () => this.planetMessageService.showAlert('There was a problem deleting survey.')
+ onError: () => this.planetMessageService.showAlert($localize`There was a problem deleting survey.`)
};
}
@@ -207,9 +207,9 @@ export class SurveysComponent implements OnInit, AfterViewInit, OnDestroy {
this.selection.deselect(survey._id);
this.surveys.data = filterById(this.surveys.data, survey._id);
this.deleteDialog.close();
- this.planetMessageService.showMessage('Survey deleted: ' + survey.name);
+ this.planetMessageService.showMessage($localize`Survey deleted: ${survey.name}`);
},
- onError: () => this.planetMessageService.showAlert('There was a problem deleting this survey.')
+ onError: () => this.planetMessageService.showAlert($localize`There was a problem deleting this survey.`)
};
}
@@ -261,7 +261,7 @@ export class SurveysComponent implements OnInit, AfterViewInit, OnDestroy {
this.submissionsService.sendSubmissionRequests(users, {
'parentId': survey._id, 'parent': survey }
).subscribe(() => {
- this.planetMessageService.showMessage('Survey requests sent');
+ this.planetMessageService.showMessage($localize`Survey requests sent`);
this.dialogsLoadingService.stop();
this.dialogRef.close();
});
@@ -279,7 +279,7 @@ export class SurveysComponent implements OnInit, AfterViewInit, OnDestroy {
exportCSV(survey) {
this.submissionsService.exportSubmissionsCsv(survey, 'survey').subscribe(res => {
if (!res.length) {
- this.planetMessageService.showMessage('There is no survey response');
+ this.planetMessageService.showMessage($localize`There is no survey response`);
}
});
}
@@ -288,8 +288,8 @@ export class SurveysComponent implements OnInit, AfterViewInit, OnDestroy {
this.dialogsFormService.openDialogsForm(
'Records to Export',
[
- { name: 'includeQuestions', placeholder: 'Include Questions', type: 'checkbox' },
- { name: 'includeAnswers', placeholder: 'Include Answers', type: 'checkbox' }
+ { name: 'includeQuestions', placeholder: $localize`Include Questions`, type: 'checkbox' },
+ { name: 'includeAnswers', placeholder: $localize`Include Answers`, type: 'checkbox' }
],
{ includeQuestions: true, includeAnswers: true },
{
diff --git a/src/app/tasks/tasks.component.ts b/src/app/tasks/tasks.component.ts
index d42932e979..079dc17115 100644
--- a/src/app/tasks/tasks.component.ts
+++ b/src/app/tasks/tasks.component.ts
@@ -66,7 +66,7 @@ export class TasksComponent implements OnInit {
addTask(task?) {
this.openAddDialog({ link: this.link, sync: this.sync }, task, () => {
this.tasksService.getTasks();
- const msg = task ? 'Task updated successfully' : 'Task created successfully';
+ const msg = task ? $localize`Task updated successfully` : $localize`Task created successfully`;
this.planetMessageService.showMessage(msg);
this.dialogsFormService.closeDialogsForm();
});
@@ -74,7 +74,7 @@ export class TasksComponent implements OnInit {
openAddDialog(additionalFields, task: any = {}, onSuccess = (res) => {}) {
const { fields, formGroup } = this.tasksService.addDialogForm(task);
- this.dialogsFormService.openDialogsForm(task.title ? 'Edit Task' : 'Add Task', fields, formGroup, {
+ this.dialogsFormService.openDialogsForm(task.title ? $localize`Edit Task` : $localize`Add Task`, fields, formGroup, {
onSubmit: (newTask) => {
if (newTask) {
this.tasksService.addDialogSubmit(additionalFields, task, newTask, onSuccess.bind(this));
@@ -100,10 +100,10 @@ export class TasksComponent implements OnInit {
request: this.tasksService.archiveTask(task)(),
onNext: () => {
this.deleteDialog.close();
- this.planetMessageService.showMessage('You have deleted a task.');
+ this.planetMessageService.showMessage($localize`You have deleted a task.`);
this.removeTaskFromTable();
},
- onError: () => this.planetMessageService.showAlert('There was a problem deleting this team.')
+ onError: () => this.planetMessageService.showAlert($localize`There was a problem deleting this team.`)
};
}
@@ -147,7 +147,7 @@ export class TasksComponent implements OnInit {
const link = this.mode === 'services' ? `community` : `/${this.mode}s/view/${this.link.teams}`;
const notificationDoc = {
user: assignee.userId,
- 'message': 'You were assigned a new task',
+ 'message': $localize`You were assigned a new task`,
link,
linkParams: { activeTab: 'taskTab' },
'type': 'newTask',
diff --git a/src/app/tasks/tasks.service.ts b/src/app/tasks/tasks.service.ts
index 5a09472f7c..fda8e02e8e 100644
--- a/src/app/tasks/tasks.service.ts
+++ b/src/app/tasks/tasks.service.ts
@@ -65,10 +65,10 @@ export class TasksService {
{ deadline: '', deadlineTime: '09:00' };
return {
fields: [
- { placeholder: 'Task', type: 'textbox', name: 'title', required: true },
- { placeholder: 'Deadline', type: 'date', name: 'deadline', required: true },
- { placeholder: 'Deadline Time', type: 'time', name: 'deadlineTime', required: true },
- { placeholder: 'Description', type: 'markdown', name: 'description', required: false }
+ { placeholder: $localize`Task`, type: 'textbox', name: 'title', required: true },
+ { placeholder: $localize`Deadline`, type: 'date', name: 'deadline', required: true },
+ { placeholder: $localize`Deadline Time`, type: 'time', name: 'deadlineTime', required: true },
+ { placeholder: $localize`Description`, type: 'markdown', name: 'description', required: false }
],
formGroup: {
title: [ task.title || '', CustomValidators.required ],
diff --git a/src/app/teams/teams-reports.component.ts b/src/app/teams/teams-reports.component.ts
index b0cd930205..a9a658cb85 100644
--- a/src/app/teams/teams-reports.component.ts
+++ b/src/app/teams/teams-reports.component.ts
@@ -53,16 +53,16 @@ export class TeamsReportsComponent implements DoCheck {
const lastMonthStart = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1);
const lastMonthEnd = currentDate.setDate(0);
this.dialogsFormService.openDialogsForm(
- 'Add Report',
+ $localize`Add Report`,
[
- { name: 'startDate', placeholder: 'Start Date', type: 'date', required: true },
- { name: 'endDate', placeholder: 'End Date', type: 'date', required: true },
- { name: 'description', placeholder: 'Summary', type: 'markdown', required: true },
- { name: 'beginningBalance', placeholder: 'Beginning Balance', type: 'textbox', inputType: 'number', required: true },
- { name: 'sales', placeholder: 'Sales', type: 'textbox', inputType: 'number', required: true, min: 0 },
- { name: 'otherIncome', placeholder: 'Other Income', type: 'textbox', inputType: 'number', required: true, min: 0 },
- { name: 'wages', placeholder: 'Personnel', type: 'textbox', inputType: 'number', required: true, min: 0 },
- { name: 'otherExpenses', placeholder: 'Non-Personnel', type: 'textbox', inputType: 'number', required: true, min: 0 }
+ { name: 'startDate', placeholder: $localize`Start Date`, type: 'date', required: true },
+ { name: 'endDate', placeholder: $localize`End Date`, type: 'date', required: true },
+ { name: 'description', placeholder: $localize`Summary`, type: 'markdown', required: true },
+ { name: 'beginningBalance', placeholder: $localize`Beginning Balance`, type: 'textbox', inputType: 'number', required: true },
+ { name: 'sales', placeholder: $localize`Sales`, type: 'textbox', inputType: 'number', required: true, min: 0 },
+ { name: 'otherIncome', placeholder: $localize`Other Income`, type: 'textbox', inputType: 'number', required: true, min: 0 },
+ { name: 'wages', placeholder: $localize`Personnel`, type: 'textbox', inputType: 'number', required: true, min: 0 },
+ { name: 'otherExpenses', placeholder: $localize`Non-Personnel`, type: 'textbox', inputType: 'number', required: true, min: 0 }
],
this.addFormInitialValues(oldReport, { startDate: lastMonthStart, endDate: lastMonthEnd }),
{
@@ -161,7 +161,7 @@ export class TeamsReportsComponent implements DoCheck {
'Profit/Loss': report.sales + report.otherIncome - report.wages - report.otherExpenses,
'Ending Balance': report.beginningBalance + report.sales + report.otherIncome - report.wages - report.otherExpenses
}));
- this.csvService.exportCSV({ data: exportData, title: `${this.team.name} Financial Report Summary` });
+ this.csvService.exportCSV({ data: exportData, title: $localize`${this.team.name} Financial Report Summary` });
}
}
diff --git a/src/app/teams/teams-view-finances.component.ts b/src/app/teams/teams-view-finances.component.ts
index 1eff4f404d..d81e3412fd 100644
--- a/src/app/teams/teams-view-finances.component.ts
+++ b/src/app/teams/teams-view-finances.component.ts
@@ -48,7 +48,7 @@ export class TeamsViewFinancesComponent implements OnInit, OnChanges {
this.table.filterPredicate = (data: any, filter) => {
const fromDate = this.startDate || -Infinity;
const toDate = this.endDate ? this.endDate.getTime() + millisecondsToDay : Infinity;
- return data.date >= fromDate && data.date < toDate || data.date === 'Total';
+ return data.date >= fromDate && data.date < toDate || data.date === $localize`Total`;
};
this.table.connect().subscribe(transactions => {
if (transactions.length > 0 && transactions[0].filter !== this.filterString()) {
@@ -75,7 +75,7 @@ export class TeamsViewFinancesComponent implements OnInit, OnChanges {
.sort((a, b) => a.date - b.date).reduce(this.combineTransactionData, []).reverse();
if (financeData.length === 0) {
this.emptyTable = true;
- return [ { date: 'Total' } ];
+ return [ { date: $localize`Total` } ];
}
this.emptyTable = false;
const { totalCredits: credit, totalDebits: debit, balance } = financeData[0];
@@ -108,15 +108,15 @@ export class TeamsViewFinancesComponent implements OnInit, OnChanges {
openEditTransactionDialog(transaction: any = {}) {
this.couchService.currentTime().subscribe((time: number) => {
this.dialogsFormService.openDialogsForm(
- transaction._id ? 'Edit Transaction' : 'Add Transaction',
+ transaction._id ? $localize`Edit Transaction` : $localize`Add Transaction`,
[
{
- name: 'type', placeholder: 'Type', type: 'selectbox',
- options: [ { value: 'credit', name: 'Credit' }, { value: 'debit', name: 'Debit' } ], required: true
+ name: 'type', placeholder: $localize`Type`, type: 'selectbox',
+ options: [ { value: 'credit', name: $localize`Credit` }, { value: 'debit', name: $localize`Debit` } ], required: true
},
- { name: 'description', placeholder: 'Note', type: 'textbox', required: true },
- { name: 'amount', placeholder: 'Amount', type: 'textbox', inputType: 'number', required: true },
- { name: 'date', placeholder: 'Date', type: 'date', required: true }
+ { name: 'description', placeholder: $localize`Note`, type: 'textbox', required: true },
+ { name: 'amount', placeholder: $localize`Amount`, type: 'textbox', inputType: 'number', required: true },
+ { name: 'date', placeholder: $localize`Date`, type: 'date', required: true }
],
{
type: [ transaction.type || 'credit', CustomValidators.required ],
@@ -126,7 +126,7 @@ export class TeamsViewFinancesComponent implements OnInit, OnChanges {
},
{
onSubmit: (newTransaction) => this.submitTransaction(newTransaction, transaction).subscribe(() => {
- this.planetMessageService.showMessage(transaction._id ? 'Transaction Updated' : 'Transaction Added');
+ this.planetMessageService.showMessage(transaction._id ? $localize`Transaction Updated` : $localize`Transaction Added`);
this.dialogsFormService.closeDialogsForm();
})
}
diff --git a/src/app/teams/teams-view.component.ts b/src/app/teams/teams-view.component.ts
index 687c010fcc..9e74bf4d08 100644
--- a/src/app/teams/teams-view.component.ts
+++ b/src/app/teams/teams-view.component.ts
@@ -266,18 +266,18 @@ export class TeamsViewComponent implements OnInit, AfterViewChecked, OnDestroy {
dialogPromptConfig(item, change) {
return {
- leave: { request: this.toggleMembership(item, true), successMsg: 'left', errorMsg: 'leaving' },
+ leave: { request: this.toggleMembership(item, true), successMsg: $localize`left`, errorMsg: $localize`leaving` },
archive: { request: () => this.teamsService.archiveTeam(item)().pipe(switchMap(() => this.teamsService.deleteCommunityLink(item))),
- successMsg: 'deleted', errorMsg: 'deleting' },
+ successMsg: $localize`deleted`, errorMsg: $localize`deleting` },
resource: {
- request: this.removeResource(item), name: item.resource && item.resource.title, successMsg: 'removed', errorMsg: 'removing'
+ request: this.removeResource(item), name: item.resource && item.resource.title, successMsg: $localize`removed`, errorMsg: $localize`removing`
},
- course: { request: this.removeCourse(item), name: item.courseTitle, successMsg: 'removed', errorMsg: 'removing' },
+ course: { request: this.removeCourse(item), name: item.courseTitle, successMsg: $localize`removed`, errorMsg: $localize`removing` },
remove: {
request: this.changeMembershipRequest('removed', item), name: (item.userDoc || {}).fullName || item.name,
- successMsg: 'removed', errorMsg: 'removing'
+ successMsg: $localize`removed`, errorMsg: $localize`removing`
},
- leader: { request: this.makeLeader(item), successMsg: 'given leadership to', errorMsg: 'giving leadership to' }
+ leader: { request: this.makeLeader(item), successMsg: $localize`given leadership to`, errorMsg: $localize`giving leadership to` }
}[change];
}
@@ -294,13 +294,13 @@ export class TeamsViewComponent implements OnInit, AfterViewChecked, OnDestroy {
request: config.request(),
onNext: (res) => {
this.dialogPrompt.close();
- this.planetMessageService.showMessage(`You have ${config.successMsg} ${displayName}`);
+ this.planetMessageService.showMessage($localize`You have ${config.successMsg} ${displayName}`);
this.team = change === 'course' ? res : this.team;
if (change === 'archive') {
this.goBack();
}
},
- onError: () => this.planetMessageService.showAlert(`There was a problem ${config.errorMsg} ${displayName}`)
+ onError: () => this.planetMessageService.showAlert($localize`There was a problem ${config.errorMsg} ${displayName}`)
},
displayName,
...dialogParams
@@ -315,7 +315,7 @@ export class TeamsViewComponent implements OnInit, AfterViewChecked, OnDestroy {
switchMap(() => this.getMembers())
).subscribe(() => {
this.dialogsFormService.closeDialogsForm();
- this.planetMessageService.showMessage('Role has been updated.');
+ this.planetMessageService.showMessage($localize`Role has been updated.`);
});
};
}
@@ -323,8 +323,8 @@ export class TeamsViewComponent implements OnInit, AfterViewChecked, OnDestroy {
memberActionClick({ member, change }: { member, change: 'remove' | 'leader' | 'title' }) {
if (change === 'title') {
this.dialogsFormService.openDialogsForm(
- member.role ? 'Change Role' : 'Add Role',
- [ { name: 'teamRole', placeholder: 'Role', type: 'textbox' } ],
+ member.role ? $localize`Change Role` : $localize`Add Role`,
+ [ { name: 'teamRole', placeholder: $localize`Role`, type: 'textbox' } ],
{ teamRole: member.role || '' },
{ autoFocus: true, onSubmit: this.updateRole(member).bind(this) }
);
@@ -361,22 +361,22 @@ export class TeamsViewComponent implements OnInit, AfterViewChecked, OnDestroy {
case 'request':
return ({
obs: this.teamsService.requestToJoinTeam(this.team, this.user),
- message: 'Request to join team sent'
+ message: $localize`Request to join team sent`
});
case 'removed':
return ({
obs: this.teamsService.toggleTeamMembership(this.team, true, memberDoc),
- message: memberName + ' removed from team'
+ message: $localize`{memberName} removed from team`
});
case 'added':
return ({
obs: this.teamsService.toggleTeamMembership(this.team, false, { ...memberDoc, docType: 'membership' }),
- message: memberName + ' accepted'
+ message: $localize`${memberName} accepted`
});
case 'rejected':
return ({
obs: this.teamsService.removeFromRequests(this.team, memberDoc),
- message: memberName + ' rejected'
+ message: $localize`${memberName} rejected`
});
}
}
@@ -384,7 +384,7 @@ export class TeamsViewComponent implements OnInit, AfterViewChecked, OnDestroy {
updateTeam() {
this.teamsService.addTeamDialog(this.user._id, this.mode, this.team).subscribe((updatedTeam) => {
this.team = updatedTeam;
- this.planetMessageService.showMessage((this.team.name || `${this.configuration.name} Services Directory`) + ' updated successfully');
+ this.planetMessageService.showMessage((this.team.name || $localize`${this.configuration.name} Services Directory`) + $localize` updated successfully`);
});
}
@@ -420,7 +420,7 @@ export class TeamsViewComponent implements OnInit, AfterViewChecked, OnDestroy {
finalize(() => this.dialogsLoadingService.stop())
).subscribe(() => {
this.dialogRef.close();
- this.planetMessageService.showMessage('Member' + (selected.length > 1 ? 's' : '') + ' added successfully');
+ this.planetMessageService.showMessage($localize`Member${(selected.length > 1 ? 's' : '')} added successfully`);
});
}
@@ -454,8 +454,8 @@ export class TeamsViewComponent implements OnInit, AfterViewChecked, OnDestroy {
openAddMessageDialog(message = '') {
this.dialogsFormService.openDialogsForm(
- 'Add message',
- [ { name: 'message', placeholder: 'Message', type: 'markdown', required: true, imageGroup: { teams: this.teamId } } ],
+ $localize`Add message`,
+ [ { name: 'message', placeholder: $localize`Message`, type: 'markdown', required: true, imageGroup: { teams: this.teamId } } ],
{ message: [ message, CustomValidators.requiredMarkdown ] },
{ autoFocus: true, onSubmit: this.postMessage.bind(this) }
);
@@ -467,7 +467,7 @@ export class TeamsViewComponent implements OnInit, AfterViewChecked, OnDestroy {
messageType: this.team.teamType,
messagePlanetCode: this.team.teamPlanetCode,
...message
- }, 'Message has been posted successfully').pipe(
+ }, $localize`Message has been posted successfully`).pipe(
switchMap(() => this.sendNotifications('message')),
finalize(() => this.dialogsLoadingService.stop())
).subscribe(() => { this.dialogsFormService.closeDialogsForm(); });
@@ -513,7 +513,7 @@ export class TeamsViewComponent implements OnInit, AfterViewChecked, OnDestroy {
goBack(showMissingMessage = false) {
if (showMissingMessage) {
- this.planetMessageService.showAlert('This team was not found');
+ this.planetMessageService.showAlert($localize`This team was not found`);
}
if (this.mode === 'services') {
this.router.navigate([ '../' ], { relativeTo: this.route });
diff --git a/src/app/teams/teams.component.ts b/src/app/teams/teams.component.ts
index 97368d9ced..0b9264064d 100644
--- a/src/app/teams/teams.component.ts
+++ b/src/app/teams/teams.component.ts
@@ -181,8 +181,8 @@ export class TeamsComponent implements OnInit, AfterViewInit {
const teamType = this.mode === 'enterprise' ? 'sync' : team.teamType;
this.teamsService.addTeamDialog(this.user._id, this.mode, { ...team, teamType }).subscribe(() => {
this.getTeams();
- const action = `${team._id ? 'updated' : 'created'}`;
- const msg = `${toProperCase(this.mode)} ${action} successfully`;
+ const action = $localize`${team._id ? 'updated' : 'created'}`;
+ const msg = $localize`${toProperCase(this.mode)} ${action} successfully`;
this.planetMessageService.showMessage(msg);
});
}
@@ -208,7 +208,7 @@ export class TeamsComponent implements OnInit, AfterViewInit {
this.leaveDialog.close();
this.teams.data = this.teamList(this.teams.data);
const msg = 'left';
- this.planetMessageService.showMessage('You have ' + msg + ' ' + team.name);
+ this.planetMessageService.showMessage($localize`You have ${msg} ${team.name}`);
},
},
changeType: 'leave',
@@ -223,10 +223,10 @@ export class TeamsComponent implements OnInit, AfterViewInit {
request: this.teamsService.archiveTeam(team)().pipe(switchMap(() => this.teamsService.deleteCommunityLink(team))),
onNext: () => {
this.deleteDialog.close();
- this.planetMessageService.showMessage('You have deleted a team.');
+ this.planetMessageService.showMessage($localize`You have deleted a team.`);
this.removeTeamFromTable(team);
},
- onError: () => this.planetMessageService.showAlert('There was a problem deleting this team.')
+ onError: () => this.planetMessageService.showAlert($localize`There was a problem deleting this team.`)
};
}
@@ -254,7 +254,7 @@ export class TeamsComponent implements OnInit, AfterViewInit {
finalize(() => this.dialogsLoadingService.stop())
).subscribe(() => {
this.teams.data = this.teamList(this.teams.data);
- this.planetMessageService.showMessage('Request to join team sent');
+ this.planetMessageService.showMessage($localize`Request to join team sent`);
});
}
diff --git a/src/app/teams/teams.service.ts b/src/app/teams/teams.service.ts
index dcf2e08069..d369f49fa6 100644
--- a/src/app/teams/teams.service.ts
+++ b/src/app/teams/teams.service.ts
@@ -16,37 +16,37 @@ import { planetAndParentId } from '../manager-dashboard/reports/reports.utils';
const nameField = {
'type': 'textbox',
'name': 'name',
- 'placeholder': 'Name',
+ 'placeholder': $localize`Name`,
'required': true
};
const descriptionField = {
'type': 'markdown',
'name': 'description',
- 'placeholder': 'What is your team\'s plan?',
+ 'placeholder': $localize`What is your team\'s plan?`,
'required': false
};
const enterpriseDescField = [
{
'type': 'markdown',
'name': 'description',
- 'placeholder': 'What is your enterprise\'s Mission?',
+ 'placeholder': $localize`What is your enterprise\'s Mission?`,
'required': false
}, {
'type': 'markdown',
'name': 'services',
- 'placeholder': 'What are the Services your enterprise provides?',
+ 'placeholder': $localize`What are the Services your enterprise provides?`,
'required': false
}, {
'type': 'markdown',
'name': 'rules',
- 'placeholder': 'What are the Rules of your enterprise?',
+ 'placeholder': $localize`What are the Rules of your enterprise?`,
'required': false
}
];
const publicField = {
'type': 'toggle',
'name': 'public',
- 'label': 'Public'
+ 'label': $localize`Public`
};
@Injectable({
@@ -67,7 +67,7 @@ export class TeamsService {
addTeamDialog(userId: string, type: 'team' | 'enterprise' | 'services', team: any = {}) {
const configuration = this.stateService.configuration;
- const title = `${team._id ? 'Update' : 'Create'} ${toProperCase(type)}`;
+ const title = $localize`${team._id ? 'Update' : 'Create'} ${toProperCase(type)}`;
const nameControl = type !== 'services' ? { name:
[
team.name || '', CustomValidators.required,
@@ -105,10 +105,10 @@ export class TeamsService {
const typeField = {
'type': 'selectbox',
'name': 'teamType',
- 'placeholder': 'Team Type',
+ 'placeholder': $localize`Team Type`,
'options': [
- { 'value': 'sync', 'name': configuration.planetType === 'community' ? 'Connect with nation' : 'Connect with earth' },
- { 'value': 'local', 'name': 'Local team' }
+ { 'value': 'sync', 'name': $localize`${configuration.planetType === 'community' ? 'Connect with nation' : 'Connect with earth'}` },
+ { 'value': 'local', 'name': $localize`Local team` }
]
};
return [
@@ -263,17 +263,17 @@ export class TeamsService {
const teamMessage = team.type === 'services' ? 'the Community Services Directory' : `"${team.name}" ${teamType}.`;
switch (type) {
case 'message':
- return `${fullName} has posted a message on ${teamMessage}`;
+ return $localize`${fullName} has posted a message on ${teamMessage}`;
case 'request':
- return `${fullName} has requested to join ${teamMessage}`;
+ return $localize`${fullName} has requested to join ${teamMessage}`;
case 'added':
- return `You have been added to ${teamMessage}`;
+ return $localize`You have been added to ${teamMessage}`;
case 'rejected':
- return `You have not been accepted to ${teamMessage}`;
+ return $localize`You have not been accepted to ${teamMessage}`;
case 'removed':
- return `You have been removed from ${teamMessage}`;
+ return $localize`You have been removed from ${teamMessage}`;
default:
- return `${newMembersLength} member(s) has been added to ${teamMessage}`;
+ return $localize`${newMembersLength} member(s) has been added to ${teamMessage}`;
}
}
diff --git a/src/app/upgrade/upgrade.component.html b/src/app/upgrade/upgrade.component.html
index 718d137da6..8f77511b4d 100644
--- a/src/app/upgrade/upgrade.component.html
+++ b/src/app/upgrade/upgrade.component.html
@@ -44,7 +44,7 @@
-
+
diff --git a/src/app/upgrade/upgrade.component.ts b/src/app/upgrade/upgrade.component.ts
index 2e3b1e6f6a..559d5d7896 100644
--- a/src/app/upgrade/upgrade.component.ts
+++ b/src/app/upgrade/upgrade.component.ts
@@ -17,7 +17,7 @@ import { SyncService } from '../shared/sync.service';
export class UpgradeComponent {
mode = 'planet';
enabled: Boolean = true;
- message = 'Start upgrade';
+ message = $localize`Start upgrade`;
output = '';
working: Boolean = false;
done: Boolean = false;
@@ -34,14 +34,14 @@ export class UpgradeComponent {
private syncService: SyncService
) {
this.mode = this.route.snapshot.data.myPlanet === true ? 'myPlanet' : 'planet';
- this.addLine('Not started');
+ this.addLine($localize`Not started`);
}
start() {
this.enabled = false;
- this.message = 'Upgrading';
+ this.message = $localize`Upgrading`;
this.working = true;
- this.addLine('Server request started');
+ this.addLine($localize`Server request started`);
this.timeoutTrials += 1;
}
@@ -91,7 +91,7 @@ export class UpgradeComponent {
}
if (!this.error && this.working) {
- this.message = 'Success';
+ this.message = $localize`Success`;
this.error = false;
this.done = true;
}
@@ -125,23 +125,23 @@ export class UpgradeComponent {
this.working = false;
if (this.timeoutTrials >= 5) {
- this.addLine('Request timed-out', 'upgrade_timeout');
- this.addLine('Request timed-out 5 times. Please try again later.', 'upgrade_error');
+ this.addLine($localize`Request timed-out`, 'upgrade_timeout');
+ this.addLine($localize`Request timed-out 5 times. Please try again later.`, 'upgrade_error');
this.enabled = false;
this.error = true;
this.done = true;
} else {
- this.addLine('Request timed-out, try again.', 'upgrade_timeout');
+ this.addLine($localize`Request timed-out, try again.`, 'upgrade_timeout');
}
}
handleError(err) {
- this.addLine('An error ocurred:', 'upgrade_error');
+ this.addLine($localize`An error ocurred:`, 'upgrade_error');
JSON.stringify(err, null, 1).split('\n').forEach(line => {
this.addLine(line, 'upgrade_error');
});
this.working = false;
- this.message = 'Start upgrade';
+ this.message = $localize`Start upgrade`;
this.error = true;
this.done = true;
}
diff --git a/src/app/users/users-achievements/users-achievements-update.component.ts b/src/app/users/users-achievements/users-achievements-update.component.ts
index ec1763bc6b..a879f69154 100644
--- a/src/app/users/users-achievements/users-achievements-update.component.ts
+++ b/src/app/users/users-achievements/users-achievements-update.component.ts
@@ -118,12 +118,12 @@ export class UsersAchievementsUpdateComponent implements OnInit, OnDestroy {
achievement = { title: '', description: achievement, resources: [], date: '' };
}
this.dialogsFormService.openDialogsForm(
- achievement.title !== '' ? 'Edit Achievement' : 'Add Achievement',
+ achievement.title !== '' ? $localize`Edit Achievement` : $localize`Add Achievement`,
[
- { 'type': 'textbox', 'name': 'title', 'placeholder': 'Title', required: true },
- { 'type': 'date', 'name': 'date', 'placeholder': 'Date', 'required': false },
- { 'type': 'textarea', 'name': 'description', 'placeholder': 'Description', 'required': false },
- { 'type': 'dialog', 'name': 'resources', 'db': 'resources', 'text': 'Add Resources' }
+ { 'type': 'textbox', 'name': 'title', 'placeholder': $localize`Title`, required: true },
+ { 'type': 'date', 'name': 'date', 'placeholder': $localize`Date`, 'required': false },
+ { 'type': 'textarea', 'name': 'description', 'placeholder': $localize`Description`, 'required': false },
+ { 'type': 'dialog', 'name': 'resources', 'db': 'resources', 'text': $localize`Add Resources` }
],
this.fb.group({
...achievement,
@@ -143,12 +143,12 @@ export class UsersAchievementsUpdateComponent implements OnInit, OnDestroy {
addReference(index = -1, reference: any = { name: '' }) {
this.dialogsFormService.openDialogsForm(
- reference.name !== '' ? 'Edit Reference' : 'Add Reference',
+ reference.name !== '' ? $localize`Edit Reference` : $localize`Add Reference`,
[
- { 'type': 'textbox', 'name': 'name', 'placeholder': 'Name', required: true },
- { 'type': 'textbox', 'name': 'relationship', 'placeholder': 'Relationship', 'required': false },
- { 'type': 'textbox', 'name': 'phone', 'placeholder': 'Phone Number', 'required': false },
- { 'type': 'textbox', 'name': 'email', 'placeholder': 'Email', 'required': false }
+ { 'type': 'textbox', 'name': 'name', 'placeholder': $localize`Name`, required: true },
+ { 'type': 'textbox', 'name': 'relationship', 'placeholder': $localize`Relationship`, 'required': false },
+ { 'type': 'textbox', 'name': 'phone', 'placeholder': $localize`Phone Number`, 'required': false },
+ { 'type': 'textbox', 'name': 'email', 'placeholder': $localize`Email`, 'required': false }
],
this.fb.group({
relationship: '',
@@ -228,10 +228,10 @@ export class UsersAchievementsUpdateComponent implements OnInit, OnDestroy {
'createdOn': this.configuration.code, 'username': this.user.name, 'parentCode': this.configuration.parentCode }),
this.userService.updateUser(userInfo)
]).subscribe(() => {
- this.planetMessageService.showMessage('Achievements successfully updated');
+ this.planetMessageService.showMessage($localize`Achievements successfully updated`);
this.goBack();
}, (err) => {
- this.planetMessageService.showAlert('There was an error updating your achievements');
+ this.planetMessageService.showAlert($localize`There was an error updating your achievements`);
});
}
diff --git a/src/app/users/users-achievements/users-achievements.component.ts b/src/app/users/users-achievements/users-achievements.component.ts
index 8f35aab237..459f1543fa 100644
--- a/src/app/users/users-achievements/users-achievements.component.ts
+++ b/src/app/users/users-achievements/users-achievements.component.ts
@@ -74,7 +74,7 @@ export class UsersAchievementsComponent implements OnInit {
if (error.status === 404) {
this.achievementNotFound = true;
} else {
- this.planetMessageService.showAlert('There was an error getting achievements');
+ this.planetMessageService.showAlert($localize`There was an error getting achievements`);
}
});
}
diff --git a/src/app/users/users-table.component.ts b/src/app/users/users-table.component.ts
index 3614e2d2bf..803ad75cfe 100644
--- a/src/app/users/users-table.component.ts
+++ b/src/app/users/users-table.component.ts
@@ -206,23 +206,23 @@ export class UsersTableComponent implements OnInit, OnDestroy, AfterViewInit, On
request: this.usersService.deleteUser(user),
onNext: () => {
this.selection.deselect(user);
- this.planetMessageService.showMessage('User deleted: ' + user.name);
+ this.planetMessageService.showMessage($localize`User deleted: ${user.name}`);
this.deleteDialog.close();
},
- onError: () => this.planetMessageService.showAlert('There was a problem deleting this user.')
+ onError: () => this.planetMessageService.showAlert($localize`There was a problem deleting this user.`)
},
amount: 'single',
changeType: 'delete',
type: 'user',
displayName: user.name,
- extraMessage: user.requestId ? 'Planet associated with it will be disconnected.' : ''
+ extraMessage: user.requestId ? $localize`Planet associated with it will be disconnected.` : ''
}
});
}
removeRole(user: any, roleIndex: number) {
this.usersService.setRolesForUsers([ user ], [ ...user.roles.slice(0, roleIndex), ...user.roles.slice(roleIndex + 1) ])
- .subscribe(() => {}, () => this.planetMessageService.showAlert('There was an error removing the member\'s role'));
+ .subscribe(() => {}, () => this.planetMessageService.showAlert($localize`There was an error removing the member\'s role`));
}
toggleStatus(event, user, type: 'admin' | 'manager', isDemotion: boolean) {
@@ -233,9 +233,9 @@ export class UsersTableComponent implements OnInit, OnDestroy, AfterViewInit, On
request.subscribe(
() => {
this.usersService.requestUsers(true);
- this.planetMessageService.showMessage(`${user.name} ${isDemotion ? 'demoted from' : 'promoted to'} ${type}`);
+ this.planetMessageService.showMessage($localize`${user.name} ${isDemotion ? 'demoted from' : 'promoted to'} ${type}`);
},
- () => this.planetMessageService.showAlert(`There was an error ${isDemotion ? 'demoting' : 'promoting'} user`)
+ () => this.planetMessageService.showAlert($localize`There was an error ${isDemotion ? 'demoting' : 'promoting'} user`)
);
}
@@ -243,7 +243,7 @@ export class UsersTableComponent implements OnInit, OnDestroy, AfterViewInit, On
event.stopPropagation();
this.usersService.setRoles(user, roles).subscribe(() => {
this.usersService.requestUsers(true);
- this.planetMessageService.showMessage(`${user.name} roles modified`);
+ this.planetMessageService.showMessage($localize`${user.name} roles modified`);
});
}
diff --git a/src/app/users/users-update/users-update.component.ts b/src/app/users/users-update/users-update.component.ts
index d994e77bcd..2ec0279393 100644
--- a/src/app/users/users-update/users-update.component.ts
+++ b/src/app/users/users-update/users-update.component.ts
@@ -30,7 +30,7 @@ import { showFormErrors } from '../../shared/table-helpers';
})
export class UsersUpdateComponent implements OnInit {
user: any = {};
- educationLevel = [ 'Beginner', 'Intermediate', 'Advanced', 'Expert' ];
+ educationLevel = [ $localize`Beginner`, $localize`Intermediate`, $localize`Advanced`, $localize`Expert` ];
readonly dbName = '_users'; // make database name a constant
editForm: FormGroup;
currentImgKey: string;
diff --git a/src/app/users/users.component.html b/src/app/users/users.component.html
index 958b59be67..a09375bb44 100644
--- a/src/app/users/users.component.html
+++ b/src/app/users/users.component.html
@@ -41,7 +41,7 @@
-