+ // If specified, rely on the langcode property for the language, so that the
+ // existing language of an alias can be kept. That could for example be
+ // unspecified even if the field/entity has a specific langcode.
+ $alias_langcode = ($this->langcode && $this->pid) ? $this->langcode : $this->getLangcode();
+