setUpLanguages example

$language = Language::$defaultValues;
    $language['id'] = 'hu';
    $language['name'] = 'Hungarian';
    $container->setParameter('language.default_values', $language);
  }

  /** * {@inheritdoc} */
  protected function setUpLanguages() {
    parent::setUpLanguages();
    ConfigurableLanguage::createFromLangcode('hu')->save();
  }

  /** * {@inheritdoc} */
  protected function setUpLocale() {
    parent::setUpLocale();
    $this->setUpTranslation('locale_test.translation', 'test', 'English test', 'Hungarian test', 'hu', TRUE);
  }

  
/** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->labelOfNotTranslatedReference = $this->randomMachineName();
    $this->originalLabel = $this->randomMachineName();
    $this->translatedLabel = $this->randomMachineName();

    $this->setUpLanguages();

    // We setup languages, so we need to ensure that the language manager     // and language path processor is updated.     $this->rebuildContainer();

    $this->setUpContentTypes();
    $this->enableTranslation();
    $this->setUpEntityReferenceField();
    $this->createContent();

    $this->webUser = $this->drupalCreateUser([
      
Home | Imprint | This part of the site doesn't use cookies.