\apex\coretranslate

Handles all functionality for tranlsation / language packs, including parsing all TPL / PHP files and extracting the necessary engish words / pharses from them, generating the language packs, and more.

Summary

Methods
Properties
Constants
add_hash()
compile_language_pack()
No public properties found
No constants found
parse_tplfile()
parse_phpfile()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

add_hash()

add_hash(string  $text,string  $type = 'system')

Add a new translation word / phrase

Adds a string of text to the internal_transactions table with the proper hash, which can then be translated into other languages.

Parameters

string $text

The text to add as a hash, and ready for translation.

string $type

Helps differentiate the text strings. Generally always either 'system', 'admin', 'members', or 'public'.

compile_language_pack()

compile_language_pack()

/ *Compile language pack of the system.

Goes through all templates and PHP files, pulls out the text, and ensures a MD5 hash of each string is within the 'internal_transactions' table, which is then used to translate to other languages.

parse_tplfile()

parse_tplfile(string  $tpl_file)

Parse TPL file for translation

Parses a TPL template file, extracts the necessary English text, and ensures it's within the 'internal_transactions' table with a MD5 hash, to be used for translation into multiple languages.

Parameters

string $tpl_file

Location of the TPL file, relative to the / installation directory.

parse_phpfile()

parse_phpfile(string  $php_file)

Parses a PHP file for translation.

Extracts all necessary English text from tr(), add_message(), and trigger_error() functions, and ensures it's in the 'internal_transactions' table with a MD5 hash, to be used for translation into multiple languages.

Parameters

string $php_file

Location of the PHP file relative to the / installation directory.