protected function buildInitialTranslations(LocaleEntity $locale, \Concrete\Core\Database\Driver\PDOStatement $rs)
    {
        $approvedSupport = $this->app->make(Access::class)->getLocaleAccess($locale) >= Access::ADMIN;
        $result = [];
        $numPlurals = $locale->getPluralCount();
        while (($row = $rs->fetch()) !== false) {
            $item = [
                'id' => (int) $row['id'],
                'original' => $row['text'],
            ];
            if ($approvedSupport && $row['approved']) {
                $item['isApproved'] = true;
            }
            if ($row['context'] !== '') {
                $item['context'] = $row['context'];
            }
            $isPlural = $row['plural'] !== '';
            if ($isPlural) {
                $item['originalPlural'] = $row['plural'];
            }
            if ($row['text0'] !== null) {
                $translations = [];
                switch ($isPlural ? $numPlurals : 1) {
                    case 6:
                        $translations[] = $row['text5'];
                        /* @noinspection PhpMissingBreakStatementInspection */
                    case 5:
                        $translations[] = $row['text4'];
                        /* @noinspection PhpMissingBreakStatementInspection */
                    case 4:
                        $translations[] = $row['text3'];
                        /* @noinspection PhpMissingBreakStatementInspection */
                    case 3:
                        $translations[] = $row['text2'];
                        /* @noinspection PhpMissingBreakStatementInspection */
                    case 2:
                        $translations[] = $row['text1'];
                        /* @noinspection PhpMissingBreakStatementInspection */
                    case 1:
                        $translations[] = $row['text0'];
                        break;
                }
                $item['translations'] = array_reverse($translations);
            }
            $result[] = $item;
        }
        $rs->closeCursor();

        return $result;
    }
protected function buildInitialTranslations(LocaleEntity $locale, \Concrete\Core\Database\Driver\PDOStatement $rs)
    {
        $approvedSupport = $this->app->make(Access::class)->getLocaleAccess($locale) >= Access::ADMIN;
        $result = [];
        $numPlurals = $locale->getPluralCount();
        while (($row = $rs->fetch()) !== false) {
            $item = [
                'id' => (int) $row['id'],
                'original' => $row['text'],
            ];
            if ($approvedSupport && $row['approved']) {
                $item['isApproved'] = true;
            }
            if ($row['context'] !== '') {
                $item['context'] = $row['context'];
            }
            $isPlural = $row['plural'] !== '';
            if ($isPlural) {
                $item['originalPlural'] = $row['plural'];
            }
            if ($row['text0'] !== null) {
                $translations = [];
                switch ($isPlural ? $numPlurals : 1) {
                    case 6:
                        $translations[] = $row['text5'];
                        /* @noinspection PhpMissingBreakStatementInspection */
                    case 5:
                        $translations[] = $row['text4'];
                        /* @noinspection PhpMissingBreakStatementInspection */
                    case 4:
                        $translations[] = $row['text3'];
                        /* @noinspection PhpMissingBreakStatementInspection */
                    case 3:
                        $translations[] = $row['text2'];
                        /* @noinspection PhpMissingBreakStatementInspection */
                    case 2:
                        $translations[] = $row['text1'];
                        /* @noinspection PhpMissingBreakStatementInspection */
                    case 1:
                        $translations[] = $row['text0'];
                        break;
                }
                $item['translations'] = array_reverse($translations);
            }
            $result[] = $item;
        }
        $rs->closeCursor();

        return $result;
    }
protected function buildInitialTranslations ( LocaleEntity $ locale , \ Concrete \ Core \ Database \ Driver \ PDOStatement $ rs ) { $ approvedSupport = $ this -> app -> make ( Access :: class ) -> getLocaleAccess ( $ locale ) >= Access :: ADMIN ; $ result = [ ] ; $ numPlurals = $ locale -> getPluralCount ( ) ; while ( ( $ row = $ rs -> fetch ( ) ) !== false ) { $ item = [ 'id' => ( int ) $ row [ 'id' ] , 'original' => $ row [ 'text' ] , ] ; if ( $ approvedSupport && $ row [ 'approved' ] ) { $ item [ 'isApproved' ] = true ; } if ( $ row [ 'context' ] !== '' ) { $ item [ 'context' ] = $ row [ 'context' ] ; } $ isPlural = $ row [ 'plural' ] !== '' ; if ( $ isPlural ) { $ item [ 'originalPlural' ] = $ row [ 'plural' ] ; } if ( $ row [ 'text0' ] !== null ) { $ translations = [ ] ; switch ( $ isPlural ? $ numPlurals : 1 ) { case 6 : $ translations [ ] = $ row [ 'text5' ] ; /* @noinspection PhpMissingBreakStatementInspection */ case 5 : $ translations [ ] = $ row [ 'text4' ] ; /* @noinspection PhpMissingBreakStatementInspection */ case 4 : $ translations [ ] = $ row [ 'text3' ] ; /* @noinspection PhpMissingBreakStatementInspection */ case 3 : $ translations [ ] = $ row [ 'text2' ] ; /* @noinspection PhpMissingBreakStatementInspection */ case 2 : $ translations [ ] = $ row [ 'text1' ] ; /* @noinspection PhpMissingBreakStatementInspection */ case 1 : $ translations [ ] = $ row [ 'text0' ] ; break ; } $ item [ 'translations' ] = array_reverse ( $ translations ) ; } $ result [ ] = $ item ; } $ rs -> closeCursor ( ) ; return $ result ; }
Builds the initial translations array.

@param \Concrete\Core\Database\Driver\PDOStatement $rs

@return array
Builds the initial translations array .