Added language caching for faster validity check