MCPcopy Create free account
hub / github.com/codecombat/codecombat / getGameContentDisplayType

Function getGameContentDisplayType

ozaria/site/common/ozariaUtils.js:385–398  ·  view source on GitHub ↗
(contentType, withLevelSuffix = true, withProjectSuffix = false)

Source from the content-addressed store, hash-verified

383// `withLevelSuffix` will append 'Level' to the names for practice/capstone/challenge levels
384// `withProjectSuffix` will append 'Project' to the capstone name
385export function getGameContentDisplayType (contentType, withLevelSuffix = true, withProjectSuffix = false) {
386 if (!contentType) {
387 contentType = 'hero'
388 }
389 if (contentType.startsWith('practice')) {
390 return internationalizeLevelType('practice', withLevelSuffix, withProjectSuffix)
391 } else if (contentType.startsWith('capstone')) {
392 return internationalizeLevelType('capstone', withLevelSuffix, withProjectSuffix)
393 } else if (contentType.startsWith('challenge')) {
394 return internationalizeLevelType('challenge', withLevelSuffix, withProjectSuffix)
395 } else {
396 return internationalizeContentType(contentType)
397 }
398}

Callers 1

Calls 2

Tested by

no test coverage detected