<a href="{link controller='LanguageEdit' id=$language->languageID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
- {if !$language->isDefault}
+ {if $language->isDeletable()}
<span class="icon icon16 fa-times jsTooltip jsDeleteButton pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$language->languageID}" data-confirm-message-html="{lang __encode=true}wcf.acp.language.delete.sure{/lang}"></span>
{else}
<span class="icon icon16 fa-times disabled" title="{lang}wcf.global.button.delete{/lang}"></span>
{
$this->packageID = PACKAGE_ID;
}
+
+ /**
+ * Returns true if this language can be deleted.
+ *
+ * @since 5.4
+ */
+ public function isDeletable(): bool
+ {
+ return !$this->isDefault && $this->languageCode !== 'de' && $this->languageCode !== 'en';
+ }
}
}
}
}
+
+ /**
+ * @inheritDoc
+ */
+ public function validateDelete()
+ {
+ parent::validateDelete();
+
+ foreach ($this->getObjects() as $language) {
+ if (!$language->isDeletable()) {
+ throw new UserInputException('objectIDs');
+ }
+ }
+ }
}