How to reduce locales dropdown list

Step 1.

Set your own preference for Magento\Framework\Locale\ListsInterface:

<preference for='Magento\Framework\Locale\ListsInterface' type='Dfr\Framework\Locale\TranslatedLists' />

Step 2

Inherit \Dfr\Framework\Locale\TranslatedLists from \Magento\Framework\Locale\TranslatedLists and override _getOptionLocales method:

/**
 * @override
 * @see \Magento\Framework\Locale\TranslatedLists::_getOptionLocales()
 * @param bool $translatedName [optional]
 * @return array
 */
protected function _getOptionLocales($translatedName = false) {
	return rm_map_to_options(array(
		'ru_RU' => 'Русский', 'en_US' => 'English', 'uk_UA' => 'Π£ΠΊΡ€Π°Ρ—Π½ΡΡŒΠΊΠ°'
	));
}

1 Like