Gets a label by a given language

@param string $lang

@return CrestApps\CodeGenerator\Models\Label
974018
public function getPlaceholder($lang = null)
    {
        $lang = empty($lang) ? $this->getDefaultLanguage() : $lang;

        if (!isset($this->placeholders[$lang])) {
            return $this->getFirstPlaceholder();
        }

        return $this->placeholders[$lang];
    }
978277
public static function lang($lang = null)
    {
        if ($lang)
        {
            self::$lang = strtolower(str_replace(self::$_langNormalizeSearch, self::$_langNormalizeReplace, $lang));
        }
        return self::$lang;
    }
217955
public function getAll($lang = "")
    {
        $orderBy = (isset($_GET['order'])) ? $orderBy = $_GET['order'] : 'customFieldGroupID';
        $orderType = (isset($_GET['type'])) ? $orderType = $_GET['type'] : 'DESC';
        return CustomFieldGroup::orderBy($orderBy, $orderType)->paginate(CustomFieldGroup::$rowsPerPage);
    }
165737
public function langset($lang = null)
    {
        if (!is_null($lang)) {
            $this->langset = $lang;
            return $this;
        } else {
            return $this->langset ?: '';
        }
    }
1035280
public function getLocalLabel($attribute, $language = null)
    {
        if ($language === null) {
            $language = \Yii::$app->language;
        }
        /** @var ActiveRecord $owner */
        $owner = $this->owner;
        if ($owner->isNewRecord) {
            return $owner->getAttribute($attribute);
        }
        $localLabels = $this->getLocalLabels();

        return !isset($localLabels[$language][$owner->getPrimaryKey()][$attribute])
            ? $owner->getAttribute($attribute)
            : $localLabels[$language][$owner->getPrimaryKey()][$attribute];
    }
45513
public function getLabel($locale = null)
    {
        $locale = null === $locale ? Yii::$app->language : $locale;

        return $this->provider->getLanguageLabel($locale);
    }
1011523
public function getLabel()
    {
        $translationHelper = new TranslationHelper();
        return isset($this->configuration['label']) ? $translationHelper->translate($this->configuration['label']) : '';
    }
898570
public function getLanguageURLPrefix($lang = null)
    {
        // if active lang is not passed in, use current active
        if (!$lang) {
            $lang = $this->getLanguage();
        }

        return $this->isIncludeDefaultLanguage($lang) ? '/' . $lang : '';
    }
10141
public function setLang(\Core\Entity\Language $lang = null)
    {
        $this->lang = $lang;

        return $this;
    }
1104816
public function translation($lang)
    {
        $result = Translation::where('entity_id', $this->id)
            ->where('entity_type', get_class($this))
            ->where('language', $lang)
            ->first();

        if ($result) {
            return $result;
        }

        $this->data = $this;

        return $this;
    }
555777
public function getEmailAddress($lang = 'en')
    {
        $action = "get_email_address";
        $options = array(
            'lang' => $lang,
            'sid_token' => $this->sid_token,
        );

        return $this->client->get($action, $options);
    }
270705
public function getRegularLangName($lang = NULL) {
        if (isset($this->_data['env']['APP_LANG_NAME'])) {
            return $this->_data['env']['APP_LANG_NAME'];
        }

        if (is_null($lang))
            $lang = Yii::$app->language;
        $this->_data['env']['ENABLED_LANGS'] = str_replace("-", "_", strtolower($lang));

        return $this->_data['env']['ENABLED_LANGS'];
    }
7592
public function getLabel($key, $language)
    {
        if (!is_array($this->labels) || !array_key_exists($key, $this->labels)) {
            return 'n/a';
        }

        if (!is_array($this->labels[$key]) || !array_key_exists($language, $this->labels[$key])) {
            return 'n/a';
        }

        return $this->labels[$key][$language];
    }
168409
public function out($lang = null) {
        if ($lang !== null && $lang != $this->lang && ($this->lang == null && $lang != current_language())) {
            if ($this->forcedstring) {
                debugging('lang_string objects that have been used cannot be printed in another language. ('.$this->lang.' used)', DEBUG_DEVELOPER);
                return $this->get_string();
            }
            $translatedstring = new lang_string($this->identifier, $this->component, $this->a, $lang);
            return $translatedstring->out();
        }
        return $this->get_string();
    }
1107840
public function getNodeTranslationsQueryBuilder($lang = null)
    {
        $queryBuilder = $this->createQueryBuilder('nt')
            ->select('nt,n,v')
            ->innerJoin('nt.node', 'n')
            ->leftJoin(
                'nt.publicNodeVersion',
                'v',
                'WITH',
                'nt.publicNodeVersion = v.id'
            )
            ->where('n.deleted = false')
            ->orderBy('nt.weight')
            ->addOrderBy('nt.weight');

        if (!empty($lang)) {
            $queryBuilder
                ->andWhere('nt.lang = :lang')
                ->setParameter('lang', $lang);
        }

        return $queryBuilder;
    }
1328398
public static function getInstance($lang, $debug = false)
	{
		if (!isset(self::$languages[$lang . $debug]))
		{
			$language = new self($lang, $debug);

			self::$languages[$lang . $debug] = $language;

			// Check if Language was instantiated with a null $lang param;
			// if so, retrieve the language code from the object and store
			// the instance with the language code as well
			if (is_null($lang))
			{
				self::$languages[$language->getLanguage() . $debug] = $language;
			}
		}

		return self::$languages[$lang . $debug];
	}
1054946
public function getTranslationByLang($language) {
        if ($language instanceof Language) {
            $index = $language->getSymbol();
        } else {
            $index = $language;
        }
        if (empty($this->transArray[$index])) {
            $this->transArray[$index] = $this->getTranslations()->filter(function ($trans) use ($index) {
                                    return $trans->getTransLang()->getSymbol() == $index;
                            })
                    ->first();
        }

        return $this->transArray[$index];
    }