@param string $name
@param string $locale
@param Attribute $attribute

@return AttributeTranslation
328980
protected function createAttributeTranslation($name, $locale, Attribute $attribute)
    {
        $translation = new AttributeTranslation();
        $translation->setName($name);
        $translation->setLocale($locale);
        $translation->setAttribute($attribute);

        $attribute->addTranslation($translation);

        return $translation;
    }
646682
protected function formatAttributes(array $attributes, $lineno, $name)
    {
        try {
            $processor = new Processor();

            return $processor->process($this->getAttributeNodeConfig(), [$attributes]);
        } catch (\Exception $e) {
            throw new SyntaxError($this->getFormattedMessageException($e), $lineno, new Source('', $name));
        }
    }
1212200
private static function _getFile($locale, $path, $attribute = false, $value = false, $temp = array())
    {
        $result = self::_findRoute($locale, $path, $attribute, $value, $temp);
        if ($result) {
            $temp = self::_readFile($locale, $path, $attribute, $value, $temp);
        }

        // parse required locales reversive
        // example: when given zh_Hans_CN
        // 1. -> zh_Hans_CN
        // 2. -> zh_Hans
        // 3. -> zh
        // 4. -> root
        if (($locale != 'root') && ($result)) {
            $locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
            if (!empty($locale)) {
                $temp = self::_getFile($locale, $path, $attribute, $value, $temp);
            } else {
                $temp = self::_getFile('root', $path, $attribute, $value, $temp);
            }
        }
        return $temp;
    }
1273571
function attribute( $name )
    {
        switch ( $name )
        {
            case "name" :
            {
                return $this->Name;
            } break;
            case "id" :
            {
                return $this->ID;
            } break;
            case "group_id":
            {
                return $this->GroupID;
            } break;
            case "rules":
            {
                return $this->Rules;
            } break;
            case "multioption_list" :
            {
                return $this->Options;
            } break;
            case "optiongroup_list":
            {
                return $this->ChildGroupList;
            } break;
            default:
            {
                eZDebug::writeError( "Attribute '$name' does not exist", __METHOD__ );
                $retValue = null;
                return $retValue;
            }break;
        }
    }
890151
private function blockBegin($name, $attributes)
    {
        $this->transformedTextStack->push('');
        $this->blockTypeStack->push($name);
        $this->blockAttributesStack->push($attributes);
    }
909218
function attribute( $name )
    {
        if ( isset( $this->AttributeVariableMap[$name] ) )
        {
            $memberVariable = $this->AttributeVariableMap[$name];
            return $this->$memberVariable;
        }
        else
        {
            eZDebug::writeError( "Attribute '$name' does not exist", __METHOD__ );
            return null;
        }
    }
946542
def field(name, *params)
      @model.translated_attribute_names.push name.to_sym
      @model.translated_attr_accessor(name)
      @model.translation_class.field name, *params
    end
798636
private static function _findRoute($locale, $path, $attribute, $value, &$temp)
    {
        // load locale file if not already in cache
        // needed for alias tag when referring to other locale
        if (empty(self::$_ldml[(string) $locale])) {
            $filename = dirname(__FILE__) . '/Data/' . $locale . '.xml';
            if (!file_exists($filename)) {

                throw new Zend_Locale_Exception("Missing locale file '$filename' for '$locale' locale.");
            }

            self::$_ldml[(string) $locale] = simplexml_load_file($filename);
        }

        // search for 'alias' tag in the search path for redirection
        $search = '';
        $tok = strtok($path, '/');

        // parse the complete path
        if (!empty(self::$_ldml[(string) $locale])) {
            while ($tok !== false) {
                $search .=  '/' . $tok;
                if (strpos($search, '[@') !== false) {
                    while (strrpos($search, '[@') > strrpos($search, ']')) {
                        $tok = strtok('/');
                        if (empty($tok)) {
                            $search .= '/';
                        }
                        $search = $search . '/' . $tok;
                    }
                }
                $result = self::$_ldml[(string) $locale]->xpath($search . '/alias');

                // alias found
                if (!empty($result)) {

                    $source = $result[0]['source'];
                    $newpath = $result[0]['path'];

                    // new path - path //ldml is to ignore
                    if ($newpath != '//ldml') {
                        // other path - parse to make real path

                        while (substr($newpath,0,3) == '../') {
                            $newpath = substr($newpath, 3);
                            $search = substr($search, 0, strrpos($search, '/'));
                        }

                        // truncate ../ to realpath otherwise problems with alias
                        $path = $search . '/' . $newpath;
                        while (($tok = strtok('/'))!== false) {
                            $path = $path . '/' . $tok;
                        }
                    }

                    // reroute to other locale
                    if ($source != 'locale') {
                        $locale = $source;
                    }

                    $temp = self::_getFile($locale, $path, $attribute, $value, $temp);
                    return false;
                }

                $tok = strtok('/');
            }
        }
        return true;
    }
86822
public function findByTranslation($attribute, $value, $locale = null, $exact = true)
    {
        $this->pushCriteriaOnce( new WhereHasTranslation($attribute, $value, $locale, $exact) );

        return $this->first();
    }
86907
public function setTranslation(string $key, string $value = null, string $locale = null)
    {
        $this->throwExceptionIfAttributeIsNotTranslatable($key);

        $locale = $locale ?: config('app.locale');

        $translations = $this->getTranslations($key);

        if ($this->hasSetMutator($key)) {
            $value = $this->{'set'.Str::studly($key).'Attribute'}($value);
        }

        $translations[$locale] = $value;

        $this->attributes[$key] = json_encode($translations);

        return $this;
    }
1070938
public static function getFormItemByAttributeName($attributeName, $attributeValue, $localizedName = "")
    {

        $attributeType = substr($attributeName, 2, 1);

        if ($attributeType == "s") {
            $formItem = static::getFormItemByAttributeType("shorttext", $attributeName, $attributeValue, $localizedName);
        } else if ($attributeType == "l") {
            $formItem = static::getFormItemByAttributeType("longtext", $attributeName, $attributeValue, $localizedName);
        } else if ($attributeType == "h") {
            $formItem = static::getFormItemByAttributeType("htmllongtext", $attributeName, $attributeValue, $localizedName);
        } else if ($attributeType == "t") {
            $formItem = static::getFormItemByAttributeType("time", $attributeName, $attributeValue, $localizedName);
        } else if ($attributeType == "d") {
            $formItem = static::getFormItemByAttributeType("date", $attributeName, $attributeValue, $localizedName);
        } else if ($attributeType == "w") {
            $formItem = static::getFormItemByAttributeType("weekday", $attributeName, $attributeValue, $localizedName);
        } else {
            $formItem = static::getFormItemByAttributeType("shorttext", $attributeName, $attributeValue, $localizedName);
        }

        return $formItem;

    }
1282328
protected function newTranslation($locale = null, array $attributes) {
        $locale = isset($locale) ? $locale : Locale\get_active_locale();

        $language = $this->getByLocale($locale);

        $class = $this->classTranslation();

        $update = [
            'language_id' => $language->id,
             isset($this->translation_id) ? $this->translation_id : str_singular($this->getModel()->getTable()) . '_id' => $this->id,
        ];

        $attributes = array_merge($update, $attributes);

       return $class::updateOrCreate($update, $attributes);
    }
1249044
private function fireEvent($locale, $route, $attributes)
    {
        $response = event(self::EVENT_NAME, [$locale, $route, $attributes]);

        if ( ! empty($response))
            $response = array_shift($response);

        if (is_array($response))
            $attributes = array_merge($attributes, $response);

        return $attributes;
    }
444263
public function findAllByTranslation($attribute, $value, $locale = null, $exact = true)
    {
        $this->pushCriteriaOnce( new WhereHasTranslation($attribute, $value, $locale, $exact) );

        return $this->all();
    }
677448
public function hookgetTranslations(\Asgard\Hook\Chain $chain, \Asgard\Entity\Entity $entity, $name, $locale) {
		return $this->getDataMapper()->getTranslations($entity, $locale);
	}
16405
public static String translateAttribute(String attributes) throws IOException {
	short[] flags = strAttrToBooleanFlags(attributes);

	StringBuilder sb = new StringBuilder();
	if (flags[READ_ONLY] == YES) sb.append(" +R");
	else if (flags[READ_ONLY] == NO) sb.append(" -R");

	if (flags[HIDDEN] == YES) sb.append(" +H");
	else if (flags[HIDDEN] == NO) sb.append(" -H");

	if (flags[SYSTEM] == YES) sb.append(" +S");
	else if (flags[SYSTEM] == NO) sb.append(" -S");

	if (flags[ARCHIVE] == YES) sb.append(" +A");
	else if (flags[ARCHIVE] == NO) sb.append(" -A");

	return sb.toString();
    }
584745
private function setTranslation($locale, $attribute, $value)
    {
        $this->validateLocale($locale);

        $this->translateOrNew($locale)->$attribute = $value;
    }