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

resolve_pdf_language()

Parameters

This function accepts no parameters.

Location

include/pdf_functions.php lines 361 to 396

Definition

 
function resolve_pdf_language(){
    global 
$language;

    
$asdefaultlanguage 'en';
    
    
$supported_lang_files scandir(__DIR__ '/../lib/html2pdf/src/locale');
    
$supported_langs      = array();

    foreach(
$supported_lang_files as $file)
        {
        
$sl=pathinfo($filePATHINFO_FILENAME);
        if(!
in_array($sl, array("",".","..")))
            {
            
$supported_langs[]=$sl;
            }
        }
    if(
in_array($language$supported_langs))
        {
        return 
$language;
        }
    else
        {
        switch(
$language)
            {
            case 
"es-AR":
                return 
"es";
                break;
            case 
"pt-BR":
                return 
"pt";
                break;
            default:
                
// this includes en-US
                
return $asdefaultlanguage;
            }
        }
}

This article was last updated 11th December 2024 11:35 Europe/London time based on the source file dated 27th November 2024 15:30 Europe/London time.