language detector functionality