Add operator keywords and truth values to translations

Add and tweak code translations

Translate shortened words to complete words
This commit is contained in:
phoenixeliot 2016-04-28 17:01:13 -07:00
parent ff48734a52
commit 9cb6e99942
2 changed files with 35 additions and 3 deletions
app
locale
views/play/level/tome

View file

@ -190,20 +190,52 @@ module.exports = nativeDescription: "English", englishDescription: "English", tr
code:
if: "if" # Keywords--these translations show up on hover, so please translate them all, even if it's kind of long. (In the code editor, they will still be in English.)
else: "else"
elif: "elif"
elif: "else if"
while: "while"
loop: "loop"
for: "for"
break: "break"
continue: "continue"
pass: "pass"
return: "return"
then: "then"
do: "do"
end: "end"
function: "function"
def: "def" # (short for "define")
def: "define"
var: "variable"
self: "self"
hero: "hero"
this: "this"
or: "or"
"||": "or"
and: "and"
"&&": "and"
not: "not"
"!": "not"
"=": "assign" # For this section, conjugate it like it's the verb part of a sentence when possible
"==": "equals"
"===": "strictly equals"
"!=": "does not equal"
"!==": "does not strictly equal"
">": "is greater than"
">=": "is greater than or equal"
"<": "is less than"
"<=": "is less than or equal"
"*": "multiplied by"
"/": "divided by"
"+": "plus"
"-": "minus"
"+=": "add and assign"
"-=": "subtract and assign"
True: "True"
true: "true"
False: "False"
false: "false"
undefined: "undefined"
null: "null"
nil: "nil"
None: "None"
share_progress_modal:
blurb: "Youre making great progress! Tell your parent how much you've learned with CodeCombat."

View file

@ -37,7 +37,7 @@ module.exports = class SpellTranslationView extends CocoView
@$el.show().css(@pos)
isIdentifier: (t) ->
t and (t.type in ['identifier', 'keyword'] or t.value is 'this')
t and (_.any([/identifier/, /keyword/], (regex) -> regex.test(t.type)) or t.value is 'this')
onMouseMove: (e) =>
return if @destroyed