Commit 9ac2a7da authored by catch's avatar catch

Issue #2254495 by sun, ParisLiakos, alexpott: Followup to Move...

Issue #2254495 by sun, ParisLiakos, alexpott: Followup to Move language_admin_predefined_list to ConfigurableLanguageManager.
parent c056dd6e
......@@ -410,7 +410,7 @@ public function getLanguageConfigOverride($langcode, $name) {
/**
* {@inheritdoc}
*/
public function getUnusedPredefinedList() {
public function getStandardLanguageListWithoutConfigured() {
$languages = $this->getLanguages();
$predefined = $this->getStandardLanguageList();
foreach ($predefined as $key => $value) {
......
......@@ -97,11 +97,11 @@ public function updateLockedLanguageWeights();
public function getLanguageConfigOverride($langcode, $name);
/**
* Prepare a language code list for unused predefined languages.
* Returns the standard language list excluding already configured languages.
*
* @return array
* List of predefined language names keyed by langcode.
* A list of standard language names keyed by langcode.
*/
public function getUnusedPredefinedList();
public function getStandardLanguageListWithoutConfigured();
}
......@@ -29,7 +29,7 @@ public function getFormId() {
public function form(array $form, array &$form_state) {
$form['#title'] = $this->t('Add language');
$predefined_languages = $this->languageManager->getUnusedPredefinedList();
$predefined_languages = $this->languageManager->getStandardLanguageListWithoutConfigured();
$predefined_languages['custom'] = $this->t('Custom language...');
$predefined_default = !empty($form_state['values']['predefined_langcode']) ? $form_state['values']['predefined_langcode'] : key($predefined_languages);
......
......@@ -70,12 +70,12 @@ public function buildForm(array $form, array &$form_state) {
// only. If we do have already added languages, set up two option groups with
// the list of existing and then predefined languages.
if (empty($existing_languages)) {
$language_options = $this->languageManager->getUnusedPredefinedList();
$language_options = $this->languageManager->getStandardLanguageListWithoutConfigured();
}
else {
$language_options = array(
$this->t('Existing languages') => $existing_languages,
$this->t('Languages not yet added') => $this->languageManager->getUnusedPredefinedList()
$this->t('Languages not yet added') => $this->languageManager->getStandardLanguageListWithoutConfigured(),
);
}
......
......@@ -89,14 +89,14 @@ public function buildForm(array $form, array &$form_state) {
// languages only. If we do have already added languages, set up two option
// groups with the list of existing and then predefined languages.
if (empty($existing_languages)) {
$language_options = $this->languageManager->getUnusedPredefinedList();
$language_options = $this->languageManager->getStandardLanguageListWithoutConfigured();
$default = key($language_options);
}
else {
$default = key($existing_languages);
$language_options = array(
$this->t('Existing languages') => $existing_languages,
$this->t('Languages not yet added') => $this->languageManager->getUnusedPredefinedList()
$this->t('Languages not yet added') => $this->languageManager->getStandardLanguageListWithoutConfigured(),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment