Example #1
0
function pdf24Plugin_setLang()
{
    global $pdf24Plugin;
    $trylangs = array();
    $lang = get_option('pdf24Plugin_language');
    if ($lang) {
        $trylangs[] = $lang;
    }
    if (defined('WPLANG') && strlen(WPLANG) >= 2) {
        $trylangs[] = strtolower(substr(WPLANG, 0, 2));
    }
    $trylangs[] = $pdf24Plugin['defaultLang'];
    $trylangs[] = 'en';
    $trylangs[] = 'de';
    $found = false;
    foreach ($trylangs as $tryLang) {
        $pdf24Plugin['useLang'] = $tryLang;
        $langFile = $pdf24Plugin['dir'] . '/lang/' . $tryLang . '.php';
        if (file_exists($langFile)) {
            $found = true;
            break;
        }
    }
    if (!$found) {
        $pdf24Plugin['lang'] = array();
    } else {
        include_once $langFile;
        if (!isset($pdf24Plugin['lang']) || !is_array($pdf24Plugin['lang'])) {
            $pdf24Plugin['lang'] = array();
        }
    }
    if (pdf24Plugin_isCustomizedLang()) {
        $pdf24Plugin['customLang'] = pdf24Plugin_getCustomizedLang();
    }
}
Example #2
0
	<div>
		<a name="customLang"></a>
		<h3>Custom language</h3>
		<div class="descr">Here you can enter your own language elements for PDF creation boxes displayed on your pages.
		Behind each box is displayed the original english text.</div>
		<table>
		<tr>
			<td class="tr1">Cutomize language</td>
			<td><input type="checkbox" name="customLangInUse" <?php 
echo pdf24Plugin_isCustomizedLang() ? 'checked' : '';
?>
 onclick="pdf24_showHideCheck('langOptions', this);" /></td>
		</tr>
		</table>
		<table id="langOptions" class="<?php 
echo pdf24Plugin_isCustomizedLang() ? '' : 'noDis';
?>
">
		<tr>
			<td class="tr1">Custom language elements:</td>
			<td><?php 
echo pdf24Plugin_createCustomizedLangInputs();
?>
</td>
		</tr>
		</table>
	</div>
	<div>
		<?php 
$docTpls = pdf24Plugin_getDocTpl();
?>