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

lang_translation_order()

Description

Restore the source pack's key order after validating the response.

Parameters

ColumnTypeDefaultDescription
$source mixed English source value.
$translation: mixed
$translation mixed Validated translation.

Return

mixed Translation ordered like the source.

Location

include/lang_translation_functions.php lines 191 to 200

Definition

 
function lang_translation_order(mixed $source, mixed $translation): mixed
{
    if (
is_array($source)) {
        foreach (
$source as $key => &$value) {
            
$value = lang_translation_order($value, $translation[$key]);
        }
        return 
$source;
    }
    return 
$translation;
}

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.