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

get_translated_activity_type()

Description

Retrieves the translated version of an activity type.

This function takes an activity type string, checks if a corresponding
translation exists in the global language array, and returns the
translated string if available. If no translation is found, it returns
the original activity type.

Parameters

ColumnTypeDefaultDescription
$activity_type string The activity type in plain text English.

Return

string The translated activity type if available; otherwise, the original activity type.

Location

include/reporting_functions.php lines 666 to 679

Definition

 
function get_translated_activity_type($activity_type)
    {
    
# Activity types are stored in plain text english in daily_stat. This function will use language strings to resolve a translated value where one is set.
    
global $lang;
    
$key="stat-" strtolower(str_replace(" ","",$activity_type));
    if (!isset(
$lang[$key]))
        {
        return 
$activity_type;
        }
    else
        {
        return 
$lang[$key];
        }
    }

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