How To Detect English Language Words Using Machine Learning From Data
Character frequency scanning is one way to do this.
For example for each language obtain a list of character frequencies,
A: 3%
B: 1%
C: 0.5%
D: 0.7%
E: 4%
etc..
Then evaluate your string's character frequency against your static map. You can obtain a probabilistic model of the likelihood of the string being one of your languages.
Of course this works best for longer strings where there is enough statistical data to capture the true frequency. You would also need to train your frequencies on samples from your target source, e.g. English tweets likely have a different letter frequency to works of Shakespeare. 
Another option is to find the most likely n-grams in a language, e.g, 'we' is a common 2-gram in english. If you scan your code for how often these most likely n-grams occur you can generally detect if something is in a specific language or not.
I'm sure there are also other ideas or combinations of classifiers, but this gives you a start. Don't underestimate the power of an ensemble of classifiers either. For example suppose you came up with 3 different models that were all different and uncorrelated, and say each model could detect english correctly 3 times out of 4 (75%). If you then used all 3 models with an equally weighted vote, so if 3 of 3 or 2 of 3 voted english it was classed as english then your error improves to about 3.4 times correct from 4 (85%) (=0.75^3 + 3*0.75^2*0.25)
I have data that contains English text messages.
I want to detect messages that are "written in English letters", but aren't English words. (For example with codes based rules, but I don't want to hard coded the rules).
Please note that the computer being used does not have an active internet connection (so I cannot check against online dictionary).
Example Data

"hello how are you"
"fjrio kjfdelf ejfe" <-- code (let's say is means "how are you" in spanish)
"i am fine thanks"
"10x man"
"jfrojf feoif" <-- code (let's say it means "hello world" in japanish)

I'm new to machine learning, so for my understanding, maybe one approach could 
be using nlp?