protected function generateDataForLocale(BundleEntryReaderInterface
$reader, string
$tempDir, string
$displayLocale): ?array
{ // Don't generate aliases, as they are resolved during runtime
// Unless an alias is needed as fallback for de-duplication purposes
if (isset($this->localeAliases
[$displayLocale]) && !
$this->generatingFallback
) { return null;
} // Generate locale names for all locales that have translations in
// at least the language or the region bundle
$displayFormat =
$reader->
readEntry($tempDir.'/lang',
$displayLocale,
['localeDisplayPattern'
]);
$pattern =
$displayFormat['pattern'
] ?? '{0} ({1})';
$separator =
$displayFormat['separator'
] ?? '{0}, {1}';
$localeNames =
[];
foreach ($this->locales
as $locale) { // Ensure a normalized list of pure locales
if (\Locale::
getAllVariants($locale)) { continue;
} try { // Generate a locale name in the language of each display locale