I use a function from GitHub to my project.
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.
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.
Example:
If the name of the user typed on the Hebrew language, the function sends a message on Hebrew to the user.
If the name of the user typed on the Russian language, the function sends a message on Russian to the user.
If the name of the user typed on the English language, the function sends a message on English to the user.
Note:
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.
In node.js the code below does not work!
if (/^[a-zA-Z]+$/.test(text)) //if the English language
{
...
}
else //if the not English language
{
...
}
I will glad to any helps!
Maybe there is another solution to localization the message?
Thanks!!!