Add translations

@param \Haven\CoreBundle\Entity\CategoryTranslation $translation
@return Category
1115
public function addTranslation(\Haven\CoreBundle\Entity\CategoryTranslation $translation) {
        $translation->setParent($this);
        $this->translations[] = $translation;

        return $this;
    }
886692
public function addCategory(\Haven\CoreBundle\Entity\Category $categories)
    {
        $this->categories[] = $categories;
    
        return $this;
    }
1169782
public function removeTranslation(\Haven\CoreBundle\Entity\CategoryTranslation $translation) {
        $this->translations->removeElement($translation);
    }
132314
public function addTranslation(\Haven\PersonaBundle\Entity\StateTranslation $translations)
    {
        $this->translations[] = $translations;
    
        return $this;
    }
451155
public function addTranslation(\Haven\CmsBundle\Entity\TextContentTranslation $translations) {
        $translations->setParent($this);
        $this->translations[] = $translations;

        return $this;
    }
476649
public function set_translation(\Skeleton\I18n\Translation $translation) {
		if ($this->i18n_available === true) {
			$this->translation = $translation;
		} else {
			throw new \Exception('Translation is not available, class not found');
		}
	}
1310632
public function addNodeTranslation(NodeTranslation $nodeTranslation)
    {
        $this->nodeTranslations[] = $nodeTranslation;
        $nodeTranslation->setNode($this);

        return $this;
    }
606514
public function setNodeTranslation(\Kunstmaan\NodeBundle\Entity\NodeTranslation $nodeTranslation = null)
    {
        $this->nodeTranslation = $nodeTranslation;

        return $this;
    }
1198068
public function setTranslations(array $translations)
    {
        if (gettype($translations) == 'array') {
            $translations = new ArrayCollection($translations);
        }

        $this->translations = $translations;

        return $this;
    }
219311
public function addTranslation(\Sulu\Bundle\ProductBundle\Entity\StatusTranslation $translations)
    {
        $this->translations[] = $translations;

        return $this;
    }
220709
public function addTranslation(\Sulu\Bundle\ResourceBundle\Entity\OperatorTranslation $translations)
    {
        $this->translations[] = $translations;

        return $this;
    }
1104816
public function translation($lang)
    {
        $result = Translation::where('entity_id', $this->id)
            ->where('entity_type', get_class($this))
            ->where('language', $lang)
            ->first();

        if ($result) {
            return $result;
        }

        $this->data = $this;

        return $this;
    }
840205
public function addTranslation($translator)
	{
		if (!file_exists( $this->getPath().'/'.TRANSLATIONS )) return;
		$translator->addTranslation( $this->getPath().'/'.TRANSLATIONS );
	}
1177433
protected function _setTranslator($translator)
    {
        if (!(is_null($translator) || $translator instanceof StringTranslatorInterface)) {
            throw new InvalidArgumentException('Invalid translator');
        }

        $this->translator = $translator;

        return $this;
    }
1294985
public static function createFromFieldTranslation(FieldTranslation $translation): self
    {
        $message = new self();
        $message->setLocale($translation->getLocale());
        $message->setValue($translation->getValue());

        return $message;
    }
49608
public function addTranslation(LayoutTranslation $translation)
    {
        $this->translations->add($translation);
        $translation->setLayout($this);
    }
86596
public function translate($category, $message, $language, $basePath)
    {
        $messages = $this->loadMessages($category, $language, $basePath);

       // Core::p($category);

        if ($language == Config::i()->getDefaultLang() && empty($messages[$message])) {
            return $message;
        } elseif (!empty($messages[$message])) {
            return $messages[$message];
        } else {
            return $message;
        }

        return false;
    }