πŸ“¦ Class \lang

/**
 * LANG
 * language class
 * - load language file 
 * - get texts by keys - incl. unlimited nested subkeys 
 * --------------------------------------------------------------------------------<br>
 * @author Axel Hahn
 * @link TODO
 * @license GPL
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL 3.0
 * @package IML-Appmonitor
 * 
 * 2024-07-19  axel.hahn@unibe.ch  php 8 only: use typed variables
 */

πŸ”Ά Properties

(none)

πŸ”· Methods

πŸ”Ή public __construct()

constructor

Return: ``

Parameters: 1

Parameter Type Description
<optional> $sLang = β€˜β€™ *

πŸ”Ή public getAllEntries()

Get array with all entries in language file

Return: array

Parameters: 0

πŸ”Ή public getAllLanguages()

Get all available config files as flat array

Return: array

Parameters: 0

πŸ”Ή public load()

Load language texts with given language name. It loads the texts from the language json file and updates the value for current language. It returns false if the given language doesn’t exist

Return: bool

Parameters: 1

Parameter Type Description
<required> string $sLang string name of language (without extension β€œjson”)

πŸ”Ή public tr()

Translate a text with language file and key(s) A found text key in the key has priotity vs global definitions in root level

Return: string *

Parameters: 2

Parameter Type Description
<required> string $sWord string item to find in language array
<optional> $aSubkeys = false subkeys * subkeys to walk in (for nested lang files); eg [β€œgui”]

Generated with Axels PHP class doc parser.