diff --git a/src/discussions/posts/post-editor/PostEditor.jsx b/src/discussions/posts/post-editor/PostEditor.jsx index 825ff15c..c47cab4c 100644 --- a/src/discussions/posts/post-editor/PostEditor.jsx +++ b/src/discussions/posts/post-editor/PostEditor.jsx @@ -286,13 +286,17 @@ function PostEditor({ floatingLabel={intl.formatMessage(messages.topicArea)} > {nonCoursewareTopics.map(topic => ( - {topic.name} + {topic.name || intl.formatMessage(messages.unnamedSubTopics)} + ))} {coursewareTopics.map(category => ( - + {category.topics.map(subtopic => ( - {subtopic.name} + {subtopic.name || intl.formatMessage(messages.unnamedSubTopics)} ))} diff --git a/src/discussions/posts/post-editor/messages.js b/src/discussions/posts/post-editor/messages.js index 8f8f22ae..c5b56362 100644 --- a/src/discussions/posts/post-editor/messages.js +++ b/src/discussions/posts/post-editor/messages.js @@ -121,6 +121,16 @@ const messages = defineMessages({ defaultMessage: 'Actions menu', description: 'Button to see actions for a post or comment', }, + unnamedTopics: { + id: 'discussions.topic.noName.label', + defaultMessage: 'Unnamed category', + description: 'display string for topics with missing names', + }, + unnamedSubTopics: { + id: 'discussions.subtopic.noName.label', + defaultMessage: 'Unnamed subcategory', + description: 'display string for topics with missing names', + }, }); export default messages; diff --git a/src/discussions/topics/messages.js b/src/discussions/topics/messages.js index 6586cc60..073fb8bc 100644 --- a/src/discussions/topics/messages.js +++ b/src/discussions/topics/messages.js @@ -61,7 +61,12 @@ const messages = defineMessages({ }, unnamedTopicCategories: { id: 'discussions.topics.unnamed.label', - defaultMessage: 'Unnamed Topic', + defaultMessage: 'Unnamed category', + description: 'Text to display in place of topic name if topic name is empty', + }, + unnamedTopicSubCategories: { + id: 'discussions.subtopics.unnamed.label', + defaultMessage: 'Unnamed subcategory', description: 'Text to display in place of topic name if topic name is empty', }, }); diff --git a/src/discussions/topics/topic-group/topic/Topic.jsx b/src/discussions/topics/topic-group/topic/Topic.jsx index 57ab1ce8..76df2b70 100644 --- a/src/discussions/topics/topic-group/topic/Topic.jsx +++ b/src/discussions/topics/topic-group/topic/Topic.jsx @@ -51,7 +51,7 @@ function Topic({ - {topic.name} + {topic.name || intl.formatMessage(messages.unnamedTopicSubCategories)}