public function getList($locale = null)
{
if ($this->countryRepository) {
$countryNames = $this->countryRepository->getList($locale);
} else {
$locale = LocaleHelper::canonicalize($locale);
// symfony/intl uses underscores.
$locale = str_replace('-', '_', $locale);
$countryNames = $this->regionBundle->getCountryNames($locale);
}
return $countryNames;
}