Used internationalised strings for level not found message

This commit is contained in:
Tay Yang Shun 2014-02-26 05:54:33 +08:00
parent e3a81137e0
commit 11c5f7419a
4 changed files with 2 additions and 6 deletions

View file

@ -93,9 +93,6 @@ module.exports = class LevelLoader extends CocoClass
@supermodel.populateModel @level
onSupermodelError: ->
# msg = $.i18n.t('play_level.level_load_error',
# defaultValue: "Level could not be loaded.")
# $('body').append('<div class="alert">' + msg + '</div>')
onSupermodelLoadedOne: (e) ->
@update()

View file

@ -4,7 +4,7 @@ block content
if notFound
div(class="alert alert-warning")
h2 Oops, the level "#{notFound}" was not found!
h2 #{notFoundMessage}
h1(data-i18n="play.choose_your_level") Choose Your Level
p

View file

@ -98,8 +98,6 @@ module.exports = class PlayLevelView extends View
onLevelLoadError: (e) =>
application.router.navigate "/play?not_found=#{@levelID}", {trigger: true}
# msg = $.i18n.t('play_level.level_load_error', defaultValue: "Level could not be loaded.")
# @$el.html('<div class="alert"><h2>Whoops we were not able to find ' + @levelID + '!</h2><p>' + msg + '</p><p>Please select a valid level from the <a href="/play">levels</a> page.</p></div>')
setLevel: (@level, @supermodel) ->
@god?.level = @level.serialize @supermodel

View file

@ -9,6 +9,7 @@ module.exports = class PlayView extends View
context = super(context)
context.home = true
context.notFound = @getQueryVariable 'not_found'
context.notFoundMessage = $.i18n.t('play_level.level_load_error') + context.notFound
tutorials = [
{
name: 'Rescue Mission'