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 605 to 615

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 18th March 2025 15:05 Europe/London time based on the source file dated 21st January 2025 15:20 Europe/London time.