src/Charcoal/Property/AbstractProperty.php
public function l10nIdent($lang = null)
    {
        if ($this->ident === '') {
            throw new RuntimeException('Missing Property Identifier');
        }

        if (!$this->l10n()) {
            throw new LogicException(sprintf(
                'Property "%s" is not multilingual',
                $this->ident
            ));
        }

        if ($lang === null) {
            $lang = $this->translator()->getLocale();
        } elseif (!is_string($lang)) {
            throw new InvalidArgumentException(sprintf(
                'Language must be a string for Property "%s"',
                $this->ident
            ));
        }

        return sprintf('%1$s_%2$s', $this->ident, $lang);
    }
public function l10nIdent($lang = null)
    {
        if ($this->ident === '') {
            throw new RuntimeException('Missing Property Identifier');
        }

        if (!$this->l10n()) {
            throw new LogicException(sprintf(
                'Property "%s" is not multilingual',
                $this->ident
            ));
        }

        if ($lang === null) {
            $lang = $this->translator()->getLocale();
        } elseif (!is_string($lang)) {
            throw new InvalidArgumentException(sprintf(
                'Language must be a string for Property "%s"',
                $this->ident
            ));
        }

        return sprintf('%1$s_%2$s', $this->ident, $lang);
    }
public function l10nIdent ( $ lang = null ) { if ( $ this -> ident === '' ) { throw new RuntimeException ( 'Missing Property Identifier' ) ; } if ( ! $ this -> l10n ( ) ) { throw new LogicException ( sprintf ( 'Property "%s" is not multilingual' , $ this -> ident ) ) ; } if ( $ lang === null ) { $ lang = $ this -> translator ( ) -> getLocale ( ) ; } elseif ( ! is_string ( $ lang ) ) { throw new InvalidArgumentException ( sprintf ( 'Language must be a string for Property "%s"' , $ this -> ident ) ) ; } return sprintf ( '%1$s_%2$s' , $ this -> ident , $ lang ) ; }
Retrieve the property's localized identifier.

@param  string|null $lang The language code to return the identifier with.
@throws LogicException If the property is not multilingual.
@throws RuntimeException If the property has no identifier.
@throws InvalidArgumentException If the language code is invalid.
@return string
Retrieve the property s localized identifier .