Skip to content

Commit

Permalink
strings
Browse files Browse the repository at this point in the history
  • Loading branch information
eanders-ms committed Feb 11, 2024
1 parent d5ae202 commit c55c958
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions teachertool/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

export namespace Strings {
export const ConfirmReplaceRubric = lf("This will replace your current rubric. Continue?");
export const UntitledProject = lf("Untitled Project");
export const UntitledRubric = lf("Untitled Rubric");
}

namespace Constants {
Expand Down
5 changes: 3 additions & 2 deletions teachertool/src/state/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ErrorCode } from "../types/errorCode";
import { Rubric } from "../types/rubric";
import { stateAndDispatch } from "./appStateContext";
import { AppState } from "./state";
import { Strings } from "../constants";

export function getCatalogCriteriaWithId(id: string): CatalogCriteria | undefined {
const { state } = stateAndDispatch();
Expand Down Expand Up @@ -53,12 +54,12 @@ export function isRubricLoaded(state: AppState): boolean {

export function getSafeProjectName(state: AppState): string | undefined {
if (state.projectMetadata) {
return state.projectMetadata.name ?? lf("Untitled Project");
return state.projectMetadata.name ?? Strings.UntitledProject;
}
}

export function getSafeRubricName(state: AppState): string | undefined {
return state.rubric.name || lf("Untitled Rubric");
return state.rubric.name || Strings.UntitledRubric;
}

export function getSelectableCatalogCriteria(state: AppState): CatalogCriteria[] {
Expand Down

0 comments on commit c55c958

Please sign in to comment.