} if (!isset($page['path'])) { $page['path'] = str_replace($sitewide['root'], '/', $sitewide['path']); $page['path'] = str_replace('/' . $page['lang'] . '/', '/', $page['path']); } if (!isset($page['name'])) { $page['name'] = trim(preg_replace('#\\.php$#', '', $page['path']), '/'); if (empty($page['name'])) { $page['name'] = 'index'; } } if (isset($page['title'])) { $page['title'] = $l10n->translate($page['title'], $page['name']); } $l10n->init(); $l10n->set_domain('layout'); $l10n->begin_html_translation(); ?> <!doctype html> <!--[if IE 9]><html lang="<?php echo !empty($page['lang']) ? $page['lang'] : 'en'; ?> " class="ie9"><![endif]--> <!--[if (gt IE 9)|!(IE)]><!--><html lang="<?php echo !empty($page['lang']) ? $page['lang'] : 'en'; ?> "><!--<![endif]--> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
$newTranslations[$id] = false; } return; // Disabled translation } $newTranslations[$id] = html_entity_decode($string); } if ($isMarkdown) { // Read markdown file $markdown = file_get_contents($target); // Render markdown as html $parsedown = new ParsedownExtra(); $html = $parsedown->text($markdown); $html = str_replace('⌘', '⌘', $html); // Process html $l10n->set_domain($captureDomain); $l10n->translate_html($html, 'capture_translation'); } else { chdir('..'); $_SERVER['DOCUMENT_ROOT'] = dirname(__DIR__); define('HTML_I18N', 1); // Do not start output buffering twice ob_start(function ($input) use($l10n) { $l10n->translate_html($input, 'capture_translation'); return ''; }); // Include target file include $target; ob_end_flush(); // Add page title to translations if (!empty($page['title'])) {