Letting Users Press [enter] on Custom "Translator"

Hi all,

we have a “translator” website where users can enter a word or any letter (as long as it’s from the English alphabet) and the website will translate (more like convert) the word/ letter to a different letters. (i.e., if the user enters ‘look’ it can become ‘appl’, or ‘лоок’, etc.)

When using the website, users cannot hit the [enter] button or else it will translate to ‘undefined’. The code is below, as well as an example of what happens when a user uses the [enter] key. This version of our translator takes English letters and converts them to Cyrillic letters.

We wanted to know if there’s any way to code the translator to allow users to hit the [enter] key and make a new line?

Code:
$w . onReady (() => {
$w ( ‘#englishInput’ ). onKeyPress (() => {
setTimeout (() => {
var english = $w ( ‘#englishInput’ ). value ;
var res = ‘’ ;
if ( english === ‘’ ) {
$w ( ‘#translation’ ). text = ‘’ ;
return false ;
}
for ( var i = 0 ; i < english . length ; i ++) {
res += translate [ english . charAt ( i ). toLowerCase ()]
}
$w ( ‘#translation’ ). text = res ;
}, 100 );
});
});
const translate = {
// Letters
‘a’ : ‘а’ ,
‘b’ : ‘б’ ,
‘c’ : ‘ц’ ,
‘d’ : ‘д’ ,
‘e’ : ‘е’ ,
‘f’ : ‘ф’ ,
‘g’ : ‘г’ ,
‘h’ : ‘х’ ,
‘i’ : ‘и’ ,
‘j’ : ‘ј’ ,
‘k’ : ‘к’ ,
‘l’ : ‘л’ ,
‘m’ : ‘м’ ,
‘n’ : ‘н’ ,
‘o’ : ‘о’ ,
‘p’ : ‘п’ ,
‘q’ : ‘q’ ,
‘r’ : ‘р’ ,
‘s’ : ‘с’ ,
‘t’ : ‘т’ ,
‘u’ : ‘у’ ,
‘v’ : ‘в’ ,
‘w’ : ‘ү’ ,
‘x’ : ‘һ’ ,
‘y’ : ‘ы’ ,
‘z’ : ‘з’ ,

// Other Characters 
'.' :  '.' , 
',' :  ',' , 
'?' :  '?' , 
"'" :  "'" , 
'!' :  '!' , 
'/' :  '/' , 
'(' :  '(' , 
')' :  ')' , 
'&' :  '&' , 
':' :  ':' , 
';' :  ';' , 
'=' :  '=' , 
'+' :  '+' , 
'-' :  '-' , 
'_' :  '_' , 
'"' :  '"' , 
'$' :  '$' , 
'@' :  '@' , 
'' :  '' , 
'{' :  '{' , 
'}' :  '}' , 
'   ' :  '    ' , 
' ' :  ' ' , 
'`' :  '`' , 
'~' :  '~' , 
'[' :  '[' , 
']' :  ']' , 
'<' :  '<' , 
'>' :  '>' , 
'|' :  '|' , 

}

Thanks,
OBW Team