Return seoDescription of translation if exists
otherwise return generated one

@param mixed $alternativeField alternative field to display when seoDescription field is empty

@return string
17037
public function seoDescription($alternativeField = false)
    {
        $descLength = option('seo', 'desc_length', config('gzero.seo.desc_length', 160));
        if (!$alternativeField) {
            $alternativeField = config('gzero-cms.seo.alternative_desc', 'body');
        }
        // if SEO description is set
        if ($this->translation['seo_description']) {
            return $this->removeNewLinesAndWhitespace($this->translation['seo_description']);
        }

        $text = $this->removeNewLinesAndWhitespace($this->translation[$alternativeField]);
        // if alternative field is not empty
        if ($text) {
            return strlen($text) >= $descLength ? substr($text, 0, strpos($text, ' ', $descLength)) : $text;
        };
        // show site description as default
        return option('general', 'site_desc');
    }
1212150
public function getFieldsTranslations()
    {
        $fieldList = parent::getFieldsTranslations();

        // Add the key values (so organization id is present)
        $keys = array_combine(array_values($this->_targetModel->getKeys()), array_values($this->_targetModel->getKeys()));
        $fieldList = $fieldList + $keys;

        $fieldList['grs_email'] = 'gr2o_email';

        return $fieldList;
    }
1087683
protected function FindSnippet(IFormField $field)
    {
        if ($field instanceof Input && 
                ($field->GetType() == Input::TypeText || 
                $field->GetType() == Input::TypePassword ||
                $field->GetType() == Input::TypeColor))
        {
            return new FormFields\TextInputField($field);
        }
        
        if ($field instanceof Input && 
                $field->GetType() == Input::TypeHidden)
        {
            return new FormFields\HiddenInputField($field);
        }
        
        if ($field instanceof Input && 
                $field->GetType() == Input::TypeFile)
        {
            return new FormFields\FileInputField($field);
        }
        if ($field instanceof Custom)
        {
            return new FormFields\CustomField($field);
        }
        if ($field instanceof Select)
        {
            return new FormFields\SelectField($field);
        }
        
        if ($field instanceof Textarea)
        {
            return new FormFields\TextareaField($field);
        }
        
        if ($field instanceof Checkbox)
        {
            return new FormFields\CheckboxField($field);
        }
        
        if ($field instanceof CheckList)
        {
            return new FormFields\CheckListField($field);
        }
        
        if ($field instanceof Submit)
        {
            return new FormFields\SubmitField($field);
        }
        
        if ($field instanceof Radio) {
            return new FormFields\RadioField($field);
        }
    }
207129
protected function getDefaultFieldValue(FieldDescriptorProto $field)
    {
        $type  = $field->getType();
        $value = $field->getDefaultValue();

        if ($value === null) {
            return 'null';
        }

        if ($type === Type::TYPE_ENUM()) {
            $typeName  = $field->getTypeName();
            $refEntity = $this->getEntity($typeName);
            $reference = $refEntity->getNamespacedName();
            $const     = $reference . '::' . $value . '()';

            return $const;
        }

        if ($type === Type::TYPE_BOOL()) {
            $value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
        }

        return var_export($value, true);
    }
21810
def get_field(cls, model, opts, label, field):
    

    trans_model = model._meta.translation_model
    try:
        (f, lang_id) = trans_model._meta.translated_fields[field]
        return f
    except KeyError:
        # fall back to the old way -- see if model contains the field
        # directly
        pass

    try:
        return opts.get_field(field)
    except models.FieldDoesNotExist:
        raise ImproperlyConfigured("'%s.%s' refers to field '%s' that is " \
            "missing from model '%s'." \
            % (cls.__name__, label, field, model.__name__))
686618
public function getstr($key, $params=[], $alternative=null, $lang=null){

        if (!$lang) {
            $lang = $this->locale;
        }

        if (!$alternative){
            $alternative = $key;
        }

        return \vsprintf(isset($this->_languages[$lang][$key]) ? $this->_languages[$lang][$key]:$alternative, $params);
    }
407846
private function retrieveFilterFieldDescription(
        AdminInterface $admin,
        string $field
    ): FieldDescriptionInterface {
        $admin->getFilterFieldDescriptions();

        $fieldDescription = $admin->getFilterFieldDescription($field);

        if (!$fieldDescription) {
            throw new \RuntimeException(sprintf('The field "%s" does not exist.', $field));
        }

        if (null === $fieldDescription->getTargetEntity()) {
            throw new \RuntimeException(sprintf('No associated entity with field "%s".', $field));
        }

        return $fieldDescription;
    }
736929
public function getIndexData(Field $field, FieldDefinition $fieldDefinition)
    {
        $indexes = array();
        $values = array();
        $fieldSettings = $fieldDefinition->fieldTypeConstraints->fieldSettings;
        $positionSet = array_flip($field->value->data);

        $options = $fieldSettings['multilingualOptions'][$field->languageCode] ?? $fieldSettings['options'];

        foreach ($options as $index => $value) {
            if (isset($positionSet[$index])) {
                $values[] = $value;
                $indexes[] = $index;
            }
        }

        return array(
            new Search\Field(
                'selected_option_value',
                $values,
                new Search\FieldType\MultipleStringField()
            ),
            new Search\Field(
                'selected_option_index',
                $indexes,
                new Search\FieldType\MultipleIntegerField()
            ),
            new Search\Field(
                'selected_option_count',
                count($indexes),
                new Search\FieldType\IntegerField()
            ),
            new Search\Field(
                'sort_value',
                implode('-', $indexes),
                new Search\FieldType\StringField()
            ),
            new Search\Field(
                'fulltext',
                $values,
                new Search\FieldType\FullTextField()
            ),
        );
    }
447272
private function getFieldType(Field $field)
    {
        if ($field->isStored() && $field->isIndexed()) {
            return 'text';
        }

        if (false === $field->isStored() && $field->isIndexed()) {
            return 'unStored';
        }

        if ($field->isStored() && false === $field->isIndexed()) {
            return 'unIndexed';
        }

        throw new \InvalidArgumentException(
            sprintf(
                'Field "%s" cannot be both not indexed and not stored',
                $field->getName()
            )
        );
    }
553036
public static function getTranslated(
        $key,
        $parameters = null,
        $fallbackValue = null
    ) {
        return ($fallbackValue !== null ? $fallbackValue : $key);
        /**return self::$translation->getTranslated(
            $key,
            $parameters,
            $fallbackValue
        );*/
    }
381816
protected function getAlternateTranslations()
    {
        if ($this->alternateTranslations === null) {
            $this->alternateTranslations = $this->buildAlternateTranslations();
        }

        return $this->alternateTranslations;
    }
470300
public function getField($field, $lng = false)
    {
        $res = NULL;

        if($lng === false && defined ('LNG'))
            $lng = LNG;

        if (isset($this->data[$field]) || isset($this->translation_data[$field])) {
            if (in_array($field, $this->translation_fields, true)) {
                if (isset($this->translation_data[$field])) {
                    if (is_array($this->translation_data[$field]) && array_key_exists($lng, $this->translation_data[$field])) {
                        return $this->translation_data[$field][$lng];
                    }

                    return $this->translation_data[$field];

                }

                if (isset($this->data[$field])) {
                    return Translations::get($this->data[$field], $lng);
                }
            }

            if (isset($this->data[$field])) {
                $res = $this->data[$field];
            }

            foreach ($this->field_callbacks as $callback) {
                $res = $callback($field, $res);
            }

            if ($this->encode_special_chars_for_html && is_scalar($res)) {
                $res = htmlspecialchars($res);
            }

            return $res;
        }

        return $res;
    }
1355098
private function getContentMultiLang(string $field, $locale = null)
    {
        $jsonContent = (array) $this->getAttribute($this->jsonColumnName);
        $fullName = ($locale ?? app()->getLocale()).'.'.$field;

        if (array_has($jsonContent, $fullName)) {
            return array_get($jsonContent, $fullName);
        }

        return array_get($jsonContent, config('app.fallback_locale').'.'.$field);
    }
1112619
private function getSelectAs(DoctrineFieldDescriptorInterface $field, $hidden = false)
    {
        $select = $field->getSelect() . ' AS ';

        if ($hidden) {
            $select .= 'HIDDEN ';
        }

        return $select . $field->getName();
    }
1263096
function translationList( $language = false, $asObject = true )
    {
        $db = eZDB::instance();

        $languageSQL = '';
        if ( $language !== false )
        {
            $language = $db->escapeString( $language );
            $languageSQL = "AND language_code!='$language'";
        }

        $query = "SELECT DISTINCT language_code
                  FROM ezcontentobject_attribute
                  WHERE contentobject_id='$this->ContentObjectID' AND version='$this->Version'
                  $languageSQL
                  ORDER BY language_code";

        $languageCodes = $db->arrayQuery( $query );

        $translations = array();
        if ( $asObject )
        {
            foreach ( $languageCodes as $languageCode )
            {
                $translations[] = new eZContentObjectTranslation( $this->ContentObjectID, $this->Version, $languageCode["language_code"] );
            }
        }
        else
        {
            foreach ( $languageCodes as $languageCode )
            {
                $translations[] = $languageCode["language_code"];
            }
        }

        return $translations;
    }
1339932
public function getField(string $field) : string
        {
                $value = $this->_redis->hget($this->_key, $field);
                return empty($value) ? '' : strval($value);
        }
94519
public static function adminFormFieldLabel($field) {

        // Does the field have an alternate name?
        $name = $field['name'];

        if (!empty($field['alternate_form_name'])) {
            $name = $field['alternate_form_name'];
        } 

        if ($name == "id") return "ID";

        $html = str_replace("_", " ", $name);
        $html = ucwords($html);
        return $html;
    }