Skip to content

Commit c5c1636

Browse files
committed
Code review fixes
1 parent 3a21004 commit c5c1636

4 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/SIL.XForge.Scripture/ClientApp/src/app/shared/text/text.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ describe('TextComponent', () => {
118118
env.runWithDelayedGetText(env.notPresentTextDocId, () => {
119119
env.id = env.notPresentTextDocId;
120120
env.waitForEditor();
121-
expect(env.component.placeholder).toEqual('text.book_does_not_exist');
121+
expect(env.component.placeholder).toEqual('text.this_book_does_not_exist');
122122
});
123123

124124
// The user is offline and goes to a location that the project does not have. The placeholder should indicate
@@ -128,7 +128,7 @@ describe('TextComponent', () => {
128128
env.runWithDelayedGetText(env.notPresentTextDocId, () => {
129129
env.id = env.notPresentTextDocId;
130130
env.waitForEditor();
131-
expect(env.component.placeholder).toEqual('text.book_does_not_exist');
131+
expect(env.component.placeholder).toEqual('text.this_book_does_not_exist');
132132
});
133133
env.onlineStatus = true;
134134
env.waitForEditor();
@@ -146,7 +146,7 @@ describe('TextComponent', () => {
146146
env.waitForEditor();
147147
env.id = env.notPresentTextDocId;
148148
env.waitForEditor();
149-
expect(env.component.placeholder).toEqual('text.book_does_not_exist');
149+
expect(env.component.placeholder).toEqual('text.this_book_does_not_exist');
150150

151151
const callback: (env: TestEnvironment) => void = (env: TestEnvironment) => {
152152
env.realtimeService.addSnapshot<User>(UserDoc.COLLECTION, {

src/SIL.XForge.Scripture/ClientApp/src/app/shared/text/text.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ export class TextComponent implements AfterViewInit, OnDestroy {
351351
const bookName = this.transloco.translate(`canon.book_names.${bookId}`);
352352
return this.project.texts.some(t => t.bookNum === this.id!.bookNum)
353353
? this.transloco.translate('text.chapter_does_not_exist', { projectName: this.project.name })
354-
: this.transloco.translate('text.book_does_not_exist', { bookName, projectName: this.project.name });
354+
: this.transloco.translate('text.this_book_does_not_exist', { bookName, projectName: this.project.name });
355355
case 'offline-or-loading':
356356
if (this.onlineStatusService.isOnline) {
357357
return this.transloco.translate('text.loading');

src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,6 @@ export class EditorComponent extends DataLoadingComponent implements OnDestroy,
481481
return this._bookNum;
482482
}
483483

484-
get bookName(): string {
485-
return this.text == null ? '' : Canon.bookNumberToEnglishName(this.text.bookNum);
486-
}
487-
488484
get currentUser(): User | undefined {
489485
return this.currentUserDoc == null ? undefined : this.currentUserDoc.data;
490486
}

src/SIL.XForge.Scripture/ClientApp/src/assets/i18n/checking_en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,13 +485,13 @@
485485
"upgrade_safari": "{{ newLine }}We recommend upgrading to the latest {{ safariLink }}."
486486
},
487487
"text": {
488-
"book_does_not_exist": "{{ bookName }} does not exist in {{ projectName }}",
489488
"book_is_empty": "This book is empty. Add chapters in Paratext.",
490489
"chapter_does_not_exist": "This chapter does not exist in {{ projectName }}",
491490
"error": "An error occurred while loading the text",
492491
"loading": "Loading...",
493492
"not_available_offline": "This text is not available offline. Connect to the Internet to see the text.",
494-
"permission_denied": "You do not have permission to view this text. Please contact the project's administrator to get permission."
493+
"permission_denied": "You do not have permission to view this text. Please contact the project's administrator to get permission.",
494+
"this_book_does_not_exist": "{{ bookName }} does not exist in {{ projectName }}"
495495
},
496496
"text_chooser_dialog": {
497497
"cancel": "Cancel",

0 commit comments

Comments
 (0)