title: Detect a language of a string in node.js
body: <p>I use a function from <a href="https://github.com/firebase/functions-samples/tree/master/quickstarts/email-users" rel="noreferrer">GitHub</a> to my project.</p>
  
  <p>Function sends a welcome email when a new user signs up and a goodbye email when user accounts are deleted. The function is loading to Firebase Cloud Function.</p>
  
  <p>I'm trying to supplement the code so that it determines by the name of the user in what language he needs to send the message.</p>
  
  <p><strong>Example:</strong></p>
  
  <p>If the name of the user typed on the Hebrew language, the function sends a message on Hebrew to the user.</p>
  
  <p>If the name of the user typed on the Russian language, the function sends a message on Russian to the user.</p>
  
  <p>If the name of the user typed on the English language, the function sends a message on English to the user.</p>
  
  <p><strong>Note:</strong></p>
  
  <p>This does not connect with a browser, because a user will register from the android application. And after user Authentication on Firebase, he will get a message from Firebase Cloud Function.</p>
  
  <p>In node.js the code below does not work!</p>
  
  <pre><code>if (/^[a-zA-Z]+$/.test(text)) //if the English language 
  {
    ...
  } 
  else //if the not English language
  {
    ...
  }
  </code></pre>
  
  <p>I will glad to any helps!</p>
  
  <p>Maybe there is another solution to localization the message?</p>
  
  <p>Thanks!!!</p>