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

register_plugin_language()

Description

Registers the language files for a specified plugin.

Parameters

ColumnTypeDefaultDescription
$plugin string The name of the plugin for which to register language files.

Return

void This function does not return a value; it modifies the global $lang variable.

Location

include/plugin_functions.php lines 1537 to 1572

Definition

 
function register_plugin_language($plugin)
    {
    global 
$plugins,$language,$pagename,$lang,$applicationname,$customsitetext;

    
# Include language file
    
$langpath get_plugin_path($plugin) . "/languages/";

    if (
file_exists($langpath "en.php"))
        {
        include 
$langpath "en.php";
        }

    if (
$language != "en")
        {
        if (
            
substr($language21) == '-'
            
&& substr($language02) != 'en'
            
&& file_exists($langpath safe_file_name(substr($language02)) .  ".php")
            ) {
                include 
$langpath safe_file_name(substr($language02)) . ".php";
            }
        if (
file_exists($langpath safe_file_name($language) . ".php"))
            {
            include 
$langpath safe_file_name($language) . ".php";
            }
        }

    
// If we have custom text created from Manage Content we need to reset this
    
if(isset($customsitetext))
        {
        foreach (
$customsitetext as $customsitetextname=>$customsitetextentry)
            {
            
$lang[$customsitetextname] = $customsitetextentry;
            }
        }
    }

This article was last updated 14th December 2024 19:35 Europe/London time based on the source file dated 29th November 2024 10:35 Europe/London time.