Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

i18n_get_all_translations()

Description

Return an array of all available language strings for the given id, with the language code as the key

Parameters

ColumnTypeDefaultDescription
$langid: string
$langid string The identifier of the lang string

Return

array *

Location

include/language_functions.php lines 724 to 755

Definition

 
function i18n_get_all_translations(string $langid): array
    {
    global 
$lang;
    
$savedlang $lang;
    
$alltranslations = [];
    foreach(
$GLOBALS["languages"] as $langcode=>$availlanguage)
        {
        if (
$langcode!="en")
            {
            if (
substr($langcode21)!='-')
                {
                
$langcode substr($langcode02);
                }
            
            
$use_error_exception_cache $GLOBALS["use_error_exception"]??false;
            
$GLOBALS["use_error_exception"] = true;
            try
                {
                include 
dirname(__FILE__)."/../languages/" safe_file_name($langcode) . ".php";
                }
            catch (
Exception $e)
                {
                
debug("Unable to include language file $langcode.php" $e->getMessage());
                }
            
$GLOBALS["use_error_exception"] = $use_error_exception_cache;
            }
        
$alltranslations[$langcode] =$lang[$langid];
        }
    
// Revert to original
    
$lang $savedlang;
    return 
$alltranslations;
    }

This article was last updated 17th November 2024 15:35 Europe/London time based on the source file dated 28th October 2024 11:15 Europe/London time.