'English', 'es' => 'Español', 'de' => 'Deutsch', 'fr' => 'Français', 'pt_BR' => 'Português do Brasil', 'ru' => 'Russian', 'ja' => '日本語', 'zh' => '简体中文', ]; function common_header(string $description): void { global $MYSITE; $meta_image_path = \htmlspecialchars( \filter_var($MYSITE . 'images/php8/php_8_2_released.png', \FILTER_VALIDATE_URL)); $meta_description = \htmlspecialchars($description); \site_header("PHP 8.2.0 Release Announcement", [ 'current' => 'php8', 'css' => ['php8.css'], 'meta_tags' => << META ]); } function language_chooser(string $currentLang): void { // Print out the form with all the options echo '
'; } function message($code, $language = 'en') { $original = require __DIR__ . '/languages/en.php'; if (($language !== 'en') && file_exists(__DIR__ . '/languages/' . $language . '.php')) { $translation = require __DIR__ . '/languages/' . $language . '.php'; } return $translation[$code] ?? $original[$code] ?? $code; }