Delete a translation of content.

@param string $locale
@param $id
548724
public function deleteTranslation($locale, $id)
    {
        if ('en' === $locale) {
            $content = $this->content->findOneBy(['id' => $id]);
        } else {
            $content = $this->translations->findOneBy(['foreignKey' => $id, 'locale' => $locale]);
        }

        if ($content instanceof ContentTranslation || $content instanceof Content) {
            $this->manager->remove($content);
            $this->manager->flush();
        }
    }
1075961
public function deleteAction(Request $request, $id)
    {

        $handler = new LanguageFormHandler(
            $this->createDeleteForm(),
            $request,
            $this->get('doctrine')->getManager(),
            $this->get('session')->getFlashBag()
        );


        $entity = $this->getDoctrine()->getRepository('BaconLanguageBundle:Language')->find($id);

        if ($handler->delete($entity)) {
            return $this->redirect($this->generateUrl('admin_language'));
        }

        return $this->redirect($this->generateUrl('admin_language_show', array('id' => $id)));
    }
473657
public function findById($id, $locale)
    {
        $currency = $this->currencyRepository->findById($id);

        return new Currency($currency, $locale);
    }
1267472
public function delete($lang, $id)
    {
        if ($this->deleteUser($id)) {
            $result = $this->response('User is deleted');
        }else{
            $result = $this->response('Internal server error. Please try again later', 500);
        }
        return $result;
    }
298338
public function findByIdAndLocale($id, $locale)
    {
        $item = $this->itemRepository->findByIdAndLocale($id, $locale);

        if ($item) {
            return $this->itemFactory->createApiEntity($item, $locale);
        } else {
            return null;
        }
    }
632789
function removeLocale(context, payload) {
      context.commit({
        type: 'REMOVE_LOCALE',
        locale: payload.locale,
        translations: payload.translations
      });
    }
595910
public function deleteIndex($entity, $entity_id, $language)
    {
        $values = array(
            'entity' => $entity,
            'language' => $language,
            'entity_id' => $entity_id
        );

        return (bool) $this->db->delete('search_index', $values);
    }
734425
public function removeLocalidad(\Matudelatower\UbicacionBundle\Entity\Localidad $localidad) {
        $this->localidad->removeElement($localidad);
    }
1203552
public function removeEntryAction($locale, $domain, $key)
    {
        $this->securityCheck($domain, $locale);

        $this->getSessionImporter()->remove($domain, $key, $locale);
        $session = $this->getSession();
        $session->getFlashBag()->set('success', 'Entry removed');

        return $this->redirect($this->generateUrl('liip_translation_import'));
    }
273710
public function deleteTranslationFromContent($contentId, $languageCode)
    {
        $language = $this->languageHandler->loadByLanguageCode($languageCode);

        $this->connection->beginTransaction();
        try {
            $this->deleteTranslationFromContentVersions($contentId, $language->id);
            $this->deleteTranslationFromContentNames($contentId, $languageCode);
            $this->deleteTranslationFromContentObject($contentId, $language->id);

            $this->connection->commit();
        } catch (DBALException $e) {
            $this->connection->rollBack();
            throw $e;
        }
    }
385187
public function deleteQueryTranslations(array $queryIds, ?int $status = null, ?string $locale = null): void
    {
        $query = $this->connection->createQueryBuilder();

        $query->delete('ngbm_collection_query_translation')
            ->where(
                $query->expr()->in('query_id', [':query_id'])
            )
            ->setParameter('query_id', $queryIds, Connection::PARAM_INT_ARRAY);

        if ($status !== null) {
            $this->applyStatusCondition($query, $status);
        }

        if ($locale !== null) {
            $query
                ->andWhere($query->expr()->eq('locale', ':locale'))
                ->setParameter(':locale', $locale, Type::STRING);
        }

        $query->execute();
    }
1006365
static function removeLanguage( $id )
    {
        $language = eZContentLanguage::fetch( $id );
        if ( $language )
        {
            return $language->removeThis();
        }
        else
        {
            return false;
        }
    }
361842
public function setLocale($locale) {
		$this->locale = $locale;
		
		if ($this->checkTranslateObjectIsSet()) {
			$this->translation->setLocale($this->locale);
		}
	}
1334477
public function deleteTranslation($language, Entity $entity = null, Repository $repository = null)
    {
        if (!$entity) {
            $entity = $this->getEntity();
        }

        if (!$repository) {
            $repository = $entity->getRepository();
        }

        $repository = $repository->aliased('write');

        $deleted = $repository->deleteTranslation($this, $entity, $language);

        return $deleted;
    }
1157119
public function disable($id)
    {
        $this->loadModel('Locale.Languages');
        $language = $this->Languages->get($id);

        if (!in_array($language->code, [CORE_LOCALE, option('default_language')])) {
            $language->set('status', false);
            if ($this->Languages->save($language)) {
                $this->Flash->success(__d('locale', 'Language successfully disabled!'));
            } else {
                $this->Flash->danger(__d('locale', 'Language could not be disabled, please try again.'));
            }
        } else {
            $this->Flash->danger(__d('locale', 'You cannot disable this language as it still in use.'));
        }

        $this->title(__d('locale', 'Disable Language'));
        $this->redirect($this->referer());
    }
71678
public function delete($lang, $id)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Tags', 'delete')) {
            return $this->noPermission();
        }

        $tagDeleteRes = $this->deleteTag($id);
        if(gettype($tagDeleteRes) == "boolean") {
            if($tagDeleteRes) {
                return $this->response('Tag is successfully deleted');
            }
        }else{
            return $tagDeleteRes;
        }
        return $this->response('Tag could not be deleted. Please try again later or contact your Administrator!', 500);
    }
285015
public function deleteTranslation(string $locale)
    {
        $model = $this;

        $this->forgetAllTranslations($locale);
        $this->save();

        Event::fire(new ModelUpdate($model, 'Deleted', $locale));
    }