public function setOrCreateAttributeValueTranslation(AttributeValue $attributeValue, $value, $locale)
    {
        // Check if translation already exists for given locale.
        $attributeValueTranslation = null;
        /** @var AttributeValueTranslation $translation */
        foreach ($attributeValue->getTranslations() as $translation) {
            if ($translation->getLocale() === $locale) {
                $attributeValueTranslation = $translation;
            }
        }
        if (!$attributeValueTranslation) {
            // Create a new attribute value translation.
            $attributeValueTranslation = $this->attributeValueTranslationRepository->createNew();
            $this->entityManager->persist($attributeValueTranslation);
            $attributeValueTranslation->setLocale($locale);
            $attributeValueTranslation->setAttributeValue($attributeValue);
            $attributeValue->addTranslation($attributeValueTranslation);
        }
        $attributeValueTranslation->setName($value);

        return $attributeValueTranslation;
    }