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

lang_translation_batch_results()

Description

Validate each locale independently so a bad entry cannot discard another locale's translations.

Parameters

ColumnTypeDefaultDescription
$batch array Requested entries keyed by locale and then language key.
$candidate: mixed
'rejected'
$candidate mixed Decoded response.

Return

array{accepted: array, rejected: array} Accepted values and failure reasons grouped by locale.

Location

include/lang_translation_functions.php lines 356 to 368

Definition

 
function lang_translation_batch_results(array $batch, mixed $candidate): array
{
    
$results = ['accepted' => [], 'rejected' => []];
    foreach (
$batch as $locale => $entries) {
        
$result = lang_translation_results($entries, is_array($candidate) ? ($candidate[$locale] ?? null) : null);
        foreach (
$result as $status => $values) {
            if (
$values !== []) {
                
$results[$status][$locale] = $values;
            }
        }
    }
    return 
$results;
}

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.