private function setTranslatedValue(PersistentObject $object, $valueName, $translation, $useDefaults) {
    $mapper = $object->getMapper();
    $isTranslatable = $mapper != null && $mapper->hasAttribute($valueName) ? $mapper->getAttribute($valueName)->hasTag('TRANSLATABLE') : false;
    if ($isTranslatable) {
      // empty the value, if the default language values should not be used
      if (!$useDefaults) {
        $object->setValue($valueName, null, true);
      }
      // translate the value
      if (!($useDefaults && strlen($translation) == 0)) {
        $object->setValue($valueName, $translation, true);
      }
    }
  }