Whether locale is defined (false for null).
locale
false
null
bool hasLocale(String? locale) => locale != null && _locales.contains(locale);