You are here

public static function LingotekLanguageForm::languageEntityBuilder in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::languageEntityBuilder()
  2. 4.0.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::languageEntityBuilder()
  3. 3.0.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::languageEntityBuilder()
  4. 3.1.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::languageEntityBuilder()
  5. 3.2.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::languageEntityBuilder()
  6. 3.3.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::languageEntityBuilder()
  7. 3.4.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::languageEntityBuilder()
  8. 3.5.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::languageEntityBuilder()
  9. 3.6.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::languageEntityBuilder()
  10. 3.7.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::languageEntityBuilder()
  11. 3.8.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::languageEntityBuilder()

Entity builder for the configurable language type form with lingotek options.

Parameters

string $entity_type: The entity type.

\Drupal\language\ConfigurableLanguageInterface $language: The language object.

array $form: The form definition array for the configurable language entity.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

See also

lingotek_form_language_admin_add_form_alter()

lingotek_form_language_admin_edit_form_alter()

File

src/Form/LingotekLanguageForm.php, line 95

Class

LingotekLanguageForm
Alters the Drupal language module language forms.

Namespace

Drupal\lingotek\Form

Code

public static function languageEntityBuilder($entity_type, ConfigurableLanguageInterface $language, array &$form, FormStateInterface $form_state) {
  $form_key = [
    'lingotek_locale',
  ];
  if ($value = $form_state
    ->getValue($form_key)) {
    $language
      ->setThirdPartySetting('lingotek', 'locale', str_replace("-", "_", $value));
  }
}