Add auto-detection capabilities to the Lang class.

Signed-off-by: Etienne Samson <tiennou7@gmail.com>