Coding standards
Security in ResourceSpace
Developer reference
Database
User api session functions
Geolocation functions
Storage test functions
Cli functions
Lang translation functions

lang_translation_dashboard_lines()

Description

Format the live view of the translation queue and the available request slots.

Parameters

ColumnTypeDefaultDescription
$slots array Status for each request slot, keyed by slot number.
$finished int Accepted and permanently failed translations.
$total int Total translations in this component.
$active int Currently active requests.
$queued int Waiting requests.
$frame int Current spinner frame.
$now : float
$complete
$remaining] cli_progress_frame$finished
]]; > $slot
'style' > 'heading'
$now float Current time in seconds.

Return

list<array{text: string, style: string}> Status rows.

Location

include/lang_translation_functions.php lines 470 to 496

Definition

 
function lang_translation_dashboard_lines(
    array 
$slots,
    
int $finished,
    
int $total,
    
int $active,
    
int $queued,
    
int $frame,
    
float $now
): array {
    [
$icon, $complete, $remaining] = cli_progress_frame($finished, $total, $frame);
    
$lines = [[
        
'text' => "{$icon}  {$complete}{$remaining}  {$finished}/{$total} processed"
            
. "  ·  {$active} active  ·  {$queued} queued",
        
'style' => 'heading',
    ]];
    foreach (
$slots as $number => $slot) {
        
$detail = $slot['detail'];
        if (isset(
$slot['started'])) {
            
$detail = sprintf('%.1fs  %s', $now - $slot['started'], $detail);
        }
        
$lines[] = [
            
'text' => sprintf('  %02d  %-12s %s', $number, $slot['state'], $detail),
            
'style' => $slot['style'],
        ];
    }
    return 
$lines;
}

This article was last updated 27th November 2026 18:35 Europe/London time based on the source file dated 27th November 2026 17:15 Europe/London time.