protected function projectsStatus()
    {
        $status_report = [];
        $status = locale_translation_get_status();
        foreach ($status as $project_id => $project) {
            foreach ($project as $langcode => $project_info) {
                $info = '';
                if ($project_info->type == LOCALE_TRANSLATION_LOCAL || $project_info->type == LOCALE_TRANSLATION_REMOTE) {
                    $local = isset($project_info->files[LOCALE_TRANSLATION_LOCAL]) ? $project_info->files[LOCALE_TRANSLATION_LOCAL] : null;
                    $remote = isset($project_info->files[LOCALE_TRANSLATION_REMOTE]) ? $project_info->files[LOCALE_TRANSLATION_REMOTE] : null;
                    $local_age = $local->timestamp? format_date($local->timestamp, 'html_date'): '';
                    $remote_age = $remote->timestamp? format_date($remote->timestamp, 'html_date'): '';

                    if ($local_age >= $remote_age) {
                        $info = $this->trans('commands.locale.translation.status.messages.translation-project-updated');
                    } else {
                        $info = $this->trans('commands.locale.translation.status.messages.translation-project-available');
                    }
                } elseif ($project_info->type == LOCALE_TRANSLATION_CURRENT) {
                    $info = $this->trans('commands.locale.translation.status.messages.translation-project-updated');
                } else {
                    $local_age = '';
                    $remote_age = '';
                    $info = $this->createInfoString($project_info);
                }

                $status_report[$langcode][] = [$project_info->name, $project_info->version, $local_age, $remote_age ,$info ];
            }
        }

        return $status_report;
    }
protected function projectsStatus()
    {
        $status_report = [];
        $status = locale_translation_get_status();
        foreach ($status as $project_id => $project) {
            foreach ($project as $langcode => $project_info) {
                $info = '';
                if ($project_info->type == LOCALE_TRANSLATION_LOCAL || $project_info->type == LOCALE_TRANSLATION_REMOTE) {
                    $local = isset($project_info->files[LOCALE_TRANSLATION_LOCAL]) ? $project_info->files[LOCALE_TRANSLATION_LOCAL] : null;
                    $remote = isset($project_info->files[LOCALE_TRANSLATION_REMOTE]) ? $project_info->files[LOCALE_TRANSLATION_REMOTE] : null;
                    $local_age = $local->timestamp? format_date($local->timestamp, 'html_date'): '';
                    $remote_age = $remote->timestamp? format_date($remote->timestamp, 'html_date'): '';

                    if ($local_age >= $remote_age) {
                        $info = $this->trans('commands.locale.translation.status.messages.translation-project-updated');
                    } else {
                        $info = $this->trans('commands.locale.translation.status.messages.translation-project-available');
                    }
                } elseif ($project_info->type == LOCALE_TRANSLATION_CURRENT) {
                    $info = $this->trans('commands.locale.translation.status.messages.translation-project-updated');
                } else {
                    $local_age = '';
                    $remote_age = '';
                    $info = $this->createInfoString($project_info);
                }

                $status_report[$langcode][] = [$project_info->name, $project_info->version, $local_age, $remote_age ,$info ];
            }
        }

        return $status_report;
    }
protected function projectsStatus ( ) { $ status_report = [ ] ; $ status = locale_translation_get_status ( ) ; foreach ( $ status as $ project_id => $ project ) { foreach ( $ project as $ langcode => $ project_info ) { $ info = '' ; if ( $ project_info -> type == LOCALE_TRANSLATION_LOCAL || $ project_info -> type == LOCALE_TRANSLATION_REMOTE ) { $ local = isset ( $ project_info -> files [ LOCALE_TRANSLATION_LOCAL ] ) ? $ project_info -> files [ LOCALE_TRANSLATION_LOCAL ] : null ; $ remote = isset ( $ project_info -> files [ LOCALE_TRANSLATION_REMOTE ] ) ? $ project_info -> files [ LOCALE_TRANSLATION_REMOTE ] : null ; $ local_age = $ local -> timestamp ? format_date ( $ local -> timestamp , 'html_date' ) : '' ; $ remote_age = $ remote -> timestamp ? format_date ( $ remote -> timestamp , 'html_date' ) : '' ; if ( $ local_age >= $ remote_age ) { $ info = $ this -> trans ( 'commands.locale.translation.status.messages.translation-project-updated' ) ; } else { $ info = $ this -> trans ( 'commands.locale.translation.status.messages.translation-project-available' ) ; } } elseif ( $ project_info -> type == LOCALE_TRANSLATION_CURRENT ) { $ info = $ this -> trans ( 'commands.locale.translation.status.messages.translation-project-updated' ) ; } else { $ local_age = '' ; $ remote_age = '' ; $ info = $ this -> createInfoString ( $ project_info ) ; } $ status_report [ $ langcode ] [ ] = [ $ project_info -> name , $ project_info -> version , $ local_age , $ remote_age , $ info ] ; } } return $ status_report ; }
LOCALE_TRANSLATION_REMOTE
and LOCALE_TRANSLATION_LOCAL indicate available new translations,
LOCALE_TRANSLATION_CURRENT indicate that the current translation is them
most recent.
LOCALE_TRANSLATION_REMOTE and LOCALE_TRANSLATION_LOCAL indicate available new translations LOCALE_TRANSLATION_CURRENT indicate that the current translation is them most recent .