Update translations

@param array $values
340277
public function updateTranslations(array $values)
    {
        $array = [];

        foreach ($values as $lang => $data) {
            $array['locale'] = $lang;

            foreach ($this->translatedAttributes as $key => $attribute) {
                $array[$attribute] = isset($values[$lang][$attribute]) ? $values[$lang][$attribute] : '';
            }

            $translation = $this->translations()->where('locale', $lang)->first();

            // Make sure we can translate Stapler files as well
            $staplerConfig = (array)object_get(new $this->translationModel(), 'staplerConfig', []);
            $staplerFields = array_keys($staplerConfig);
            foreach ($staplerFields as $staplerField) {
                $array = collect($array)->filter(function ($value, $key) use ($staplerField) {

                    $removable = [
                        $staplerField . '_file_name',
                        $staplerField . '_file_size',
                        $staplerField . '_content_type',
                        $staplerField . '_updated_at'
                    ];

                    if (in_array($key, $removable)) {
                        return false;
                    }

                    return true;
                })->toArray();
            }

            if (! $translation) {
                $this->translations()->create($array);
            } else {
                $translation->update($array);
            }
        }
    }
1161978
public function update(array $values): ResultInterface
    {
        $this->update       = $this->getTableName();
        $this->updateValues = $values;

        return $this->execute();
    }
374378
public function setValues($values=array()) {
		$count=$this->count();
		$isArray=true;
		if (\is_array($values) === false) {
			$values=\array_fill(0, $count, $values);
			$isArray=false;
		}
		if (JArray::dimension($values) == 1 && $isArray)
			$values=[ $values ];

		$count=\min(\sizeof($values), $count);

		for($i=0; $i < $count; $i++) {
			$row=$this->content[$i];
			$row->setValues($values[$i]);
		}
		return $this;
	}
821768
function setValue($values) {
        $values = (array)$values;
        foreach ($values as $name=>$value) {
            if (array_key_exists($name, $this->_values)) {
                $this->_values[$name] = $value;
            }
        }
    }
541487
public function setResults(array $values)
    {
        foreach ($values as $field => $value) {
            if (empty($value)) {
                continue;
            }
            $this->setResult($field, $value);
        }

        return $this;
    }
77171
public function setReplaceValues(array $values, $notReplacedGetEmpty = true)
    {
        $this->replaceValues = $values;
        $this->notReplacedGetEmpty = (bool) $notReplacedGetEmpty;

        $this->setFilterDefaultOperation(Filter::EQUAL);
        $this->setFilterSelectOptions($values);
    }
616803
public function setTranslations($translations)
    {
        $this->currentState = self::UNFILTERED;
        $this->translations = $translations;
        $this->applyFilters();
    }
1082825
public function setAllValues(array $values)
    {
        foreach ($values as $key => $value) {
            $this->$key = $value;
        }

        return $this;
    }
743483
public function setInitValues(array $values)
    {
        if (isset($this->data['isSend']) == false || $this->data['isSend'] != true) {
            foreach ($this->elements as $name => $element) {
                if ($element instanceof ElementInterface) {
                    if (array_key_exists($name, $values)) {
                        $element->setValue($values[$name]);
                    }
                }
            }
        }
    }
188780
public function addLanguageValues($values)
    {
        $this->_languageValues = array_unique(array_merge($this->getLanguageValues(true), $this->filterLanguageValues($values)));
    }
762088
public function addExtraKeys(array $values)
    {
        foreach ($values as $key => $value) {
            $this->setExtraKey($key, $value);
        }
    }
80593
public function batchValues(array $values){
        ValuesImpl::batchValues($this->context, $values);
        return new OnDuplicateKeyUpdateRule($this->context);
    }
1223498
protected function transformTranslation(LocaleAwareInterface $translation, $fields, &$values)
    {
        foreach ($fields as $field) {
            $values[$translation->getLocale()][$field] = $this->propertyAccessor->getValue($translation, $field);
        }
    }
1005684
protected function setForeignKeys(array $values)
    {
        foreach ($values as $key => &$value) {
            if ($this->endsWith($key, '_id')) {
                $value = $this->generateKey($value);
            }
        }

        return $values;
    }
1134170
function setValues($values)
    {
        if (empty($values)) {
            // give it default checkbox behavior
            $this->_values = array('', 1);
        } elseif (is_scalar($values)) {
            // if it's string, then assume the value to
            // be passed is for when the element is checked
            $this->_values = array('', $values);
        } else {
            $this->_values = $values;
        }
        $this->updateAttributes(array('value' => $this->_values[1]));
        $this->setChecked($this->_currentValue == $this->_values[1]);
    }
1310770
public function update(array $values): int {
    $this->coerceDataTypesToDatabase($values);
    return $this->builder->update($values);
  }
904968
protected function addUpdatedAtColumn(array $values)
    {
        if (! $this->model->usesTimestamps()) return $values;

        $column = $this->model->getUpdatedAtColumn();

        return array_add($values, $column, $this->model->freshTimestampString());
    }