Addon Codes - gtbu/Typesetter5.2 GitHub Wiki

Experienced developers will find code-examples in the code of existing plugins.

  • A problem are the many languages :

I you want to add a language to an addon - a hint : You can store Your own language-translations in the addon-directory:

function Load_Language($lang = 'en', &$msg) {
    global $addonPathCode;

    $langFile = $addonPathCode . '/language/lang_' . $lang . '.php';  
    if (file_exists($langFile)) {
        include($langFile);
    } else {
        include($addonPathCode . '/language/lang_en.php');  // default
    }
}

with lang_en.php 
$msg['visible'] = 'visible';
$msg['hidden'] = 'hidden';
$msg['save'] = 'save'; .......expandable....

In the sourcecode it is used with :

$msg = []; Load_Language('en',$msg); ... and ..... echo $msg['save'];