library/Garp/Model/Behavior/Translatable.php
protected function _joinCmsSearchQuery(
        Garp_Model_Db $model, Zend_Db_Select &$select, $likeValue
    ) {
        $languages = Garp_I18n::getLocales();
        $default_language = array(Garp_I18n::getDefaultLocale());
        $langColumn = self::LANG_COLUMN;
        // Exclude default language, since that's already joined in the joint view
        $languages = array_diff($languages, $default_language);
        $adapter = $model->getAdapter();
        $where = array();
        foreach ($languages as $language) {
            $i18nModel = $this->getI18nModel($model);
            $i18nAlias = $model->getName() . '_i18n_' . $language;
            $onClause = $i18nModel->refMapToOnClause(
                get_class($model), $i18nAlias,
                $model->getJointView()
            );

            // join i18n model
            $select->joinLeft(
                array($i18nAlias => $i18nModel->getName()),
                "$onClause AND {$i18nAlias}.{$langColumn} = '{$language}'",
                array()
            );

            // add WHERE clauses that search in the i18n model
            $translatedFields = $this->_translatableFields;
            foreach ($translatedFields as $i18nField) {
                $where[] = "{$i18nAlias}.{$i18nField} LIKE " . $adapter->quote($likeValue);
            }

        }
        return implode(' OR ', $where);
    }
protected function _joinCmsSearchQuery(
        Garp_Model_Db $model, Zend_Db_Select &$select, $likeValue
    ) {
        $languages = Garp_I18n::getLocales();
        $default_language = array(Garp_I18n::getDefaultLocale());
        $langColumn = self::LANG_COLUMN;
        // Exclude default language, since that's already joined in the joint view
        $languages = array_diff($languages, $default_language);
        $adapter = $model->getAdapter();
        $where = array();
        foreach ($languages as $language) {
            $i18nModel = $this->getI18nModel($model);
            $i18nAlias = $model->getName() . '_i18n_' . $language;
            $onClause = $i18nModel->refMapToOnClause(
                get_class($model), $i18nAlias,
                $model->getJointView()
            );

            // join i18n model
            $select->joinLeft(
                array($i18nAlias => $i18nModel->getName()),
                "$onClause AND {$i18nAlias}.{$langColumn} = '{$language}'",
                array()
            );

            // add WHERE clauses that search in the i18n model
            $translatedFields = $this->_translatableFields;
            foreach ($translatedFields as $i18nField) {
                $where[] = "{$i18nAlias}.{$i18nField} LIKE " . $adapter->quote($likeValue);
            }

        }
        return implode(' OR ', $where);
    }
protected function _joinCmsSearchQuery ( Garp_Model_Db $ model , Zend_Db_Select & $ select , $ likeValue ) { $ languages = Garp_I18n :: getLocales ( ) ; $ default_language = array ( Garp_I18n :: getDefaultLocale ( ) ) ; $ langColumn = self :: LANG_COLUMN ; // Exclude default language, since that's already joined in the joint view $ languages = array_diff ( $ languages , $ default_language ) ; $ adapter = $ model -> getAdapter ( ) ; $ where = array ( ) ; foreach ( $ languages as $ language ) { $ i18nModel = $ this -> getI18nModel ( $ model ) ; $ i18nAlias = $ model -> getName ( ) . '_i18n_' . $ language ; $ onClause = $ i18nModel -> refMapToOnClause ( get_class ( $ model ) , $ i18nAlias , $ model -> getJointView ( ) ) ; // join i18n model $ select -> joinLeft ( array ( $ i18nAlias => $ i18nModel -> getName ( ) ) , "$onClause AND {$i18nAlias}.{$langColumn} = '{$language}'" , array ( ) ) ; // add WHERE clauses that search in the i18n model $ translatedFields = $ this -> _translatableFields ; foreach ( $ translatedFields as $ i18nField ) { $ where [ ] = "{$i18nAlias}.{$i18nField} LIKE " . $ adapter -> quote ( $ likeValue ) ; } } return implode ( ' OR ' , $ where ) ; }
A real hacky solution to enable admins to search for translated content in the CMS

@param Garp_Model_Db $model
@param Zend_Db_Select $select
@param string $likeValue
@return string A search clause
A real hacky solution to enable admins to search for translated content in the CMS