Internationalize PlayGameDevLevelView

This commit is contained in:
Scott Erickson 2016-08-10 11:13:20 -07:00
parent ffa840910d
commit ff2d505720
3 changed files with 21 additions and 9 deletions

View file

@ -574,6 +574,16 @@
tip_programming_not_about_computers: "Computer Science is no more about computers than astronomy is about telescopes. - Edsger Dijkstra" tip_programming_not_about_computers: "Computer Science is no more about computers than astronomy is about telescopes. - Edsger Dijkstra"
tip_mulan: "Believe you can, then you will. - Mulan" tip_mulan: "Believe you can, then you will. - Mulan"
play_game_dev_level:
created_by: "Created by {{name}}"
how_to_play_title: "How to play:"
how_to_play_1: "Use the mouse to control the hero!"
how_to_play_2: "Click anywhere on the map to move to that location."
how_to_play_3: "Click on the ogres to attack them."
restart: "Restart Level"
play: "Play Level"
play_more_codecombat: "Play More CodeCombat"
game_menu: game_menu:
inventory_tab: "Inventory" inventory_tab: "Inventory"
save_load_tab: "Save/Load" save_load_tab: "Save/Load"

View file

@ -15,7 +15,7 @@
if view.level.id && view.session.id if view.level.id && view.session.id
h3.m-y-1= view.level.get('name') h3.m-y-1= view.level.get('name')
h4 Created by #{view.session.get('creatorName')} h4= view.state.get('creatorString')
hr hr
if view.state.get('loading') if view.state.get('loading')
@ -24,24 +24,24 @@
.progress-bar(style="width: #{view.state.get('progress')}") .progress-bar(style="width: #{view.state.get('progress')}")
if ready if ready
h3 Goals h3(data-i18n="play_level.goals")
for goalName in view.state.get('goalNames') for goalName in view.state.get('goalNames')
p= goalName p= goalName
hr hr
h3 How to play: h3(data-i18n="play_game_dev_level.how_to_play_title")
p Use the mouse to control the hero! p(data-i18n="play_game_dev_level.how_to_play_1")
p Click anywhere on the map to move to that location. p(data-i18n="play_game_dev_level.how_to_play_2")
p Click on the ogres to attack them. p(data-i18n="play_game_dev_level.how_to_play_3")
if ready if ready
.panel-footer .panel-footer
- var playing = view.state.get('playing') - var playing = view.state.get('playing')
if playing if playing
button#play-btn.btn.btn-lg.btn-burgandy.btn-block Restart Level button#play-btn.btn.btn-lg.btn-burgandy.btn-block(data-i18n="play_game_dev_level.restart")
else else
button#play-btn.btn.btn-lg.btn-forest.btn-block Play Level button#play-btn.btn.btn-lg.btn-forest.btn-block(data-i18n="play_game_dev_level.play")
#share-row.m-t-3 #share-row.m-t-3
if ready if ready
@ -55,4 +55,4 @@
span(data-i18n='sharing.copy_url') span(data-i18n='sharing.copy_url')
.panel-body .panel-body
a#play-more-codecombat-btn.btn.btn-lg.btn-navy-alt.pull-right(href="/") Play More CodeCombat a#play-more-codecombat-btn.btn.btn-lg.btn-navy-alt.pull-right(href="/", data-i18n="play_game_dev_level.play_more_codecombat")

View file

@ -33,6 +33,7 @@ module.exports = class PlayGameDevLevelView extends RootView
@state = new State({ @state = new State({
loading: true loading: true
progress: 0 progress: 0
creatorString: ''
}) })
@supermodel.on 'update-progress', (progress) => @supermodel.on 'update-progress', (progress) =>
@ -92,6 +93,7 @@ module.exports = class PlayGameDevLevelView extends RootView
loading: false loading: false
goalNames goalNames
shareURL shareURL
creatorString: $.i18n.t('play_game_dev_level.created_by').replace('{{name}}', @session.get('creatorName'))
}) })
@eventProperties = { @eventProperties = {
category: 'Play GameDev Level' category: 'Play GameDev Level'