From f248de0dc5200048a9b6e0331e4ee2fb427f66a3 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Sun, 23 Nov 2014 12:52:34 -0800 Subject: [PATCH] Adding i18n to skill docs. --- app/locale/en.coffee | 18 +++++ .../tome/spell_palette_entry_popover.jade | 68 +++++++++++++------ 2 files changed, 66 insertions(+), 20 deletions(-) diff --git a/app/locale/en.coffee b/app/locale/en.coffee index 92615b86b..987e29bdb 100644 --- a/app/locale/en.coffee +++ b/app/locale/en.coffee @@ -351,6 +351,24 @@ blocks: "Blocks" # As in "this shield blocks this much damage" skills: "Skills" + skill_docs: + writable: "writable" # Hover over "attack" in Your Skills while playing a level to see most of this + read_only: "read-only" + action_name: "name" + action_cooldown: "Takes" + action_specific_cooldown: "Cooldown" + action_damage: "Damage" + action_range: "Range" + action_radius: "Radius" + action_duration: "Duration" + example: "Example" + ex: "ex" # Abbreviation of "example" + current_value: "Current Value" + default_value: "Default value" + parameters: "Parameters" + returns: "Returns" + granted_by: "Granted by" + save_load: granularity_saved_games: "Saved" granularity_change_history: "History" diff --git a/app/templates/play/level/tome/spell_palette_entry_popover.jade b/app/templates/play/level/tome/spell_palette_entry_popover.jade index bd10fc3dd..251d068ce 100644 --- a/app/templates/play/level/tome/spell_palette_entry_popover.jade +++ b/app/templates/play/level/tome/spell_palette_entry_popover.jade @@ -3,57 +3,71 @@ h4 | - code.prop-type= doc.type == 'function' && doc.owner == 'this' ? 'method' : doc.type if doc.type != 'function' + | ( if writable - | (writable) + span(data-i18n="skill_docs.writable") writable else - | (read-only) + span(data-i18n="skill_docs.read_only") read-only + | ) .description p!= marked(doc.description || 'Still undocumented, sorry.') if cooldowns && (cooldowns.cooldown || cooldowns.specificCooldown) p span - | #{cooldowns.type == 'spell' ? 'Spell' : 'Action'} name: + | #{cooldowns.type == 'spell' ? 'Spell' : 'Action'} + span.spl(data-i18n="skill_docs.action_name") name + span.spr : code "#{cooldowns.name}" | . span.spl - | Cooldown: + span(data-i18n="skill_docs.action_cooldown") Takes + span.spr : code= cooldowns.cooldown | s. if cooldowns.specificCooldown span.spl - | Specific cooldown: + span(data-i18n="skill_docs.action_specific_cooldown") Cooldown + span.spr : code= cooldowns.specificCooldown | s. if cooldowns.damage span.spl - | Damage: + span(data-i18n="skill_docs.action_damage") Damage + span.spr : code= cooldowns.damage | . if cooldowns.range span.spl - | Range: + span(data-i18n="skill_docs.action_range") Range + span.spr : code= cooldowns.range | m. if cooldowns.radius span.spl - | Radius: + span(data-i18n="skill_docs.action_radius") Radius + span.spr : code= cooldowns.radius | m. if cooldowns.duration span.spl - | Duration: + span(data-i18n="skill_docs.action_duration") Duration + span.spr : code= cooldowns.duration | s. if !selectedMethod if doc.example p.example - strong Example: + strong + span(data-i18n="skill_docs.example") Example + | : div!= marked("```\n" + doc.example + "```") else if doc.type == 'function' && argumentExamples.length p.example - strong Example: + strong + span(data-i18n="skill_docs.example") Example + | : div if language == 'javascript' code= doc.owner + '.' + doc.name + '(' + argumentExamples.join(', ') + ');' @@ -70,36 +84,48 @@ if !selectedMethod if (doc.type != 'function' && doc.type != 'snippet') || doc.name == 'now' p.value - strong Current Value: + strong + span(data-i18n="skill_docs.current_value") Current Value + span.spr : pre code.current-value(data-prop=doc.name)= value if doc.args && doc.args.length p.args - strong Parameters: + strong + span(data-i18n="skill_docs.parameters") Parameters + span.spr : for arg in doc.args div code= arg.name - | : + span.spr : code= arg.type if arg.example - | (ex: + | ( + span(data-i18n="skill_docs.ex") ex + span.spr : code= arg.example | ) if arg.description div!= marked(arg.description) if arg.default div - em Default value: + em + span(data-i18n="skill_docs.default_value") Default value + span.spr : code= arg.default - + if doc.returns p.returns - strong Returns: + strong + span(data-i18n="skill_docs.returns") Returns + span.spr : div code= doc.returns.type if doc.returns.example - | (ex: + | ( + span(data-i18n="skill_docs.ex") ex + span.spr : code= doc.returns.example | ) if doc.returns.description @@ -107,7 +133,9 @@ if doc.returns if item p - em Granted by #{item.get('name')}. + em + span.spr(data-i18n="skill_docs.granted_by") Granted by + | #{item.get('name')}. if selectedMethod p