Added language detection based on file extension