public function isTranslatable($value, $key)
    {

        // in case cast is not used, we need to manually convert the value to object
        if(!is_object($value) && !is_array($value)) {
            $value = json_decode($value);
        }

        // if current language is present as key
        if (isset($value->{$this->getTranslateLanguage()})) {
            return true;
        }

        // verify if this is another language
        // TODO find a better way of verification
        $valueToArray = key((array) $value);
        if(strlen($valueToArray) == 2) {
            return true;
        }

        return false;
    }
public function isTranslatable($value, $key)
    {

        // in case cast is not used, we need to manually convert the value to object
        if(!is_object($value) && !is_array($value)) {
            $value = json_decode($value);
        }

        // if current language is present as key
        if (isset($value->{$this->getTranslateLanguage()})) {
            return true;
        }

        // verify if this is another language
        // TODO find a better way of verification
        $valueToArray = key((array) $value);
        if(strlen($valueToArray) == 2) {
            return true;
        }

        return false;
    }
public function isTranslatable ( $ value , $ key ) { // in case cast is not used, we need to manually convert the value to object if ( ! is_object ( $ value ) && ! is_array ( $ value ) ) { $ value = json_decode ( $ value ) ; } // if current language is present as key if ( isset ( $ value -> { $ this -> getTranslateLanguage ( ) } ) ) { return true ; } // verify if this is another language // TODO find a better way of verification $ valueToArray = key ( ( array ) $ value ) ; if ( strlen ( $ valueToArray ) == 2 ) { return true ; } return false ; }
Check if a value has language keys.

@param  string $value
@return bool
Check if a value has language keys .