When setting to the name of the field itself, the value
    in the current language will be set.
779092
def default_value_setter(field):
    

    def default_value_func_setter(self, value):
        localized_field = utils.build_localized_field_name(
            field, self._linguist.active_language
        )

        setattr(self, localized_field, value)

    return default_value_func_setter
48945
@Override
	public void setName(String name, java.util.Locale locale) {
		_commerceCountry.setName(name, locale);
	}
843432
protected function setTitleEditFieldValue()
    {
        if (isset($this->data_field_value['field_value_id'])) {
            $title = $this->text('Edit %name', array('%name' => $this->data_field_value['title']));
        } else {
            $title = $this->text('Add value for field %name', array('%name' => $this->data_field['title']));
        }

        $this->setTitle($title);
    }
106001
def get_value(self, context, obj, field_name):
        
        try:
            language = get_language()
            value = self.get_translated_value(obj, field_name, language)
            if value:
                return value
            if self.FALLBACK:
                for lang, lang_name in settings.LANGUAGES:
                    if lang == language:
                        # already tried this one...
                        continue
                    value = self.get_translated_value(obj, field_name, lang)
                    if value:
                        return value
            untranslated = getattr(obj, field_name)
            if self._is_truthy(untranslated):
                return untranslated
            else:
                return self.EMPTY_VALUE
        except Exception:
            if settings.TEMPLATE_DEBUG:
                raise
            return self.EMPTY_VALUE
527718
def get_localized_field_name(context, field):
    """"""
    attrs = [
             translation.get_language(), 
             translation.get_language()[:2], 
             settings.LANGUAGE_CODE
            ]
            
    def predicate(x):
        field_name = get_real_fieldname(field, x)
        if hasattr(context, field_name):
            return field_name
        return None

    return first_match(predicate, attrs)
1307431
protected function setData()
    {
        $this->initElementObject();
        if (empty($this->obElement)) {
            return;
        }

        //Set default lang (if update cache with non default lang)
        if (self::$bLangInit && !empty(self::$sDefaultLang) && $this->obElement->isClassExtendedWith('RainLab.Translate.Behaviors.TranslatableModel')) {
            $this->obElement->lang(self::$sDefaultLang);
        }

        //Get cached field list from model and add fields to cache array
        $this->setCachedFieldList();

        //Get element data
        $arResult = $this->getElementData();
        if (empty($arResult) || !is_array($arResult)) {
            $arResult = [];
        }

        //Add fields values to cached array
        foreach ($arResult as $sField => $sValue) {
            $this->setAttribute($sField, $sValue);
        }

        //Save lang properties (integration with Translate plugin)
        $this->setLangProperties();

        //Run methods from $arExtendResult array
        $this->setExtendData();
    }
823690
public static String setterName(String fieldName) {
      StringBuilder sb = new StringBuilder("set");
      if (fieldName != null && fieldName.length() > 0) {
         sb.append(fieldName.substring(0, 1).toUpperCase(Locale.ENGLISH));
         if (fieldName.length() > 1) {
            sb.append(fieldName.substring(1));
         }
      }
      return sb.toString();
   }
187926
protected function setCurrentTranslation()
    {
        if (!($this->currentTranslation instanceof EmailTranslation) || $this->currentTranslation->getLang() != $this->locale) {
            $i = 0;
            $end = count($this->translations);
            $found = false;

            while ($i<$end && !$found) {
                $found = ($this->translations[$i]->getLang() == $this->locale);
                $i++;
            }

            if ($found) {
                $this->currentTranslation = $this->translations[$i-1];
            } else {
                throw new NoTranslationException($this->locale, sprintf('No translation found for email "%s" and locale "%s".', $this->reference, $this->locale));
            }
        }
    }
1101756
public void set(String propName, Object value) {
        if (propName.equals("value")) {
            setValue(((String) value));
        }
        if (propName.equals("lang")) {
            setLang(((String) value));
        }
    }
1090225
def _localized_name(val, klass):
    """"""
    try:
        (text, lang) = val
        return klass(text=text, lang=lang)
    except ValueError:
        return klass(text=val, lang="en")
453398
private function setMonthNames() {
		
		if (empty($this->options['locale']['monthNames'])) {
			$this->options['locale']['monthNames'] = array_values(
				Yii::app()->locale->getMonthNames('wide', true)
			);
		}
	}
601643
protected function setQuantityField()
    {
        $iQuantity = array_get($this->arImportData, 'quantity');
        if ($iQuantity === null) {
            return;
        }

        $iQuantity = (int) $iQuantity;
        if ($iQuantity < 0) {
            $iQuantity = 0;
        }

        $this->arImportData['quantity'] = $iQuantity;
    }
622637
def set_field_value(self, name, value):
        
        name = self.get_real_name(name)

        if not name or not self._can_write_field(name):
            return

        if name in self.__deleted_fields__:
            self.__deleted_fields__.remove(name)
        if self.__original_data__.get(name) == value:
            try:
                self.__modified_data__.pop(name)
            except KeyError:
                pass
        else:
            self.__modified_data__[name] = value
            self._prepare_child(value)
            if name not in self.__structure__ or not self.__structure__[name].read_only:
                return

            try:
                value.set_read_only(True)
            except AttributeError:
                pass
57816
private function set_field_names()
    {
        foreach ( $this->config->fields as $field )
        {
            $field->init_name = $field->name;
        }
    }
1074337
def set(self, name, value, **kw):
        

        # fetch the field by name
        field = api.get_field(self.context, name)

        # bail out if we have no field
        if not field:
            return False

        # call the field adapter and set the value
        fieldmanager = IFieldManager(field)
        return fieldmanager.set(self.context, value, **kw)
1081159
function setlocale(locale) {
      locale = typeof(locale) === "undefined" ? "en_US" : locale;

      if((cldr && (cldr.localeIds.indexOf(locale.replace(/-/g, '_').toLowerCase()) === -1)) || (!cldr && ((locale.replace(/-/g, '_').toLowerCase() !== "en_us")))) {
         throw new IllegalLocaleError();
      }

      this.day_name   = _extractLocaleDays(false, locale);
      this.day_abbr   = _extractLocaleDays(true, locale);
      this.month_name = _extractLocaleMonths(false, locale);
      this.month_abbr = _extractLocaleMonths(true, locale);
    }
505746
def set_custom_value(self, field_name, value):
        
        custom_field = self.get_custom_field(field_name)
        custom_value = CustomFieldValue.objects.get_or_create(
            field=custom_field, object_id=self.id)[0]
        custom_value.value = value
        custom_value.save()